Configure sendmail masquerading

From Peter Pap's Technowiki
Jump to: navigation, search

The common issue we can run into is that when Solaris sends email, by default it will use the hostname of the sending server as the senders domain. So an email from the apps user on the host will have a sender address of The issue with this is that some mail servers will reject this email as it will not be able to resolve the domain Sendmail logs may show something like this:

Jan 15 05:37:56 mailrelay sendmail[3349]: r0F5a3FZ003346: to=<>, ctladdr=<> (502/502), delay=00:01:53, xdelay=00:01:52, mailer=esmtp, pri=122682, [xx.xx.xx.xx], dsn=4.1.8, stat=Deferred: 450 4.1.8 <>: Sender address rejected: Domain not found

There are two ways to fix this:

   Create a DNS domain called
   Get the sending server to masquerade as a different domain, eg., that is resolvable in the real world.

Obviously, option one is difficult and ugly! Options 2 is easy and this is how you do it:

1.Log on to your server and go to the mail config directory

       cd /etc/mail/cf/cf

2. Delete this line from

       FEATURE(`msp', `[]')dnl

Add these lines to at the end of the file:

       FEATURE(`msp', `')dnl

EXPOSED_USER isn't necessary. I like it so that when my hosts send log messages as root, it will still give me their host domain, i.e. emails for root are still sent as and I can see which host sent them!

3. Compile a new file and install it

       cd /etc/mail
       cp /etc/mail/cf/cf/ .

4. Restart the sendmail client:

       svcadm restart sendmail-client

Now all email, except for root, will go out as, in this example.