0

I am using this code to send emails and it is working correctly even for sending thousands of emails:

....
require_once "/.../ea-php70/root/usr/share/pear/Mail.php";
$params['sendmail_path'] = '/usr/lib/sendmail';
$mail_object =& Mail::factory('sendmail', $params);
$timeoutSet = set_time_limit(18000); // set script time out to 5 hours 
...
for ($i = 1; $i <= 2000; $i++) {
    ...
    $_mail = $mail_object->send($recipients, $headers, $sendContent); 
    ....
}
....

Where in the Linux directory tree can I find the email delivery status reports and tracking reports of emails sent using PEAR::Mail? I will need to write a script to analyze these files to track and act on bounces. So I am trying to find those files first. Do you know where they are?

Jaime Montoya
  • 6,915
  • 14
  • 67
  • 103
  • 1
    I usually find the logs somewhere in `/var/log`. The exact log and placement beyond that depends on the exact mailer. – aynber Apr 15 '20 at 17:03
  • @aynber You are right! I found what I needed here: `/var/log/exim_mainlog` and `/var/log/exim_rejectlog`. – Jaime Montoya Apr 15 '20 at 17:18

1 Answers1

0

I found the files. The mail logs are reported under /var/log/exim_mainlog for the general messages however, bouncebacks are tracked under /var/log/exim_rejectlog on the server.

Jaime Montoya
  • 6,915
  • 14
  • 67
  • 103