sendmail masquerading

sendmail masquerading setup on SL44 and SL50 and SL51 and SL52 and SL6X:

This configuration allows you to send mail from the command line. It also makes sure that mail sent to root on the local machine ends up on your email account.

  • Check if sendmail is installed: rpm -qa|grep sendmail
  • IFF sendmail is not installed: yum install sendmail sendmail-cf
  • Go to the directory /etc/mail and edit (as root) the file sendmail.mc

Remove the dnl (which means delete to newline, and works as comment marker in m4) on the line with the SMART_HOST and change it to look like this:
define(`SMART_HOST’,`smtp.uu.se’)

  • Remove the dnl and change the lines:
MASQUERADE_AS(`kemi.uu.se')dnl
FEATURE(masquerade_envelope)dnl
  • Add the following lines just below the previous line:
FEATURE(genericstable, `hash -o /etc/mail/genericstable')
GENERICS_DOMAIN_FILE(`/etc/mail/genericsdomain')
  • Save the file.
  • Create a file /etc/mail/genericsdomain by issuing:
hostname -f >/etc/mail/genericsdomain
  • Create a file /etc/mail/genericstable and put a line like the following line into it (use a tab as separation between the fields!) replace with your email address:

root daniels@mkem.uu.se

  • On SL50 and SL51 and SL52 and SL6X, also add an extra line to /etc/mail/genericstable, replace with your email address:

logwatch daniels@mkem.uu.se

  • Type make (still in /etc/mail)
  • If you get an error message when make is typed, concerning sendmail-cf install sendmail-cf by issuing

yum install sendmail-cf
and finally type make again.

  • Edit the file /etc/aliases and change the line at the bottom to point to yourself:

# Person who should get root’s mail
root: daniels@mkem.uu.se

  • You may need to disable the postfix mailer before starting sendmail. Check system-config-services. Disable postfix, stop postfix. Then start sendmail.
  • Finally run “newaliases”, and restart the sendmail server by /etc/init.d/sendmail restart

If you have problems with this, you can also check the logfile /var/log/maillog

Comments are closed.