From owner-freebsd-questions@FreeBSD.ORG Mon Nov 14 14:41:13 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1764416A41F for ; Mon, 14 Nov 2005 14:41:13 +0000 (GMT) (envelope-from msommer@argotsoft.com) Received: from mx1a.swcp.com (mx1a.swcp.com [216.184.2.64]) by mx1.FreeBSD.org (Postfix) with ESMTP id 96BCB43D46 for ; Mon, 14 Nov 2005 14:41:12 +0000 (GMT) (envelope-from msommer@argotsoft.com) Received: from taka.swcp.com (taka-216.swcp.com [216.184.2.3]) by mx1a.swcp.com (8.13.3/8.13.3/Debian-6) with ESMTP id jAEEfAnZ017196; Mon, 14 Nov 2005 07:41:11 -0700 Received: from argotsoft.com (argotsoft.com [198.59.115.127]) by taka.swcp.com (8.13.3/8.13.1) with ESMTP id jAEEf4Ir090604; Mon, 14 Nov 2005 07:41:06 -0700 (MST) (envelope-from msommer@argotsoft.com) Received: from athabasca (athabasca.argotsoft.com [192.168.3.104]) by argotsoft.com (8.12.3/8.12.3) with ESMTP id jAEEeq6C064503; Mon, 14 Nov 2005 07:40:56 -0700 (MST) Message-Id: <200511141440.jAEEeq6C064503@argotsoft.com> From: "Mark J. Sommer" To: "'Hans Nieser'" , Date: Mon, 14 Nov 2005 07:40:50 -0700 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook, Build 11.0.5510 In-Reply-To: <43789742.4070804@nieser.net> Thread-Index: AcXpI8Ihx4SqBW8NTMCoftuqQQjhDAABS18Q X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Scanned-By: MIMEDefang 2.9 (www dot roaringpenguin dot com slash mimedefang) X-Virus-Scanned: ClamAV 0.87/1169/Fri Nov 11 14:28:05 2005 on av1 X-Virus-Status: Clean X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on kaimen.swcp.com X-Spam-Status: No, hits=-2.4 required=10.0 tests=ALL_TRUSTED autolearn=failed version=3.0.4 X-Spam-Level: Cc: Subject: RE: How to redirect mail sent to root to external mailbox? 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, 14 Nov 2005 14:41:13 -0000 > -----Original Message----- > From: owner-freebsd-questions@freebsd.org > [mailto:owner-freebsd-questions@freebsd.org] On Behalf Of Hans Nieser > Sent: Monday, November 14, 2005 6:55 AM > To: freebsd-questions@freebsd.org > Subject: How to redirect mail sent to root to external mailbox? > > Hi list, > > I operate several servers, one of which is at home, behind > NAT. The local network is configured to use the domainname > "nieser.local.", which obviously only exists on the local > (forwarding) nameserver. > > To be able to send e-mail from this machine (which would > normally be rejected by any MTA because of the non-existent > 'from' domainname ) I have configured sendmail to masquerade > e-mail sent from the "royen.nieser.local" machine as > "royen.nieser.net" which resolves to the external IP adress > of the DSL gateway device (which has smtp forwarded to the > royen.nieser.local machine). > > The above setup *mostly* (see below) works, e-mail that I > send from the server has it's "royen.nieser.local" hostname > properly substituted with "royen.nieser.net"). > > Now, to make monitoring all the servers I operate easier, I > wanted to forward all mail sent to root (including the > periodic output), by putting > "root: h.nieser@xs4all.nl" in the /etc/mail/aliases file, as > the comments in this file suggested: > > # Pretty much everything else in this file points to "root", > so # you would do well in either reading root's mailbox or > forwarding # root's email from here. > > But here's the weird thing, the periodic mail doesn't get > masqueraded and > therefore gets rejected by the remote MTA. The "rejected" > message which > gets sent back to the root account, however, *does* get > masqueraded properly and subsequently forwarded to the e-mail > I specified in the /etc/mail/aliases file! > > Also, when I ssh to the royen machine and type "periodic > daily" on the commandline, the mail it generates DOES get > masqueraded correctly... > What's going on here? I'm having a real hard time getting my > head around this because of all the redirecting and > forwarding and perhaps lack of in-depth knowledge of > smtp/sendmail... I have my sendmail configuration attached > (also mirrored at http://nieser.net/files/sendmail/1/ ). > > I'd rather keep the nieser.local/nieser.net domainnames > seperate and use masquerading because the whole NAT setup is > confusing enough for me as it is, having the same domainname > resolve to different adresses for the LAN and the Internet > would probably drive me mad. > > Can anyone assist? > > PS: The domainnames used in my problem description above may > not actually resolve as I've tried to simplify my problem by > using more logical names. This is really a sendmail question I believe. Your problem is probably because root doesn't get masqueraded. In your sendmail.cf, is there a line like the following: CEroot or C{E}root If so, comment it out and restart sendmail.