Re: [Exim] Weird (stupid?) rewrite question

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Corin Hartland-Swann
Fecha:  
A: George Schlossnagle
Cc: exim-users
Asunto: Re: [Exim] Weird (stupid?) rewrite question
Hi there,

On Tue, 3 Oct 2000, George Schlossnagle wrote:
> I have a feeling this is a stupid question, but try as I might, I can't
> figure it out. I want to rewrite mails from hosts that match
> mg*.my.domain as one thing and ones that match bp*.my.domain as another.
>
> I'm using the rules:
>
> *@mg*.my.domain            bob@???
> *@bp*.my.domain            bob@???

>
> However, when I try to dliver mail, mg103.my.domain matches nothing.


If you use the address test mode, eg:

     exim -bt someone@???


You can see the result more easily than attempting to send mail. You can
also add the debugging option (eg -d9) to see exactly what is happening.

The problem is that exim will first lookup "someone@???" and
then "*@mg103.my.domain". It only performs lookups (AFAIK), and does not
go through matching wildcards anywhere.

What you probably need is to specify each sub-domain on a seperate line:

      *@mg1.my.domain                bob@???
      *@mg2.my.domain                bob@???
       ...
      *@mg253.my.domain              bob@???
      *@mg254.my.domain              bob@???


or similar. This is probably the best way to do this, and it pretty easy
to do with a OneLinePerlScript (TM), ie:

perl -e 'foreach (1..254) { print "*\@mg$_.my.domain\t\tbob\@mg.domain\n" }'

Hope this helps,

Corin

/------------------------+-------------------------------------\
| Corin Hartland-Swann   | Direct: +44 (0) 20 7544 4676        |
| Commerce Internet Ltd  | Mobile: +44 (0) 79 5854 0027        |
| 22 Cavendish Buildings |    Tel: +44 (0) 20 7491 2000        |
| Gilbert Street         |    Fax: +44 (0) 20 7491 2010        |
| Mayfair                |    Web: http://www.commerce.uk.net/ |
| London W1K 5HJ         | E-Mail: cdhs@???        |

\------------------------+-------------------------------------/