[Exim] Problem rewriting SMTP address

Pàgina inicial
Delete this message
Reply to this message
Autor: John Horne
Data:  
A: Exim Users List
Assumpte: [Exim] Problem rewriting SMTP address
Hello,

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


We do not accept unqualified addresses as such, but need to allow it for
hosts in the 'net.plymouth.ac.uk' sub-domain (I'm testing something else out
and I think this 'unqualified address' thing is the problem, so the solution
is to allow unqualified addresses just from that sub-domain). I can't really
use the 'sender_unqualified_host' option since local addresses will be
qualified by the University's main domain name (plymouth.ac.uk) and for the
'net.plymouth.ac.uk' domain the address will fail verification since the
local part will be unknown. Follow that?

The problem is that the above rule is almost working, but I just cannot get
the '$sender_address' bit to work - it seems that at SMTP time, this
variable is not set, since I get the error message (when using 'exim -bh'):

  220 mary.csd.plymouth.ac.uk ESMTP Exim 3.36 #1 Fri, 10 May 2002 16:31:32
         +0100
  mail from: john
  LOG: Rewrite of john yielded unparseable address: no local part in address
  @plynms02.net.plymouth.ac.uk
  501 john: sender address must contain a domain
  LOG: unqualified sender rejected: <john> H=plynms02.net.plymouth.ac.uk
  [141.163.0.2]


As it shows there is no local part in the rewritten address. If I try using
'$1' I get the same thing. I have tested the '$sender_host_name' and that is
set at this time (as can be seen from above), but how can I get the
'address' in the SMTP FROM command?

I have tried this under Exim 4.04 with the same result. And since it is
Friday afternoon I may well be missing something obvious! :-)



Thanks,

John.

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