Re: [exim] Preserving $local_part_suffix Dynamically in Addr…

Top Page
Delete this message
Reply to this message
Author: Magnus Holmgren
Date:  
To: exim-users
Subject: Re: [exim] Preserving $local_part_suffix Dynamically in Address Lists?
On Wednesday 21 March 2007 23:54, richs wrote:
> Let's say "user+suffix@???" resolves to an address list (via
> forward, alias, virtual domain, etc). This list could contain other
> locally-hosted addresses, as well as remote addresses, such as:
>
> user:johndoe@???,janedoe@???,someone@???
>
> Since we know local addresses can support Plus Addressing, we'd like to
> preserve the +suffix (while not preserving it for remote domains).


The new string expansion items that will be added in 4.67 (see
http://www.exim.org/bugzilla/458) are what you need. You'll get:

address_data = \
   ${lookup{$local_part}lsearch*{/var/mail/exim/virtualdomains/$domain}}
data = ${reduce \
          {${map {${addresses:$address_data}}\
                 {${quote_local_part:${local_part:$item}\
                                     ${if match_domain {$item}{+local_domains}\
                                                       {$local_part_suffix}}}\
                  @${domain:$item}}}} \
          {} {$value, $item}}


You get a leading comma (i.e. an empty item) but that's harmless. Perhaps I
should implement a "join" item too.

However, a better solution would probably be some transform_address option
that would be expanded once for each address *after* internal interpretation
and qualification of unqualified addresses in accordance with the relevant
options, and/or some magic auto_keep_affixes that would cause
$local_part_suffix and $local_part_prefix to be kept on addresses routed to
routers that accept them. Hmmm...

-- 
Magnus Holmgren        holmgren@???
                       (No Cc of list mail needed, thanks)


"Exim is better at being younger, whereas sendmail is better for
Scrabble (50 point bonus for clearing your rack)" -- Dave Evans