Re: [exim] counting number of adresses in From

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Todd Lyons
Ημερομηνία:  
Προς: Arkadiusz Miskiewicz
Υ/ο: exim-users
Καινούρια Θέματα: Re: [exim] counting number of adresses in From
Αντικείμενο: Re: [exim] counting number of adresses in From
On Tue, Sep 6, 2011 at 1:11 AM, Arkadiusz Miskiewicz <arekm@???> wrote:
>
> exim doesn't have any builtin way to count number of elements.


Yeah, would be nice. For your particular query, there is a recipient
count, but not a sender count, which is what you want.

> Looking for something like:
> deny message = you are bad
>   condition = ${if count(${addresslist:$h_From:}) > 1}


This works for me:
  # DEBUG #
  warn    set acl_m_sender_count = ${reduce \
                           {>, ${addresses:$h_from:} } \
                           { 0 } \
                           {${eval:$value+1}} \
                          }
            logwrite       = Found $acl_m_sender_count senders in From header


...Todd
--
If Americans could eliminate sugary beverages, potatoes, white bread,
pasta, white rice and sugary snacks, we would wipe out almost all the
problems we have with weight and diabetes and other metabolic
diseases. -- Dr. Walter Willett, Harvard School of Public Health