Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 06 Nov 2009 07:57:35 +0000
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        Olivier Nicole <Olivier.Nicole@cs.ait.ac.th>
Cc:        questions@freebsd.org
Subject:   Re: How to configure sendmail
Message-ID:  <4AF3D6EF.3000108@infracaninophile.co.uk>
In-Reply-To: <200911060730.nA67Uu2O037135@banyan.cs.ait.ac.th>
References:  <200911060730.nA67Uu2O037135@banyan.cs.ait.ac.th>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
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 user1@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 user2@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 'user1@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 #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.13 (FreeBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEAREIAAYFAkrz1vUACgkQ8Mjk52CukIwVNgCfT/udHMwhhchuTDC76Vmi54Mr
5tIAn3sNOiBjDdP717edN4RO2PugcXq2
=XvHU
-----END PGP SIGNATURE-----

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4AF3D6EF.3000108>