Replacing Your Current SMTP Server
The simplest (and least scary, for those who worry about those kinds of things) strategy for installing qpsmtpd is to change your current SMTP server to run on a different port, and simply have qpsmtpd forward to that SMTP server after its spam filtering. That way you get the best of all worlds--you keep your current stable email environment, and you get all the spam-filtering goodness that qpsmtpd brings.
First, create a qpsmtpd configuration file for the plugins that you want to load. In your
qpsmtpd directory, edit the file config/plugins to contain the following lines:
count_unrecognized_commands 4 check_badmailfrom check_badrcptto check_spamhelo # this plugin needs to run after all other "rcpt" plugins rcpt_ok # we'll turn this on later #spamassassin # deliver to localhost:2525 queue/smtp-forward localhost 2525
If you are not currently running Qmail, you will also need to create the file config/rcpthosts, containing a list of domains for which you currently receive email. Qmail users can relax, as qpsmtpd will read /var/qmail/control/rcpthosts by default.
# rcpthosts - who I receive email for # put your domain name in here example.com
Make sure you do a simple test of this new configuration as shown above.
Next, convince your current SMTP server (qmail, postfix, exim, or whatever you currently use) to run on a port 2525. I'll leave that up to you to work out, as every SMTP server configures this differently. If you get stuck, ask on the qpsmtpd mailing list for help.
To run qpsmtpd on port 25, pass that option on the command line:
$ ./qpsmtpd-forkserver -u $USER -p 25
$ swaks -t firstname.lastname@example.org -f email@example.com -h \ foo -s localhost
If everything is successful, you should see:
<- 250 Queued! -> QUIT <- 221 myserver.example.com closing connection. Have a wonderful day. === Connection closed by foreign host.
Now, if you have a working installation of SpamAssassin and a running spamd daemon, feel free to enable the SpamAssassin plugin in config/plugins and restart the server. By default this will just add headers to the email, but see
perldoc plugins/spamassassin for details on how you can get it to reject mail over a certain threshold.