[Exim] header sender verification problem

Top Page
Delete this message
Reply to this message
Author: Phil Chambers
Date:  
To: exim-users
Subject: [Exim] header sender verification problem
I would like to block messages with certain header sender addresses, an example
being the hahaha@??? type. I could use the filter from ftp.exim.org but
then I get loads of bounces to the MAILER-DEAMON mailbox because the messages always
arrive with an SMTP MAIL FROM: <>. (The seyfun.net ones, for example.)

I have set

receiver_verify
sender_verify
sender_verify_reject
headers_sender_verify
headers_check_syntax
headers_check_fail

and set up the following router

blocked_senders:
driver = queryprogram
command = /usr/local/exim/blocked.pl
command_user = exim
command_group = mail
condition = \
${lookup{$local_part@$domain}lsearch{/usr/local/exim/blocked-senders}{yes}{no}

The program /usr/local/exim/blocked.pl is a simple perl script which just returns
the text "FORCEFAIL This address is blocked" at present. The file used in the
"condition" contains addresses to be rejected.

This does actually cause a 550 failure at the end of the data phase of the SMTP, but
the text "This address is blocked" does not appear, instead:

550 rejected: there is no valid sender in any header line (envelope sender is <>)

Using -d9 on the daemon shows that the text was returned by the blocked.pl script:

command wrote: FORCEFAIL This address is blocked

Further experimentation also showed that even an RCPT TO <hahaha@???> did
not get the text back with the 550 rejection. The text does not appear in any
log either. Am I doing something wrong, is this a bug or does the FORCEFAIL text
only get used outside of verify? Perhaps there is a different way to do what I want?

Phil.
---------------------------------------
Phil Chambers (postmaster@???)
University of Exeter