Re: [exim] Forward question

Top Pagina
Delete this message
Reply to this message
Auteur: 韓家標 Bill Hacker
Datum:  
Aan: exim users
Onderwerp: Re: [exim] Forward question
Jeff Lasman wrote:
> On Friday, December 23, 2011 08:29:11 AM Jone Colmenero wrote:
>
>> Good afternoon guys!
>>
>>     I have the following question:

>>
>> I need to redirect all mail in the Subject containing the term "Test
>> Email" to a particular account.
>
> Exim won't even see or care about the subject until the mail is received.
> Once it's received you can filter it with exim.pl.
>
> Jeff


Or, in DATA phase, with either a lookup for any reasonably predictable
string, such as 'Test message' (or in this case uber-common spam):

===

# DATA_9: Check for forbidden strings in Subject: IF found THEN WARN
#
warn
condition= ${lookup{$h_Subject:}nwildlsearch{/var/filters/badsub}{1}{0}}

(set an acl_m variable here, and have a router/transport act on it)

NB: 'badsub' is an ordinary flat file, one-entry-per-line structure
===

ELSE with a regex ('trigger' is a less-predictably-placed sub-string, in
any of the 'Received' headers in this example, but that's easy to change):

===

# DATA_SCAN_01A1: IF message is from known spam-engine THEN deny
#
deny
regex       = ^Received:: .*PowerMTA


(make this a 'warn' for your use, use it to set an acl_m to direct the
router/transport to where you want the message delivered)

====

Perl is useful - but best to save the overhead for the harder stuff...


Bill

--
韓家標