Spam-Proofing Your Qmail Server
By Chris Woodard, April 01, 2003
The Mail Transfer Agent (MTA) qmail is a popular alternative to Sendmail. Qmail has a number of features that make it easy to spam-proof. Qmail separates the functions of SMTP transaction capture and delivery queuing into different processes. It does this in such a way that external programs can be invoked to intercept messages on their way from the SMTP daemon to the delivery queuing daemon and filter out those that meet the organization's criteria for spam (including originating IP, keywords in the title or message body, or Bayesian word distribution). This can help reduce the amount of incoming spam. Qmail also has a feature that lets an administrator keep spammers from using the mail server as a mail relay to hide the origin of the spam.
Listing 1 xinetd configuration for qmail smtpd that invokes tcpd
as a wrapper around qmail-smtpd
# default: on
# description: smtp for qmail.
service smtp
{
disable = no
flags = REUSE NAMEINARGS
socket_type = stream
protocol = tcp
wait = no
user = qmaild
server = /usr/sbin/tcpd
server_args = /var/qmail/bin/tcp-env _R \
/var/qmail/bin/qmail-smtpd
}
(A similar configuration file can be used for qmail-pop3d, which is
qmail's built-in POP3 daemon.)