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

emaileximlinuxPHPsendmail

After some server changes our PHP configuration got nuked, which caused a client's large mailing list to time out partially through about 4,000 addresses or more. We want to avoid sending a duplicate mail as much as possible, and we have the original mailing list.

The mail was sent using PHP's mail() function, which uses sendmail, which says it's using Exim. I've seen the command:

sendmail -bp

Which gives me a list of mail that appears was sent. This list isn't very big, and could be accurate (meaning the script timed out after sending only a hundred or so e-mails)

Is sendmail -bp the best way to get this listing?

EDIT: I can't find any mail.log file in /var/log/mail.log or via locate mail.log, but WHM seems to have some information on this.

Best Answer

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.