Get log of mail sent with mail() from PHP (sendmail?)

On Debian-based systems exim logs data in /var/log/exim4/mainlog.

You might find the eximstats tool useful for parsing and culling useful information out of that log file.


sendmail -bp (and mailq) only lists the mail queue: messages queued but not yet sent. It will not include those messages which were delivered successfully.

You should check /var/log/mail.log (and other logfiles) - they almost always have records of every transfer.


php 5.3.0 added 2 settings that makes tracking down rogue scripts easy:

mail.add_x_header
mail.log

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