Backscatter protection

kevinb

Verified User
Joined
Jul 27, 2006
Messages
101
I've been working on adding in backscatter protection to exim. I found a recipe at http://psg.com/~brian/software/authbounce/configure-authbounce.txt.

I've added in the following to the exim.conf and it works great minus 1 caveat. There are certain situations that you want to accept messages that would otherwise be blocked as invalid bounces. As an example voicemail messages from VOIP systems will generally not contain a return path.

I would like to see in Spam Filters section an option for a user to disable the feature. I can then add a check in the exim.conf. Even better would be a list of domains/users that can be used to bypass the filter.

Main exim.conf
Code:
BOUNCE_ID = example-com-1
BOUNCE_SECRET = ********************

After check_messages:
Code:
  deny senders = :
       condition = ${if ! eq{$recipients_count}{1}{1}}
         message = Bounces must have only a single recipient
 
   deny        senders = :
       ! condition = ${if match \
       {$message_body $message_body_end} \
   {[xX]-bounce-key:\\s*BOUNCE_ID;${rxquote:${lc:$recipients}};(\\d+);(\\w+)} 
       {${if eq {$2} \
               {${length_8:${md5:BOUNCE_ID;${lc:$recipients};$1;BOUNCE_SECRET}}} \
               {${if <{${sg{${eval:$tod_epoch-$1}}{-}{}}}{864000}{1}}}}}}
       message = Bounce does not contain a valid X-bounce-key signature

Inside remote_smtp:
Code:
   headers_add = ${if eq{$return_path}{}{}{X-bounce-key: BOUNCE_ID;${lc:$return_path};$tod_epoch;${length_8:${md5:BOUNCE_ID;${lc:$return_path};$tod_epoch;BOUNCE_SECRET}};}}
 
I get loads of backscatter, so I cut and pasted this recipe into exim.conf - but no joy: in the paniclog:

2008-05-29 13:56:01 Exim configuration error in line 507 of /etc/exim.conf:
error in ACL: unknown ACL condition/modifier in "{${if eq {$2} {${length_8:${md5:issihosts.com-1;${lc:$recipients};$1;f3a49092bc5e2d892c4e5fa5b7bb7811}}} {${if <{${sg{${eval:$tod_epoch-$1}}{-}{}}}{864000}{1}}}}}}"

BOUNCE_SECRET was generated with: head -c16 /dev/urandom | md5sum

So I started doing some reading and found out that Exim has a thing called BATV built in to do just this sort of thing. Trouble is I am not all that familiar with Exim and the docs (section 40.47 online) on that feature gave me headache w/o any clue on how to to apply this to my current spamblocker config. Any exim experts out there to make any sense of this? Or any clue as to what is wrong with the above?

The method in this thread has the advantage of not doing anything funny to the sender address (like adding a /) but I did see some discussion of a exim bug that breaks hash validation every 1000 days. On the other hand, I haven't a clue if the injected / would send any other part of the spamblocker config down in flames. Any one done this?
 
Back
Top