From owner-freebsd-questions@FreeBSD.ORG Mon Nov 20 18:55:31 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0717E16A492 for ; Mon, 20 Nov 2006 18:55:31 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6FD0143D45 for ; Mon, 20 Nov 2006 18:55:11 +0000 (GMT) (envelope-from keramida@ceid.upatras.gr) Received: from kobe.laptop (host5.bedc.ondsl.gr [62.103.39.229]) (authenticated bits=128) by igloo.linux.gr (8.13.8/8.13.8/Debian-2) with ESMTP id kAKIsjtI012102 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 20 Nov 2006 20:54:49 +0200 Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.13.8/8.13.8) with ESMTP id kAKIsXbA006810; Mon, 20 Nov 2006 20:54:33 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost) by kobe.laptop (8.13.8/8.13.8/Submit) id kAKIsWZ1006809; Mon, 20 Nov 2006 20:54:32 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Date: Mon, 20 Nov 2006 20:54:32 +0200 From: Giorgos Keramidas To: Evgeniy Belomestnov Message-ID: <20061120185432.GA6676@kobe.laptop> References: <10B85DC5-2B64-4878-8D97-91C0E3F0A027@mac.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <10B85DC5-2B64-4878-8D97-91C0E3F0A027@mac.com> X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (score=-3.426, required 5, autolearn=not spam, ALL_TRUSTED -1.80, AWL 0.77, BAYES_00 -2.60, DNS_FROM_RFC_ABUSE 0.20) X-Hellug-MailScanner-From: keramida@ceid.upatras.gr X-Spam-Status: No Cc: freebsd-questions@freebsd.org Subject: Re: Sendmail and network aliases 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: Mon, 20 Nov 2006 18:55:31 -0000 On 2006-11-12 21:16, Evgeniy Belomestnov wrote: > Hello! > > I have FreeBSD-6.1 machine with two network interfaces: one for > private network, one for internet. Network interface for > internet has some aliases. I need to configure mail relay for > some domains at this computer. Can I configure my MTA > (Sendmail) to send outgoing e-mail for different domains via > particular network interface but with different IP-addresses > (aliases). For example, to send e-mail for DOMAIN1 via > INTERFACE1.ALIAS1, for DOMAIN2 via INTERFACE1.ALIAS2, for > DOMAIN3 via INTERFACE1.ALIAS3 and so on. On 2006-11-19 12:34, Evgeniy Belomestnov wrote: > Hello! > > I have FreeBSD-6.1 machine with two network interfaces: one for > private network, one for internet. Network interface for > internet has some aliases. I need to configure mail relay for > some domains at this computer. Can I configure my MTA > (Sendmail) to send e-mail for different domains via particular > network interface but with different IP-addresses (aliases)? > For example, to send e-mail for DOMAIN1 via INTEREFACE1.ALIAS1, > for DOMAIN2 via INTERFACE1.ALIAS2, for DOMAIN3 via > INTERFACE1.ALIAS3 and so on. Hi Evgeniy, I'm not sure I understand the original question, and I have stared at the first copy of this post for quite a while (I still had it in my INBOX, when you reposted today). If I understand correctly what you want to do, you can use the `mailertable' feature of Sendmail. An example of how this feature works is described below: When my laptop is connected through our internal network at work, I want to send all outgoing email messages to my default SMTP AUTH account, but still forward all the work-related email to our internal SMTP server. This means that, depending on the recipient address of each message, I want it to go to: smtp.relay.host mail.company.com To set this up, I have in my `/etc/mail/sendmail.mc' file the lines: dnl All outgoing email is sent to `smtp.relay.host' through the dnl `relay' mailer. Exceptions, i.e. for any domains which need dnl special handling, use `esmtp' or another mailer, through dnl `mailertable'. define(`SMART_HOST', `smtp.relay.host') define(`RELAY_MAILER_ARGS', `TCP $h 587') dnl Instead of putting all the SMTP AUTH credentials in `access', dnl I like using a separate map for this. The `authinfo' feature dnl works fine for this: FEATURE(`authinfo', `hash /etc/mail/authinfo') dnl Allow mail routing exceptions through a mailer table. FEATURE(`mailertable', `hash /etc/mail/mailertable') Then, in my `/etc/mail/mailertable' file I have an entry for the domain of our company: # Custom mail routing rules. company.com smtp:mail.company.com .company.com smtp:mail.company.com You can have an arbitrary number of entries in your `mailertable' file. For more details, look at the Sendmail README file for a description of this feature: /usr/share/sendmail/cf/README or to the online documentation of Sendmail, at: "Sendmail cf/README - Using Mailertables" http://www.sendmail.org/m4/mailertables.html I hope this helps a bit, - Giorgos