Friday, October 2, 2009

Episode 12: How do I configure sendmail to route mail to specific hosts?

This can be accomplished by adding appropriate entries to the /etc/mail/mailertable file. This file allows you to specify a domain, and where you want all email for that domain sent to. In the example below, all email destined for will be automatically forwarded to a mail server that resolves to backend.mail.server. Additionally, all email received from the network will be forwarded to a mail server that resolves to outbound.mail.server.


/etc/mail/mailertable smtp:backend.mail.server
192. smtp:outgoing.mail.server

After your modifications to /etc/mail/mailertable are complete you will need to run the following command:

makemap hash /etc/mail/mailertable.db < /etc/mail/mailertable

Then restart sendmail: service sendmail restart

No comments:

Post a Comment