Re: [Exim] rewriting

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Alexander Koch
Datum:  
To: exim-users
Betreff: Re: [Exim] rewriting
On Mon, 25 October 1999 15:19:39 +0100, Philip Hazel wrote:
[initially I wrote ...]
> > > I have several subdomains, namely (.*).bwev.org and I want
> > > $1 be looked up in a plain file (lsearch). I have a
> > > smartuser director here that won't work.
> > >
> > >|subdomain:
> > >|  driver        = smartuser
> > >|  domains       = "*.bwev.org"
> > >|  new_address  = ${if match{ ${domain} } {(.*)\.bwev\.org} \
> > >|     { ${lookup {$1} lsearch {/etc/exim/subdomains} {$value} } }
> > >|  no_more

> > >
> > I would say add one more '}' to the end. It looks like the 'if' isn't
> > terminated correctly - hence expecting an 'else'.
>
> And think about those \ characters. The new_address option is expanded,
> so you need to write \\. instead of \. inside the regex. Also the spaces
> inside { ${domain} } will be present, though it doesn't look as though
> that will matter.


Well, Phil... sometimes some (more) examples would work
wonders in your documentation. It is clearly one of the
most excellent documentations I have ever seen, but some
examples of whatever ugly (but nice) things you can do
with lookups and stuff would help a bit more.

Now, this *does* work. And not only because I added a
hostname after the ${value} ... The spaces after the
"match {" are evil, btw, it looks for < xxx> if there
is a space.

new_address = ${if match {${domain} } {(.*)\\.bwev\\.org} { ${lookup {$1} lsearch {/etc/exim/subdomains} {$value@???} } } }

Whatever, it works, thanks to a mailer that seems to be
made to make the admin's life easier. Thanks, Phil. ;-)

Alexander,
still having a flu, but it's getting better :->

--
Alexander Koch - <>< - WWJD - aka Efraim - PGP 0xE7694969 - ARGH-RIPE