Autor: Mike Cardwell Data: A: exim-users Assumpte: Re: [exim] Exim 5: suggestion for string expansions
* on the Thu, Feb 22, 2007 at 02:21:12PM -0800, Mark Moseley wrote:
> Just throwing this suggestion in since you mentioned variables. It'd be nice
> (and shoot me if it's already possible) to be able to set acl-style
> variables on a per-recipient basis, as opposed to per-connection or
> per-message only. I run into situations where I'm doing some processing in
> the rcpt acl (think db lookups) that I'd like to be able to reference in a
> router when routing that same address. The lookup cache might help out in
> some situations but with more than 1-2 recipients, I'd assume that that
> lookup would get flushed out of the lookup cache.. Presumably with 100+
> recipients in a single email, that might introduce some memory bloat. But
> unless you're storing a ton of stuff in theoretical $acl_r# vars, even that
> should be fairly modest, byte-wise.
I've brought this up before, but was pretty much slapped down about it.
My hack for this is to create a perl style hash inside an acl variable
with $local_part@$domain as the key. Eg in your rcpt acl:
set acl_m0 = $acl_m0\n$local_part@$domain=${quote:Some data}
Then in your router you can extract "Some data" on a per rcpt basis
with:
${extract{$local_part@$domain}{$acl_m0}}
You've got to be careful you escape things properly though.