Re: [Exim] rewriting/regex question

Top Page
Delete this message
Reply to this message
Author: Vadim Vygonets
Date:  
To: exim-users
Subject: Re: [Exim] rewriting/regex question
VA Linux! Do you sell your sweeeet rackmounted PCs outside US?

Quoth Marc MERLIN on Tue, Aug 08, 2000:
> Here's what I trying to do:
> I'm trying to rewrite any address with one of our domains to the canonical
> domain.


[snip]

> I'd love to write something like that:
> *@partial-lsearch{/etc/mail/vadomains}    $1@???    hE 


Try this:

*@partial-lsearch;/etc/mail/vadomains        $1@???    Eh


> I'd love to be able to write
> pop.*.valinux.com
> pop3.*.valinux.com
>
> Is that possible?


Not as such, I'm afraid. You can do it with a regexp, though
(beware: untested):

^([^@]+)@pop3?\.[^.@]+\.valinux\.com$    $1@???    Eh


Or even:

^([^@]+)@pop3?\.[^@]+\.(valinux\.com)$        $1@$2    Eh


Philip will post optimizations to the regexps ;) Well, something
like:

^((?>[^@]+))@pop3?\.(?>[^@]+)(?<=\.valinux\.com)    $1@???    Eh


All the examples above assume you don't have @ sign in any of
your local parts.

And yet another hint: don't rewrite root addresses, for you will
not know what machine the error messages come from (unless you
look into Received: headers).

Vadik.

-- 
If there was anything that depressed him more than his own
cynicism, it was that quite often it still wasn't as cynical as
real life.
    -- Terry Pratchett, "Guards! Guards!"