Re: [exim] RFC 5532 enforcement

Top Page
Delete this message
Reply to this message
Author: Todd Lyons
Date:  
To: Jeremy Harris
CC: exim-users
Subject: Re: [exim] RFC 5532 enforcement
On Wed, Oct 13, 2010 at 9:44 AM, Jeremy Harris <jgh@???> wrote:
> On 10/13/10 16:13, Todd Lyons wrote:
>> To enforce this within exim, I have a simple ACL and perl function
>> that will count whatever headers you ask it to.
> condition= ${if match {$message_headers} {\N(?ms).*^From: .*^From: \N}}
> Less flexible, I admit; you don't get an actual count.   Let's get
> into real Exim-abuse:
> set acl_m_h_name = From
> set acl_m_h_count = ${reduce {<\n $message_headers} \
>                                                  {0} \
>                                                  {${eval:$value+${if match{$item}{^$acl_m_h_name: } {1}{0}}}}}


This appears to do what I want, and yes, you pasted something similar
to the first condition line in irc to me yesterday, so thanks for both
that and the longer exim-abuse statement :-) I would not have been
able to come up with it myself since I've not had to use reduce
before, but I see now that reduce effectively means iterate through a
list, and THAT is a quite powerful command.

> Look ma!   No Perl!


Hah, that's not a selling point for me :-) But I do understand
others' desire not to use perl, I don't knock it.

--
Regards...      Todd
I seek the truth...it is only persistence in self-delusion and
ignorance that does harm.  -- Marcus Aurealius