Olivier Nicole wrote:
Hi,

I have this stupide little configuration that I cannot manage to get
working.

I have one machine a.domain.net that I want to be able to deliver
system mail (like cron and so on) with the following rules:

- user1 on a.domain.net has the same username as on domain.net; I
  want that mail sent to user1 is delivered to us...@domain.net;

- user2 on a.domain.net has no corresponding user on domain.net, but
  it has an alias defined; I want to mail sent to user2 is delivered
  to the alias.

- of course, mail addressed to a full address x...@y.z should be
  delivered accordingly, eventually using a mail relay.

I tried using masquerade in submit.mc, user1 is then rewritten as
user1.domain.net, but the alias for user2 is not parsed and user2 is
also rewritten as us...@domain.net.

How can I solve my problem?

virtusertable will certainly help with the first case, and it might help with the second case. It depends if the alias in the 2nd expands
to multiple recipients (which virtusertable can't do).  virtusertable is
a lot like alias expansion, but with the following important differences:

  * The address match is against both the username and the host part of
    an e-mail address.  aliases only match against the username part.

  * The username part can be wild-carded, and the matched wild text can
    be used to modify the destination address.

  * virtusertable only provides a 1-to-1 mapping -- aliases provide a
    1-to-many mapping.

virtusertable just changes the envelope addresses: it doesn't change any
of the addresses in the mail header so the mail in the first case will
still show 'us...@a.domain.net' as the destination address when read in
a mail client.  To change that, you could also use genericstable.

        Cheers,

        Matthew

--
Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
                                                 Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey     Ramsgate
                                                 Kent, CT11 9PW

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to