Re: [exim] Keep local_part_suffix in redirect router

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Frank Richter
Ημερομηνία:  
Προς: exim-users
Αντικείμενο: Re: [exim] Keep local_part_suffix in redirect router
Am 08.11.22 um 18:00 schrieb Slavko via Exim-users:
>
>> we'd like to allow subaddresses like user+sub@domain to deliver to users’s folder sub (if existent) via lmtp. Target system is cyrus-imapd.
>> We have these routers:
>>
>> global_aliases:
>> driver = redirect
>> allow_defer
>> allow_fail
>> data = ${lookup{$local_part@$domain}dbm{DBM/aliases}}
>> local_part_suffix = "+*"
>> local_part_suffix_optional
>> retry_use_local_part
>> no_rewrite
>>
> The suffix is in the $local_part_suffix variable and contains
> separator already (eg. +tag). I use this:
>
>      dovecot_ualias:
>        ...
>        domains = +our_domains

>
>        local_part_suffix = +*
>        local_part_suffix_optional
>        qualify_preserve_domain
>        data = ${lookup{$local_part} lsearch{VMAIL_DOM_DIR/$domain_data/aliases} \
>               {${quote_local_part:$value$local_part_suffix}} }

>
> I have per domain alias file with data without RHS part, thus lookup
> returns only local_part, to which is suffix appended.
>
> If your lookup returns qualified addresses, try something as this with
> lookup's result (not tested):
>
>      ${sg{$value}{\N(@[^@]+)$\N}{$local_part_suffix\$1}}


Thanks to all of you. As I've a RHS in the lookup, using

global_aliases:
driver = redirect
allow_defer
allow_fail
data = ${lookup{$local_part@$domain}dbm{DBM/aliases}{${sg{$value}{\N(@[^@]+)$\N}{$local_part_suffix@\$1}}} }
local_part_suffix = "+*"
local_part_suffix_optional
retry_use_local_part
no_rewrite

and
exim -v -d-all+route+transport -bvfri+test@???

--------> global_aliases router <--------
local_part=fri+test domain=hrz.tu-chemnitz.de
stripped suffix +test
calling global_aliases router
rda_interpret (string): '${lookup{$local_part@$domain}dbm{/path/aliases}{${sg{$value}{\N(@[^@]+)$\N}{$local_part_suffix@\$1}}} }'
LOG: MAIN PANIC
Tainted string '+test@$1' in expansion
global_aliases router: defer forfri+test@???
message: failed to expand "${lookup{$local_part@$domain}dbm{/path/aliases}{${sg{$value}{\N(@[^@]+)$\N}{$local_part_suffix@\$1}}} }": Tainted string '+test@$1' in expansion
fri+test@??? cannot be resolved at this time: failed to expand "${lookup{$local_part@$domain}dbm{/path/aliases}{${sg{$value}{\N(@[^@]+)$\N}{$local_part_suffix@\$1}}} }": Tainted string '+test@$1' in expansion

Hm, local_part_suffix is tainted because of the * in local_part_suffix = "+*"

Jeremy: Don't have your global-aliases strip them?

Yeah, but how?

Thanks,
Frank

--
Frank Richter, Chemnitz University of Technology, Germany