[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Mail in php by postfix in chroot env



Łukasz Tkacz wrote:
> I use php-fpm + nginx + mariadb on Debian wheezy x64  I decided to chroot
> php using build-in chroot feature. After changes in nginx vhost conf and
> php db conf (from localhost to IP for mysql) php and mysql works fine (I
> can connect to database, use phpmyadmin etc.), but I can't send emails.

What are you using to send email?  How are you configured to send
mail?  Are you using SMTP?  Or are you using /usr/sbin/sendmail?  If
the latter then your messages are queuing up in the chroot.  Configure
SMTP to 127.0.0.1 instead so that your Postfix daemon can handle it
appropriately.

By default I see that php uses SMTP to 127.0.0.1 so this should be
working by default.  What is in your php.ini file?

  [mail function]
  SMTP = localhost
  smtp_port = 25
  ;sendmail_path =

For the configuration options see:

  http://us2.php.net/manual/en/mail.configuration.php

> I use postifx and after read some articles I know that is because chroot.
> Tried to copy libs/postfix to chroot dir, but without results. Any ideas?

Don't try to start postfix again in the chroot.  You could.  But it
isn't optimal.  I recommend against it.  One Postfix install per
machine is good.

If you are using /usr/sbin/sendmail and want to continue such as in a
general purpose then what I do is to install nullmailer in the chroot.
The only trick is that you also need to install an init script to
start it in the chroot at host system boot time.

Bob

Attachment: signature.asc
Description: Digital signature


Reply to: