spam and forwarding from @debian.org
elmo prodded me on IRC that my mail host was refusing spam with a “550 Message classified as spam”. While this is correct, it causes double-bounces to go to postmaster@debian.org, which is unintentional. At Samfundet we have a setup which doesn’t bounce spam sent to lists, it just accepts it and nullroutes it. I don’t think that’s the right way, but it’s better than annoying postmaster@debian with bounces.
I’m using exim4, and this is how I solved it. I replaced my normal spam-bounce rule:
deny message = This message was classified as SPAM
spam = nobody:true
condition = ${if >={$spam_score_int}{100}}{1}{0}}
with:
deny message = This message was classified as SPAM
spam = nobody:true
condition = ${if and {\
{!match{$recipients}{tfheen@err.no}}\
{!match{$sender_address}{tfheen@debian.org}}\
{>={$spam_score_int}{100}}\
}{1}{0}}
warn message = X-err-Devnull: spam
log_message = Eaten by spam filter \
(score=$spam_score, req=10.0)
spam = nobody
In addition, a special router is needed; mine is called
50_err_devnull:
# A special driver that redirect "X-err-Devnull"-ed mail (spam and
# virus sent to mailing lists, see the DATA ACLs) to /dev/null
err_devnull:
driver = accept
condition = ${if def:h_X-err-Devnull: {1}{0}}
transport = devnull
Finally, the devnull transport:
# Archive the mail in /dev/null
devnull:
debug_print = "T: devnull for $local_part@$domain"
driver = appendfile
file = /dev/null
This is a bit hard-coded and could probably be fixed a bit better, but it seems to work fine for me, at least.