From owner-freebsd-questions@FreeBSD.ORG Fri Nov 6 07:57:57 2009 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82CED106566B for ; Fri, 6 Nov 2009 07:57:57 +0000 (UTC) (envelope-from m.seaman@infracaninophile.co.uk) Received: from smtp.infracaninophile.co.uk (gate6.infracaninophile.co.uk [IPv6:2001:8b0:151:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 1BF508FC08 for ; Fri, 6 Nov 2009 07:57:56 +0000 (UTC) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost [IPv6:::1]) (authenticated bits=0) by smtp.infracaninophile.co.uk (8.14.3/8.14.3) with ESMTP id nA67vfPk029729; Fri, 6 Nov 2009 07:57:42 GMT (envelope-from m.seaman@infracaninophile.co.uk) X-DKIM: Sendmail DKIM Filter v2.8.3 smtp.infracaninophile.co.uk nA67vfPk029729 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=infracaninophile.co.uk; s=200708; t=1257494262; bh=31iFIOgIOYM1d6Q2Znew5CML9hFpTvcmjzwjm4E7Th4=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Cc:Content-Type:Date:From:In-Reply-To: Message-ID:Mime-Version:References:To; z=Message-ID:=20<4AF3D6EF.3000108@infracaninophile.co.uk>|Date:=20F ri,=2006=20Nov=202009=2007:57:35=20+0000|From:=20Matthew=20Seaman= 20|Organization:=20Infracaninophi le|User-Agent:=20Thunderbird=202.0.0.23=20(X11/20090823)|MIME-Vers ion:=201.0|To:=20Olivier=20Nicole=20| CC:=20questions@freebsd.org|Subject:=20Re:=20How=20to=20configure= 20sendmail|References:=20<200911060730.nA67Uu2O037135@banyan.cs.ai t.ac.th>|In-Reply-To:=20<200911060730.nA67Uu2O037135@banyan.cs.ait .ac.th>|X-Enigmail-Version:=200.95.6|Content-Type:=20multipart/sig ned=3B=20micalg=3Dpgp-sha256=3B=0D=0A=20protocol=3D"application/pg p-signature"=3B=0D=0A=20boundary=3D"------------enig622B0F5EA52304 4A655F34BE"; b=VH46kNXwjx7H5chtZ7BZ8c4FtSUcHrGzTQfGsG20atG5ZTqHh572JbjZiNoPio0P5 LHfBCvChc79rz/OeqjhimYXlBvI9oZR7QFQs9NclX/zmDQF0HvYvSlEmSDzeKBnfo9 dOjlTuux4LYFA6kR6PKvui4UYkqu8rGJPpOYIlw4= X-Authentication-Warning: happy-idiot-talk.infracaninophile.co.uk: Host localhost [IPv6:::1] claimed to be happy-idiot-talk.infracaninophile.co.uk Message-ID: <4AF3D6EF.3000108@infracaninophile.co.uk> Date: Fri, 06 Nov 2009 07:57:35 +0000 From: Matthew Seaman Organization: Infracaninophile User-Agent: Thunderbird 2.0.0.23 (X11/20090823) MIME-Version: 1.0 To: Olivier Nicole References: <200911060730.nA67Uu2O037135@banyan.cs.ait.ac.th> In-Reply-To: <200911060730.nA67Uu2O037135@banyan.cs.ait.ac.th> X-Enigmail-Version: 0.95.6 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig622B0F5EA523044A655F34BE" X-Virus-Scanned: clamav-milter 0.95.3 at happy-idiot-talk.infracaninophile.co.uk X-Virus-Status: Clean X-Spam-Status: No, score=-3.0 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VERIFIED,NO_RELAYS autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on happy-idiot-talk.infracaninophile.co.uk Cc: questions@freebsd.org Subject: Re: How to configure sendmail X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Nov 2009 07:57:57 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig622B0F5EA523044A655F34BE Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Olivier Nicole wrote: > Hi, >=20 > I have this stupide little configuration that I cannot manage to get > working. >=20 > 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: >=20 > - 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; >=20 > - 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. >=20 > - of course, mail addressed to a full address x@y.z should be > delivered accordingly, eventually using a mail relay. >=20 > 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. >=20 > How can I solve my problem? virtusertable will certainly help with the first case, and it might=20 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 --=20 Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard Flat 3 PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate Kent, CT11 9PW --------------enig622B0F5EA523044A655F34BE Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----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----- --------------enig622B0F5EA523044A655F34BE--