Using FreeBSD as a Secondary MX Server

I was recently asked how to use FreeBSD as a secondary, or backup, mailserver. This is actually quite simple using the built in sendmail. Do the following on the machine you want to use as your second mail server:

# cd /etc/mail
# vi relay-domains

Add your domain here and save the file. After you are done, restart your mail server as such:

# cd /etc/mail
# make restart
Restarting: sendmail sendmail-clientmqueue.

You can see where this is configured like this:

[tethys]:/etc/mail> grep relay-domains * /etc/mail/relay-domains /etc/mail/relay-domains /etc/mail/relay-domains /etc/mail/relay-domains /etc/mail/relay-domains /etc/mail/relay-domains

You can find additional information on this method and others at's documentation on relaying.