Re: [Exim] Problem rewriting SMTP address

Pàgina inicial
Delete this message
Reply to this message
Autor: John Horne
Data:  
A: exim-users
Assumpte: Re: [Exim] Problem rewriting SMTP address
On 13-May-2002 at 13:38:02 Philip Hazel wrote:
> On Fri, 10 May 2002, John Horne wrote:
>
>> In my Exim 3.36 configure file I have the following rewriting rule:
>>
>> ^<?([^@]+)>?$   "${if match {$sender_host_name} \
>>                             {(?i).net.plymouth.ac.uk\\$} \
>>                 {$sender_address@$sender_host_name} fail}"     S

>
> I think you'll have to do this with two rewriting rules.
>
> Rule 1: Use a regex to recognize unqualified addresses; rewrite to
> "localpart@???".
>

Okay, so I tried:
   ^<?([^@]+)>?$    $1@???  S


> Rule 2: Match on *@no.domain.supplied and use the regex you already
> have, making use of $local_part. If your regex fails, rewrite back to
> the unqualified address so that Exim will fail it.
>

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



However, this does not work. Using 'exim -bh 141.163.0.2' I get:

  220 mary.csd.plymouth.ac.uk ESMTP Exim 3.36 #1 Mon, 13 May 2002 16:56:07
   +0100
  mail from: john
  LOG: Rewrite of john@??? yielded unparseable
       address: no local part in address @plynms02.net.plymouth.ac.uk


It looks like '$local_part' is not set. So I'm back at square one?



Regards,

John.

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