Re: [exim] ${domain:$recipients}}

Top Page
Delete this message
Reply to this message
Author: Mike Cardwell
Date:  
To: exim-users
Subject: Re: [exim] ${domain:$recipients}}
* on the Tue, Jan 14, 2014 at 12:05:40PM +0000, Jeremy Harris wrote:

>>>> exim -be '${domain:${extract{-1}{,}{$recipients}}}'
>>>
>>> Fails when the last recipient includes a comma in their name...
>>> OK, not common. But not bulletproof either.
>>
>> $recipients is based on the RCPT envelopes and doesn't contain any
>> names. Looks bulletproof to me.
>
> RFC821 permits "any one of the 128 ASCII characters (no exceptions)"
> so long as prefixed by a backslash, in a local-part.


Yes. And "${extract{-1}{,}{$recipients}}" returns everything after the
final comma, so it doesn't matter if the local part contains one.

========================================================================
mike@flan:~$ sudo exim4 -be '${extract{-1}{,}{"mike,cardwell"@???}}'
cardwell"@grepular.com
mike@flan:~$
========================================================================

Having said that, the quotation mark seems to cause issues:

========================================================================
mike@flan:~$ sudo exim4 -be '${domain:cardwell"@grepular.com}'

mike@flan:~$ sudo exim4 -be '${domain:cardwell@???}'
grepular.com
mike@flan:~$
========================================================================

So perhaps, using ${sg} would be better:

========================================================================
mike@flan:~$ sudo exim4 -be '${sg{foobar@???,"mike,cardwell"@???}{.+@}{}}'
grepular.com
mike@flan:~$
========================================================================

-- 
Mike Cardwell  https://grepular.com/     http://cardwellit.com/
OpenPGP Key    35BC AF1D 3AA2 1F84 3DC3  B0CF 70A5 F512 0018 461F
XMPP OTR Key   8924 B06A 7917 AAF3 DBB1  BF1B 295C 3C78 3EF1 46B4