Sendmail masquerading in Solaris 8

YAS (yet-another-sigh)!

Took me a while of fiddling with /etc/mail/sendmail.cf on a solaris 8 host before resorting to google. I simply couldn’t get it to behave properly (tacking on the domain name on all mail sent to the smart relay host).

The trick is to use the good’ol m4 ways and create a better base config than the shipped one. This is how you do it:

  1. cd /usr/lib/mail/cf  (not so obvious imho)
  2. cp main-v7sun.mc sendmail.mc
  3. Add these lines to sendmail.mc:
MASQUERADE_AS(`realdomain.com')dnl
MASQUERADE_DOMAIN(`.realdomain.com')dnl
EXPOSED_USER(`root')dnl
FEATURE(`masquerade_entire_domain')dnl
FEATURE(`masquerade_envelope')dnl
  1. make sendmail.cf
  2. cp sendmail.cf /etc/mail/.
  3. kill -HUP <the sendmail daemon PID>

make is usually found in /usr/ccs/bin/.