Avoid SPAM / Backscatter

Top  Previous  Next

Qmail can send out an email when an email arrives for someone it does not know about.  (e.g. This is the default setup in Plesk's qmail setup). Typically these emails are from spammers.  And the spammers will not have provided their real address. So the 'bounce' email will trigger an error message reply and qmail will queue up the bounce email for delivery later on.  Good luck with that qmail :)

You can change the 'bounce saying ..blah..' behavior to one where the email server just ignores any email arriving for an unknown user.

Just edit /var/qmail/mailnames/$DOMAIN/.qmail-default and replace its contents with: |true

To change all domains to "swallow" spammy mail:

 

# find /var/qmail/mailnames/ |  grep .qmail-default | xargs replace "|bouncesaying 'This address no longer accepts mail.'" '|/bin/true' --

 

To log all spammy mail to syslog

for i in $(find /var/qmail/mailnames/ |  grep .qmail-default); do 

echo "|$(which logger)" '-p mail.info -t qmail "ignoring mail: invalid destination - <\$SENDER> <\$RECIPIENT>"' > $i

done