Re: [exim] More embedded Perl functionality

Góra strony
Delete this message
Reply to this message
Autor: Tor Slettnes
Data:  
Dla: Tore Anderson
CC: exim-users
Temat: Re: [exim] More embedded Perl functionality
[Sorry for the previous message; it was sent prematurely]

On Tue, 2004-11-02 at 08:00 +0100, Tore Anderson wrote:
> * Tore Anderson
>
> > I'd like to be able to process the whole message
> > inside the embedded Perl functions.
>
> * Peter Savitch
>
> > Exiscan + Spamassassin. SpamAssassin is a Perl solution with plug-in
> > capabilities:
>
> I'm aware of both, however Exiscan is limited by the fact that it runs
> once per message, not once per delivery. This makes user-customizable
> filtering impossible to implement in a decent manner, as one email may
> have several recipients. So it is as its FAQ says: «You can't have
> your cake and eat it too.»


One thing I missed from your message was _at what point_ you want to
invoke perl routines / have access to the entire message. Generally, if
you want to run a routine for each recipient (e.g. in a user filter),
you have already accepted the message. Your options for dealing with
spam at this point are non-optimal (send a bounce/generate collateral
spam, discard, freeze for review, filter into a separate folder..).

A better way is to perform the filtering at SMTP time (i.e. in the Exim
ACL), and reject (550) or greylist (451) suspected spam. And yes, you
are right, this is normally done once per message, instead of once per
recipient. However, you *could* do something like the following:

      * Force one recipient per message by deferring subsequent
        recipients:


        acl_rcpt_to:
        ...
        defer message = We accept only one recipient at a time - please try later
        condition     = $recipients_count


      * Pass the recipient "username" (i.e. local part) to SpamAssassin
        via Exiscan-ACL as follows:


        acl_data:
        ...
        deny message       = Message flagged as spam ($spam_score)
             spam          = ${local_part:$recipients}



-tor