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 *
freebsd.cf:FR-o /etc/mail/relay-domains
freebsd.submit.cf:FR-o /etc/mail/relay-domains
sendmail.cf:FR-o /etc/mail/relay-domains
submit.cf:FR-o /etc/mail/relay-domains
tethys.ringofsaturn.com.cf:FR-o /etc/mail/relay-domains
tethys.ringofsaturn.com.submit.cf:FR-o /etc/mail/relay-domains
[tethys]:/etc/mail>

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