From owner-freebsd-questions@FreeBSD.ORG Mon Jan 12 17:22:34 2004 Return-Path: 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 CB77E16A4CE for ; Mon, 12 Jan 2004 17:22:34 -0800 (PST) Received: from fed1mtao02.cox.net (fed1mtao02.cox.net [68.6.19.243]) by mx1.FreeBSD.org (Postfix) with ESMTP id B8DA643D31 for ; Mon, 12 Jan 2004 17:22:33 -0800 (PST) (envelope-from brently@bjwcs.com) Received: from SAMBA ([68.98.26.35]) by fed1mtao02.cox.net (InterMail vM.5.01.06.05 201-253-122-130-105-20030824) with ESMTP id <20040113012232.MPNJ27510.fed1mtao02.cox.net@SAMBA>; Mon, 12 Jan 2004 20:22:32 -0500 From: "Brent Wiese" To: "'Ian Barnes'" , Date: Mon, 12 Jan 2004 18:20:17 -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 Thread-Index: AcPHPKLP/H6XPaJlTrSUVTZIIjor+wSNbBAQ X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 In-Reply-To: Message-Id: <20040113012232.MPNJ27510.fed1mtao02.cox.net@SAMBA> Subject: RE: Mail in a Jail X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2004 01:22:34 -0000 > Hi, > > I run my web sites from a jail. The time has come that i now > need to send an > email from one of those sites using the mail() function in php. > > I would like to know, what files do i need to be able to send > mail from the > jail using the mail command. The box is using sendmail as its > mta, and is > running 4.9 release. This plagued me too. I found a very easy solution: esmtp in the ports. A few catches: 1: You need an external SMTP server that will relay the mail for you. I was unable to get it to talk to the main host's SMTP, probably a "feature" of jailing... Luckily, I have another box on the LAN who's sole purpose is to relay mail for machines on the LAN. 2: After you install esmtp, change your sendmail links (/usr/sbin/sendmail at least I think) to point at it. 3: If you compiled PHP w/ a non-existent sendmail, you have to recompile. It's a little confusing, but if you dig far enough in the docs, mail() will not compile if sendmail doesn't exist (it tests). Enjoy! Brent