Question : Bulk Extract of email addresses from bounced Newsletter messages

Hello,

I have a client who has a newsletter that he sends out using a PHP script using sendmail and nobody as the user..  When the newsletters bounce because of a non-existent or failed address, it comes back to my default server address, [email protected]om.  I would like to be able to sort though these bounced emails, and extract the addresses into a list so that I might be able to remove them from his mailing list.  There are hundreds of bounces, so I'd like to automate this process.

I am using exim/courier, on a WHM/cPanel Linux CentOS 5 server.   Is there a way to easily parse these emails to do this?

Answer : Bulk Extract of email addresses from bounced Newsletter messages

It's probably easier to just look in the maillog for 5.x.x return codes:

cat /var/log/maillog |grep dsn=5

That should give you each line with a permanent failure (bad addresses/rejections). You might want to suggest to your client to get his act together and modify his script to send the email with a valid return-path header, so he can see the bounces and take care of them.

The default php mail() function doesn't really work for this. He'll have to use something like the PEAR mail package set in SMTP mode: http://pear.php.net/package/mail/
Random Solutions  
 
programming4us programming4us