Re: [Exim] Exim 4.1: rewriting question (changing "From:" he…

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Ralf G. R. Bergs
Dátum:  
Címzett: exim-users@exim.org
CC: Philip Hazel
Tárgy: Re: [Exim] Exim 4.1: rewriting question (changing "From:" header depending on recipient)
On Thu, 15 Aug 2002 09:05:37 +0100 (BST), Philip Hazel wrote:

[...]
>> rabe@???     \
>>   "${if and {
>>           {def:h_To:}
>>           {match
>>              {$h_To:}
>>              {\\N^(\"someone@???\" )?<?someone@???>?

$\\N}
>>           }
>>         } {rabe-lkt} fail
>>      }" fFrQ

[...]
>1. You don't really need the def:h_To: condition, because if there is no
>To: header, $h_To: expands to an empty string.


Good hint! That will make the expression somewhat simpler.

>2. Your regex will also match
>
>      "someone@???" someone@???
>      <someone@???
>      someone@???>

>
>but as those are illegal (and should never happen), it doesn't really matter.


Yup, I'm aware of THIS deficiency (and the (non-) implications.) :-)

>3. Perhaps more imporantly, your regex will also match
>
>      someone@somewhere+org

>
>etc. For tidiness, it is best to escape the dots.


Right, that's a real bug. Thanks for pointing this out!

>4. Do you care about multiple spaces between the two parts?


Normally not, because my mailer employs exactly a single space, but for
"stableness" I will correct this to read " +"

>5. A slightly more efficient regex would use (?:...) instead of (...) to
>save some work, but it will only be very slightly more efficient.


I was not aware of this construct, I will read the docs and probably change my
stuff accordingly.

Thanks for your great support!

Cheers,

Ralf


--
Sign the EU petition against SPAM:          L I N U X       .~.
http://www.politik-digital.de/spam/        The  Choice      /V\
                                            of a  GNU      /( )\
                                           Generation      ^^-^^