Re: [Exim] Problem rewriting SMTP address

Góra strony
Delete this message
Reply to this message
Autor: John Horne
Data:  
Dla: exim-users
Temat: Re: [Exim] Problem rewriting SMTP address
On 14-May-2002 at 08:50:37 Philip Hazel wrote:
> On Mon, 13 May 2002, John Horne wrote:
>> Here I used:
>>    ^<?([^@]+)@unqualified\.plymouth\.ac\.uk>?$  \
>>           "${if match {$sender_host_name} {(?i).net.plymouth.ac.uk\\$}\
>>                  {$local_part@$sender_host_name} {$local_part}}" S

>>
> Another thought:
>
> If you can somehow avoid using a second regex in your replacement
> string, you could revert to your original way of doing this. What you
> are trying to test is "ends with .net.plymouth.ac.uk". How about
> something like
>
> ${if eq {${substr_-19_19:$sender_host_name}}{.net.plymouth.ac.uk}...
>
> That should leave $1 set to the value from the first regex that matched
> the SMTP command argument.
>

Oh, well done! Yes, that works fine :-) I had to make a small adjustment to
cater for error messages (the '<>' address), but it seems to be working fine
now. Must admit I never thought of using a substring rather than a regexp.


Many thanks,

John.

------------------------------------------------------------------------
John Horne, University of Plymouth, UK           Tel: +44 (0)1752 233914
E-mail: jhorne@???
PGP key available from public key servers