Re: [Exim] How to distinguish between one and multiple recip…

Pàgina inicial
Delete this message
Reply to this message
Autor: Oliver Egginger
Data:  
A: Andreas Metzler
CC: exim-users
Assumpte: Re: [Exim] How to distinguish between one and multiple recipients within an ACL statement?
Hello Andreas,

thanks to your suggestion the penny has dropped. I can't get the final
receiver count within the RCPT ACL. This ACL gets called for each rcpt
address. I'm supposed to know that but now I become aware of it. It's
now quite plain to me. I did the following:

1. I let the RCPT ACL statement unchanged. Once again:

accept  recipients = +no_checks_addresses
    set acl_m1 = accepted


2. I add the following statement to the DATA ACL:

accept condition = ${if  and { {eq {$acl_m1}{accepted}}    \
                               {eq {$recipients_count}{1}} \
                             }   {yes} {no}                \
                    }


This combination effected what we want. It's a breeze (now).

regards
oliver


Am Fr, 2004-02-06 um 11.26 schrieb Andreas Metzler:
> On 2004-02-06 Oliver Egginger <oliver.egginger@???> wrote:
> [...]
> > We _don't_ want to distinguish between different recipients. The
> > question was: How can I distinguish between messages with single and
> > multiple recipients within an ACL statement? Not more.
> [...]
>
> Keep a counter by using this as first statement in the rcpt ACL:
>
> warn set acl_m0 = ${if eq {$acl_m0}{}{1}{${eval:$acl_m0+1}}}
>
> (acl_m0 contains the number of rcpt commands) or simpler
>
> warn set acl_m0 = ${if eq {$acl_m0}{}{1}{more}}
>
> (acl_m0 is "1" for single recipients, "more" otherwise.)
>
> Be aware that this is inferior to what you requested, it only
> counts the number of rcpt to commands and not the number of actually
> accepted addresses:
>
> -> MAIL FROM:<>
> <- 250 OK
> -> RCPT TO:<ametzler@localhost>
> <- 250 Accepted
> -> RCPT TO:<xxxx@localhost>
> <** 550 unknown user
> -> DATA
>
> nevertheless acl_m0 is 2.
>      cu and- I do copy and paste from swaks -reas
> --
> "See, I told you they'd listen to Reason," [SPOILER] Svfurlr fnlf,
> fuhggvat qbja gur juveyvat tha.
> Neal Stephenson in "Snow Crash"

>
> --
>
> ## List details at http://www.exim.org/mailman/listinfo/exim-users Exim details at http://www.exim.org/ ##
>