cancel
Showing results for 
Search instead for 
Did you mean: 

Can't mail from root

Joe Short
Super Advisor

Can't mail from root

My client needs to send email outside of their own domain. However, they are blocking all mail from any user named root from going outside the DNS domain. When I do a mailx, it is from root@hostname.FQDN Is there any way to change who is sending the email? If my email was being sent by hostname@hostname.FQDN, I am told it would be allowed to pass through, and be delivered to the outside.
10 REPLIES
Sridhar Bhaskarla
Honored Contributor

Re: Can't mail from root

Hi,

I don't know if I understood your problem. You can override the username from which it is coming from as someoneelse like below.

sendmail -Fsomeone -fsomename@somedomain.com toadress@todomain.com < your_file

Look at -f option of sendmail. You will need to add the user (I guess root in this case) as a trusted user in sendmail.cf file.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
steven Burgess_2
Honored Contributor

Re: Can't mail from root

Hi

Create the user that is allowed to send mail outside of the domain then send as that user

HTH

Steve
take your time and think things through
Joe Short
Super Advisor

Re: Can't mail from root

I need to set some sort of variable so that outgoing mail is from any user except root. Unfortunately neither of the solutions above worked.
Patrick Wallek
Honored Contributor

Re: Can't mail from root

Try the '-r from@address.com' option to mailx.

The syntax would be:

# mailx -s "subject" -r someone@somwhere.com toaddress@somewhereelse.com
Sridhar Bhaskarla
Honored Contributor

Re: Can't mail from root

Well, then I still have to understand your problem.

As root, send the mail like

#sendmail -F -fhostname@hostname.FQDN < your_file

Your_file may have the contents like this

From: root of
Subject: This is some message

Bla bla bla

This does go out like hostname@hostname.FQDN as required by you. By default root is a trusted user for sendmail. So, it should work straight without any changes.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
James A. Donovan
Honored Contributor

Re: Can't mail from root

Not sure, but you may also need to modify your /etc/mail/sendmail.cf file.

By default, the CE class macro is set to expose mail as coming from root, even if masquerading is set.

e.g.
# class E: names that should be exposed as from this host, even if we masquerade
# class L: names that should be delivered locally, even if we have a relay
# class M: domains that should be converted to $M
#CL root
CE root



Modify your sendmail.cf file so that the CE macro is blank, and try using the previously suggested methods again....
Remember, wherever you go, there you are...
Joe Short
Super Advisor

Re: Can't mail from root

After further investigation, this domain must be filtering mail from localhost. No matter what user send email outside of the local DNS domain, it gets returned top the root mail on the system. The one common situation is that they are all from user@localhost.
Hoefnix
Honored Contributor

Re: Can't mail from root

You are able to send mail to internal accounts within your domain? So mail is going out the UNIX system to a mail-relay?

Then try putting the outside domain-name in the /etc/hosts file.

Just a problem we had in the past when trying to send outside our own domain. Our internal DNS did not resolve external domanin. Sendmail likes to resolve a domain before sending it to the mail-relay. By putting the outside domain in /etc/hosts (even a fake IP will do) we got the mail send out in the WWW.

HTH,
Peter Geluk
Steven E. Protter
Exalted Contributor

Re: Can't mail from root

You can use /etc/mail/aliases to make root emails appear to come from another user

root: someone@yourdomain.net

restart sendmail then you're done.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Joe Short
Super Advisor

Re: Can't mail from root

Finally gave up on this. It is most likely some crazy aspect of the client's network, and multiple DNS domains, etc etc.
What we did was set up a mail account in the internal email system, when an email comes in, it is then forwarded out to the outside email address.
Not what I would have liked, but time is an issue, and we needed to get something working.