[Exim] Avoiding frozen spam

Top Page
Delete this message
Reply to this message
Author: Mark Edwards
Date:  
To: exim-users
Old-Topics: Re: [Exim] TLS on a port other than 25
Subject: [Exim] Avoiding frozen spam
I'm moving a spamassassin-based anti-spam system from having messages
tagged as spam and sent to a mailbox for human review, to rejecting
messages tagged as spam with an explanatory message directing real
humans to add a nospam- prefix to the To address to have the message
accepted.

It all works great. I followed the guide at
http://afp548.com/Articles/mail/exim4-2.html, which uses a system filter
to generate a fail message from a message tagged as spam:


if first_delivery and
   $h_X-Spam-Flag: contains "YES"
then
   logfile /var/log/exim/spamlog
   logwrite "$tod_log From: $h_From: Subject: $h_Subject: \n \t
X-Spam-Status: $h_X-Spam-Status: Sender: $sender_address"
   if $h_From: is not ""
   then
        fail "<<spam filter>> Your message has been rejected because it
appears to be spam. If this is not the case, please append nospam- to
the beginning of the e-mail address and send again. For example,
bobjones@??? would become nospam-bobjones@???"
   endif
   seen finish
endif




The only remaining issue is that, of course, the 200+ spams that come in
each day each generate a frozen message because non of the return
addresses work. My stopgap measure is to implement a daily crontab to
delete frozen messages. However, ideally I want to know about frozen
messages that are not tagged as spam.

What is a good way to tell exim to send a notification such as the
above, but ignore it if that notification bounces? Or better yet, test
the return address for validity first and give up immediately if (like
99.999% of spam) the return adddress goes nowhere? I don't see any way
of adding an address check to a system filter.

Can someone suggest an elegant way of achieving this? Thanks!