freebsdrocks.net was started originally as nospam.mine.nu.
Ensuring the setup of the secondary server is quite simple; Just a very minimal qmail setup on a freebsd will work fine. All you need to do is install FreeBSD 10.2 and make sure ports are updated. Then run the following steps for just the secondary server:
Preinstall Checklist (Excluding Apache and Mysql)
Installing Autorespond (you can skip EZMLM)
Installing Cerbot or Using a Purchased Cert
Additions to Configuring Qmail:
When you edit the smtpd_run file please adjust following settings:
This is to announce your hostname This is optional.
You can turn on GREETDELAY. GREETDELAY will not only save you for spam mails, but unlike Greylisting and/or filtering a la SpamAssassin, this is the only mean to really reduce the overall amount of spam because the timeslot required for the spam sender to deliver messages (whether successfully or unsuccessfully) is raised from typically one second to (<=) GREETDELAY seconds. I typically have good luck with a value of 15.
SMTPGREETING="$LOCAL NO UCE"
You can disable mfcheck:
Disable validrcptto by commenting the following lines:
NOTE: If you would like your queuing server to filter valid emails, You could setup a cronjob to fetch the validrcptto.cdb file to your secondary server and then restart qmail-smtpd. You would need to enable validrcptto in the qmail guide.
I typically turn off the 3 following SPF settings:
We need to do a few things first to make sure messages arrive correctly:
Make sure /var/qmail/control/rcpthosts has a list of your qmail domains
Now setup the correct routing with /var/qmail/control/smtproutes per the examples below:
If you want to route mail from one domain to another, you would do it like so:
If you want to route all mail and then you should have the line like:
At this point qmail will be installed. I have created a new qmailtcl that just controls qmail-send and qmail-smtpd. You can download it here:
Once this is done you can change your MX record to the secondary server and then it should pass the messages directly to your qmail server.
# cd /var/qmail/bin
# mv qmailctl bak_qmailctl
# fetch http://freebsdrocks.net/qmail2/qmailctlqueueonly.tgz
# tar zxvf qmailctlqueueonly.tgz
# rm qmailctlqueueonly.tgz
# qmailctl restart