Re: [exim] Filter Help

Página Principal
Apagar esta mensagem
Responder a esta mensagem
Autor: W B Hacker
Data:  
Para: exim users
Assunto: Re: [exim] Filter Help
steven_nikkel@??? wrote:
>> Hmm. I wonder - do you think that by using "$h_to:" it's expanding your
>> example ("'Steven Nikkel'" <steven_nikkel@???>) getting "" and then
>> trying to parse the next bit ('Steven) as a filter condition ?
>> What happens if you don't use "$h_to:" but just use $h_to: ? Another
>> option that might be worth trying is to use an expansion item (${sg or
>> ${tr perhaps) to strip out " characters from the to header.
>>
>
> I added the quotes to see if I could eliminate this issue, it failed
> without them first, so no such luck. I assume if its tripping on this
> stuff that anything weird that mail clients stick in the TO line is going
> to mess this up so I'm hoping for something cleaner.
>
>


Let's look at another possible method:

- Presumptions:

- you want 'noreply@<any_domain>.<any_tld> blocked

- and/or others, as in: <specific_local_part>@<specific_domain>.<specific_tld>


In which case, given a (production) router such as:

# ROUTE_3C ALIAS: Handle legacy-style 'system' aliases in '/etc/aliases' file.
#
system_aliases:
driver = redirect
allow_fail
allow_defer
data = ${lookup{$local_part}lsearch{/etc/aliases}}
user = <my exim daemon's UID>
group = <my exim daemon's GID>
file_transport = address_file
pipe_transport = address_pipe

====

Modified to (CAVEAT - UNTESTED)

# ROUTE_XX Block/divert: Handle banned local_parts in '/etc/local_banned' file.
#
blocked_targets:
driver = redirect
allow_fail
allow_defer
data = ${lookup{$local_part}lsearch{/etc/local_banned}}
user = <your exim daemon's UID>
group = <your exim aemon's GID>
file_transport = address_file
pipe_transport = address_pipe

=====

Similar for banned domains.. or more complex version to do both at once...

Optionally, you might want a verify = no

Or not. Depends on what and how you do verification (elsewhere)

Now the other part you perhaps need to change in the above in addition to which
file is used for lookup may be the transports specified.

Your chocie of writing to your own local mailstore, blackholing, diverting to an
admin, bouncing back (optionally with a curt note) to the sender....
combinations of the above...

...whatever it is you think appropriate.

.. so long as it is NOT a remote smtp_delivery. Or at least not one to the
target you want to protect from nuisances - eg a valid address for an off-box
system mailadmin on your own tream might be OK.

No 'system filter' needed.

But this router has to come 'early' in router sequence to be effective, and that
means it has to be traversed or 'looked at' for essentially all traffic.

At which point one might wonder why you - and so few others - need to do this
*at all*, as I haven't seen much in the way of similar needs discussed in the
last .. 60 thousand or so posts to this mailing list.

Short of irritating a remote to the point of blacklisting your server, perhaps
with a dumbass knee-jerk autoresponder (forbidden here) the odd accidental
response to a 'noreply' is essentially as harmless as it is ineffective....

YMMV, YOMD,

Bill Hacker