Re: [exim] Adding a per-recipient message header

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: SeattleServer.com
Dátum:  
Címzett: exim-users
CC: Mike Cardwell
Tárgy: Re: [exim] Adding a per-recipient message header
On Saturday 14 October 2006 08:30, Mike Cardwell wrote:
> What would be nice is if you could have a hash style variable so you
> could connect a recipient with an ID. Then in the routers you could add the
> header depending on the recipient using "headers_add"
>
> You can do this, by emulating/hacking a hash:


This is exactly the thing I was looking for but wasn't occuring to me. I've
already used emulated hash variables because I thought there were only 10
connection and 10 message variables, but it appears that there are actually
20 each in current exim releases so I can eliminate my other use of them...

> In the rcpt acl:
>
> warn set acl_m4 = $acl_m4\n$local_part@$domain=YOUR_UNIQUE_ID
>
> In the router:
>
> headers_add = X-SeattleServer-ID: ${extract
> {$local_part@$domain}{$acl_m4}}
>
> Let me know if it works for you. I've never seen anyone other than my
> self use this hack in an exim configuration. There's probably some evil
> reason that makes this method "wrong". But it still works.


Close but you're missing the pass/fail value arguments for extract. Here's
what I did:

acl_check_rcpt:
    warn    set acl_m4    = ${lookup pgsql{select "statistics_record_message_recipient" 
(${quote_pgsql:${acl_m6}}, '${quote_pgsql:${local_part}@${domain}}')} 
{${value}}fail}
        set acl_m10    = ${local_part}@${domain}=${acl_m4} ${acl_m10}


[...]

maildrop:
    [...]
        headers_add             = X-SeattleServer-ID: 
${extract{${local_part}@${domain}}{${acl_m10}}{${value}}fail}



Works perfect! Thanks a million!

--
SeattleServer.com Mailing Lists - Casey Allen Shobe
lists@??? - http://seattleserver.com