Re: [exim] SMTP connection message count

Top Page
Delete this message
Reply to this message
Author: Tor Slettnes
Date:  
To: j.linn
CC: exim-users
Subject: Re: [exim] SMTP connection message count
On Wed, 2004-11-03 at 13:22 +0000, j.linn wrote:
> When a series of messages are sent using the same SMTP connection, is
> there a variable which gives the message number in the series and is this
> available for use in ACLs. I want to know which is the first and which are
> the later ones, in particular.


In your acl_smtp_connect ACL:

    warn set acl_c0 = 0


In our acl_smtp_mail ACL

    warn set acl_c0 = ${eval:$acl_c0 + 1}



> We have a specialist bulk mailer which sends all the message to people
> individually but via the same SMTP connection. For performance reasons we
> have increased the smtp_accept_max_per_connection. However the issue is
> that once we have virus scanned the first, I would like to send the others
> through without scanning [same message].



Maybe you don't want the _count_ but rather a "cookie" that is set for a
particular message (based on, e.g. '$message_data') once it has been
scanned. So, in your acl_smtp_connect ACL:

    warn set acl_c0 = dummy


In your DATA acl:

        deny message   = There is a virus here.
             acl_m0    = ${hash_16:$message_data}
             condition = ${if eq{$acl_m0}{$acl_c0}}
             malware   = *


        warn set acl_c0 = $acl_m0




-tor