[Exim] How to stop some domains using filter?

Top Page
Delete this message
Reply to this message
Author: Toralf Lund
Date:  
To: Exim Mailing List
Subject: [Exim] How to stop some domains using filter?
Consider the following section

if $domain does not contain procaptura
then
save imap/OldAddr
noerror mail from $local_part@$domain subject "Failure notice:
$h_subject" expand file .oldaddr.msg return message
endif

fro my personal filter. I'm doing this to stop messages (but store them
in a special folder for later reference) addressed to anything except
the domain now considered correct; our mx also receives messages for
several others that were used in the past.

This works most of the time, but some messages to old addresses are
still let through. It may seem like the problem is that the filter test
will not catch messages that are sent to an *alias* representing my
address. Questions:

   1. How exactly does domain get set?
   2. Is there a better way to check the address? I considered testing
      $header_To, $header_Cc etc., but was afraid I might loose
      something that way; a simple $domain test seemed more foolproof if
      you know what I mean. Is there anything I have to keep in mind if
      I test the headers instead? Can I *always* expect messages to have
      a header containing my address? (Even for messages sent with Bcc,
      forwarded mail etc.)


- Toralf