Re: [exim] Filtering for some real users AND some spamtrap u…

Pàgina inicial
Delete this message
Reply to this message
Autor: Lena
Data:  
A: exim-users
Assumpte: Re: [exim] Filtering for some real users AND some spamtrap users
> From: Marcin Krol

> I have spamtrap addresses in /etc/exim4/spamtraps. Generally, I want to
> collect such mail: I'm feeding a statistical filter with this. I have an
> ACL like this:
>
> accept recipients = lsearch;/etc/exim4/spamtraps
>
> Almost all of the time it works; however, there are situations when
> spammers send mail to a spamtrap user with CC to a real user or vice
> versa (unknowingly, of course). This gets accepted and sent to user.
>
> This is troublesome mail: I don't want to send it to real user's mailbox
> and I do not want to feed the statistical filter with it either.


> Even the simple option of rejecting such mail would have some problems:
>
> deny recipients = lsearch;/etc/exim4/spamtraps
>       recipients = lsearch;/etc/exim4/realusers

>
> I don't really want to maintain file "realusers"


In rcpt ACL:

require verify = recipient

  warn recipients = lsearch;/etc/exim4/spamtraps
       set acl_m_ntraps = ${eval10:0$acl_m_ntraps+1}


Predata ACL (don't forget to specify its name in acl_smtp_predata):

deny condition = ${if ={${eval10:$recipients_count-0$acl_m_ntraps}}{0}}

accept

> I'm having trouble
> with writing an extraction rule in Exim that would trigger (return true)
> when a recipient's local part is in /etc/passwd but NOT in
> /etc/exim4/spamtraps.


You can do that in rcpt ACL with ! (negation sign for ACLs)
before the word "recipients", but a run of rcpt ACL doesn't know
about other its runs (other recipients of the same message).