2

If I leave my default sendmail options set in php.ini it works fine and sends an email. However if I change the sendmail path to:

sendmail_path = "sendmail -t -i -x /var/log/mail.log"

mail() returns false.

If I run:

ls -l /var/mail/mail.log

I get:

-rwxrw-rw- 1 www-data www-data 0 Sep 17 14:49 /var/mail/mail.log

Which I believe is correct. All I want sendmail to do is log my emails but for some reason it really really doesn't want to play ball!

Just for clarity - this isn't the mail.log parameter which logs the PHP interactions with the script. The output when this is set is something like this:

[17-Sep-2016 15:38:20 Europe/London] mail() on [/home/server/www/dev1/htdocs/mail.php:15]: To: TO -- Headers: MIME-Version: 1.0  From: ME

2 Answers 2

2

The problem in this instance was that I was using -x and not -X. Once I did the capital it worked fine!

1
  • Apparently this should be the accepted answer.
    – pa4080
    Jan 21, 2019 at 8:15
0

If you use PHP version 5.3.0 or newer then correct answer will be to use mail.log directive in configuration like said in manual.

2
  • I believe this is the PHP log not the mail log itself.
    – Antony
    Sep 17, 2016 at 14:10
  • And I believe your sendmail -t -i command just deliver mail to local mailer daemon which already log all that related to mail delivery. Try to look in /var/log/mail.log or something - maybe you already have all logs you need. Sep 17, 2016 at 14:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .