Friday, October 2, 2009

Episode 9: How do I setup a Sendmail server to forward all mail to a different mail server?

First, you setup the mail server to allow connections from other systems. Change the following line in the /etc/mail/sendmail.mc file:




DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl


to:




DAEMON_OPTIONS(`Port=smtp, Name=MTA')dnl


Add the following line to the /etc/mail/sendmail.mc file:




define('SMART_HOST', 'hostname')


Where hostname is the hostname or the IP address of the other mail server. Next, rebuild your m4 macros and restart Sendmail. Execute the commands:




make -C /etc/mail
service sendmail restart


All mail sent to the primary mail server will forward mail to the server defined in the Smart Host option

No comments:

Post a Comment