Re: [Exim] Exim 4 and rewrite rules and LDAP

Páxina inicial
Borrar esta mensaxe
Responder a esta mensaxe
Autor: John Dalbec
Data:  
Para: exim-users
Asunto: Re: [Exim] Exim 4 and rewrite rules and LDAP

Philip Hazel wrote:
>
> On Mon, 19 Aug 2002, John Dalbec wrote:
>
> > The convert4r4 script didn't change it in any way.
>
> The script isn't as clever as it might be.
>
> > Exim 4 now does string expansion on the left-hand side, so I had to add
> > a layer of backslashes to it:
> >
> > *@^(mail0[1-4]\\.cc\\.|student\\.|mail\\.|)ysu\\.edu\$ "${lookup ldap\
> >         {ldap:///ou=People,dc=ysu,dc=edu?mail?sub?(mail=$0)}\
> >         {$0}{${lookup{$1}lsearch{/etc/passwd}\
> >         {$0}{$1@rewrite-me}}}}"                                 Ffrs


Now I get
$ exim -brw root@???
2002-08-20 08:15:16 Rewrite of root@??? yielded unqualified
address "root"
  sender: root@???
2002-08-20 08:15:16 Rewrite of root@??? yielded unqualified
address "root"
    from: root@???
      to: root@???
      cc: root@???
     bcc: root@???
2002-08-20 08:15:16 Rewrite of root@??? yielded unqualified
address "root"
reply-to: root@???
2002-08-20 08:15:16 Rewrite of root@??? yielded unqualified
address "root"
env-from: root@???
  env-to: root@???


The "root" account is in /etc/passwd so it should be rewriting the
address to $0 which (AFAIK) should be root@???. Is the lsearch
lookup clobbering $0 perhaps?
Thanks,
John Dalbec

>
> > Then I found that Exim 4 was dropping the right parenthesis at the end
> > of the LDAP lookup. Perhaps it sees it as part of the argument of $?
>
> Hmm. That is odd. It shouldn't do that. I will take a closer look when I
> get time, to see if there is a bug somewhere.
>
> > It looks like I still need the "" around the right-hand side since it
> > has a space in it.
>
> Yes, you do.
>
> --
> Philip Hazel            University of Cambridge Computing Service,
> ph10@???      Cambridge, England. Phone: +44 1223 334714.