Re: [exim] counting number of adresses in From

Top Page

Reply to this message
Author: Todd Lyons
To: Arkadiusz Miskiewicz
CC: exim-users
New-Topics: Re: [exim] counting number of adresses in From
Subject: 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

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