I have just taken over a qmail installation prepared using the excellent 
toaster, and my first task was to solve a spam problem.

One of our users has all his mail forwarded to his address at spamcop.net. 
He gets some spam addressed to him here, which gets forwarded, and then he 
reports it to spamcop as spam.

Unfortunately the spamcop program which parses the headers of reported spam 
does not seem to be happy with the Received lines generated by our qmail 
installation. In particular, when we receive the mail from outside, qmail 
puts in the following Received line...

Received: from unknown (HELO relay2.tidymail.co.uk) (217.146.107.7)
  by 0 with (DHE-RSA-AES256-SHA encrypted) SMTP; 24 Nov 2005 18:06:40 -0000

According to a spamcop administrator, it is not happy with "by 0" in the 
above header, and assumes that this header, and everything that follows, is 
a forgery.

Mutch head scratching, reading of documentation and consulting source 
followed. Turns out the answer is simple.

In the toaster, the /service/run/qmail-smtpd/run file contains a tcpserver 
command with the "-H" and "-l 0" options. "-H" tells tcpserver not to look 
up the host name of the connecting IP address, hence the "unknown" in the 
Received line. "-l 0" tells tcpserver to use a local host name of "0", 
hence the "by 0".

I have changed all the qmail run files with tcpserver commands (smtpd, 
pop3d and pop3ds) to omit the "-H", and otherwise to follow the template 
suggested in "Life with QMail", e.g.

#!/bin/sh
QMAILDUID=`id -u vpopmail`
NOFILESGID=`id -g vpopmail`
MAXSMTPD=`cat /var/qmail/control/concurrencyincoming`
LOCAL=`head -1 /var/qmail/control/me`

exec /usr/local/bin/softlimit -m 8000000 \
    /usr/local/bin/tcpserver -v -R -l "$LOCAL" \
    -x /home/vpopmail/etc/tcp.smtp.cdb -c "$MAXSMTPD" \
    -u "$QMAILDUID" -g "$NOFILESGID" 0 smtp \
    /var/qmail/bin/qmail-smtpd \
    /home/vpopmail/bin/vchkpw /bin/true 2>&1

Questions:
Why is the toaster setting the way it is? 
Is there some advantage to offset the odd Received lines? 
What are the disadvantages of the way I have it?
Should I have just done qmail-smtpd, instead of all three?

-- 
Nikki Locke, Trumphurst Ltd.      PC & Unix consultancy & programming
http://www.trumphurst.com/


Reply via email to