I have a website that let users subscribe with their email IDs.
I want to create a cron job that checks the bounced emails via imap connection, and I am using PHP class for that.
The cron job's script supposed to search for emails from "Mail delivery system" and scan the body of the email to detect the invalid email ID in order to mark it in mysql database.
I don't have any problem with IMAP connection or search, but the problem is: I can't find the pattern that the script should look for to define where is the invalid email ID written in the message.
Could you please help me what shall the script look for? (e.g. some word that the email ID will come after or before? Or maybe an HTML tag in the body of the message that carries the invalid email ID)
Thanks for the help