[Exim] rewriting/regex question

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Marc MERLIN
Fecha:  
A: exim-users
Asunto: [Exim] rewriting/regex question
Here's what I trying to do:
I'm trying to rewrite any address with one of our domains to the canonical
domain.
So, if someone pretends to be user@??? or sends Email to
user@???, I'd like to rewrite this as user@???

It's easy to do with one rewrite rule:
*@mail.valinux.com        $1@???        hE


However, I'd like to do that for all the local domains, which I have listed
in a flat text file which I need to parse with partial-lsearch since it
contains *.domain.tld entries.

Ideally, I'd like to write something like that:
*@* ${lookup{$2}partial-lsearch{/etc/mail/vadomains}{$1@???}fail} hE

This doesn't work because $1 gets rewritten by the partial-lsearch query
and I lose the username.
Also it ain't that great because it tries to rewrite all the addresses
I'd love to write something like that:
*@partial-lsearch{/etc/mail/vadomains}    $1@???    hE 


Any suggestions?

Also, I have entries like this in my vadomains file:
pop.su.valinux.com
pop.fr.valinux.com
pop.dsl.valinux.com
pop.sd.valinux.com
pop3.su.valinux.com
pop3.fr.valinux.com
pop3.dsl.valinux.com
pop3.sd.valinux.com

I'd love to be able to write
pop.*.valinux.com
pop3.*.valinux.com

Is that possible?

Thanks,
Marc
--
Microsoft is to software what McDonalds is to gourmet cooking

Home page: http://marc.merlins.org/ (friendly to non IE browsers)
Finger marc_f@??? for PGP key and other contact information