RE: Sendmail in a jail

2003-12-21 Thread Ian Barnes
Hi,

nope, it doesnt. Anyway that i could debug it ? If i parse the variables
through to the screen they are fine, if i run it on another server not in a
jail it works, so my code i fine, now it just doesnt want to send. Any ideas
as to what i could do?

Ian


 -Original Message-
 From: Rus Foster [mailto:[EMAIL PROTECTED]
 Sent: 20 December 2003 11:23 PM
 To: Ian Barnes
 Cc: [EMAIL PROTECTED]
 Subject: Re: Sendmail in a jail


 On Sat, 20 Dec 2003, Ian Barnes wrote:

  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.

 Hi,
 The mail() funciton in php just called sendmail on the command line so it
 should just work

 Rus
 --
 w: http://www.jvds.com  | Dedicated FreeBSD,Debian and RedHat Servers
 e: [EMAIL PROTECTED]| Donations made to Debian, FreeBSD
 t: +44 7919 373537| and Slackware
 t: 1-888-327-6330 | email: [EMAIL PROTECTED]


___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Sendmail in a jail

2003-12-21 Thread Matthew Seaman
On Sun, Dec 21, 2003 at 01:26:27PM +0200, Ian Barnes wrote:

 nope, it doesnt. Anyway that i could debug it ? If i parse the variables
 through to the screen they are fine, if i run it on another server not in a
 jail it works, so my code i fine, now it just doesnt want to send. Any ideas
 as to what i could do?

You need to run a sendmail MSP process in the jail, and modify the
configuration so that it submits the message to your main server
(presumably in your host environment, although it could live in
another jail) via it's external IP address.

Try this, in the jail:

# cd /etc/mail
# cp freebsd.submit.mc submit.mc
# vi submit.mc

here, change the last line from

FEATURE(`msp', `[127.0.0.1]')dnl

to

FEATURE(`msp', `[smtp.example.com]', `MSA')dnl

Obviously, you want to replace 'smtp.example.com' with the hostname of
your mailserver -- or it's IP address.  You need the [square brackets]
as they stop sendmail trying to look up MXes in the DNS and instead
deliver straight to the named machine.  Now rebuild the .cf and
install it:

# make
# make install

In /etc/rc.conf in the jail set the following so that only the
sendmail MSP process gets started:

sendmail_enable=NO
sendmail_msp_queue_enable=YES
sendmail_outbound_enable=NO
sendmail_submit_enable=NO

and you can start sendmail up from within /etc/mail by:

# make restart

Oh, and make sure port 587 on the mail server isn't firewalled off
from the jail environment...

The problem is that the loopback interface isn't really shared between
jail and host environment -- a daemon listening on 127.0.0.1 in the
host won't pick up connections to 127.0.0.1 in the jail, which is
exactly how the MSP tries to communicate with the MTA process.

Cheers,

Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.   26 The Paddocks
  Savill Way
PGP: http://www.infracaninophile.co.uk/pgpkey Marlow
Tel: +44 1628 476614  Bucks., SL7 1TH UK


pgp0.pgp
Description: PGP signature


Sendmail in a jail

2003-12-20 Thread Ian Barnes
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.

Thanks.

Ian

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]