Re: [exim] Available recipient variable in DATA ACL

Top Page
Delete this message
Reply to this message
Author: Mike Cardwell
Date:  
To: exim-users
Subject: Re: [exim] Available recipient variable in DATA ACL
On 26/02/2010 18:03, James Price wrote:

>> --On 26 February 2010 11:40:24 -0600 James Price
>> <james@???> wrote:
>>
>>> I'm pretty sure I recall and in fact I'm almost positive that $domain
>>> and $local_part are unavailable in acl_smtp_data, is there any other
>>> alternative?
>>
>> You can save the values to $acl_m_last_domain and $acl_m_last_local_part
>>
>> If the message has only one recipient, then that'll do the job. Most
>> do, now that most mailing lists like to VERP. At least that's true for
>> our mail servers.
>>
>> However, if you have more than one recipient, then these values are
>> practically meaningless after you've got the data.
>>
> This is for logging purposes into a DB. In specific places I'm logging
> a row to an activity_log table in my exim DB. During the DATA phase,
> agreed, use of recipient is generally meaningless at that point other
> than logging, which is what I'm attempting.
>
> Thanks for the quick response...


During the data phase, $recipients contains a comma separated list of
all the recipients. If you wanted to do an INSERT into an SQL database
at that point for each individual recipient, you could use a stored
function and loop over each address via the comma delimiter inside that
function. Another alternative would be to copy $recipients into an acl
variable and then use a recursive acl which pops off the top address,
inserts, and then calls it's self. As long as you take into account
recursion limits.

-- 
Mike Cardwell    : UK based IT Consultant, Perl developer, Linux admin
Cardwell IT Ltd. : UK Company - http://cardwellit.com/       #06920226
Technical Blog   : Tech Blog  - https://secure.grepular.com/
Spamalyser       : Spam Tool  - http://spamalyser.com/