Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Jan 2004 18:20:17 -0700
From:      "Brent Wiese" <brently@bjwcs.com>
To:        "'Ian Barnes'" <ian@cerebellum.za.net>, <freebsd-questions@freebsd.org>
Subject:   RE: Mail in a Jail
Message-ID:  <20040113012232.MPNJ27510.fed1mtao02.cox.net@SAMBA>
In-Reply-To: <DGEOIPPIAJBPINGMKMGKCEPKDJAA.ian@cerebellum.za.net>

next in thread | previous in thread | raw e-mail | index | archive | help
> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040113012232.MPNJ27510.fed1mtao02.cox.net>