How to configure sendmail

Matthew Seaman m.seaman at
Fri Nov 6 07:57:57 UTC 2009

Olivier Nicole wrote:
> Hi,
> I have this stupide little configuration that I cannot manage to get
> working.
> I have one machine that I want to be able to deliver
> system mail (like cron and so on) with the following rules:
> - user1 on has the same username as on; I
>   want that mail sent to user1 is delivered to user1 at;
> - user2 on has no corresponding user on, 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 at y.z should be
>   delivered accordingly, eventually using a mail relay.
> I tried using masquerade in, user1 is then rewritten as
>, but the alias for user2 is not parsed and user2 is
> also rewritten as user2 at
> 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 at' as the destination address when read in
a mail client.  To change that, you could also use genericstable.



Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
                                                  Flat 3
PGP:     Ramsgate
                                                  Kent, CT11 9PW

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 259 bytes
Desc: OpenPGP digital signature
Url :

More information about the freebsd-questions mailing list