Currently reading up on the IMAP protocol, as one of my customers is using a server without IMAP support compiled :)
I will be using a simple INBOX check for failed email notifications (sockets are your best friend). That will allow me to set a flag for every new user account that is still unconfirmed and used a broken email address for their registration. These accounts can than be verified manually :)
Happy socket = happy customer.
Btw, here is a nice piece of code to quickly parse the email header in PHP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
$parsed = array(); $blocks = preg_split('/\n\n/', $response['data']); $lines = array(); $matches = array(); foreach ($blocks as $i => $block) { $parsed[$i] = array(); $lines = preg_split('/\n(([\w.-]+)\: *((.*\n\s+.+)+|(.*(?:\n))|(.*))?)/', $block, -1, PREG_SPLIT_DELIM_CAPTURE); foreach ($lines as $line) { if(preg_match('/^\n?([\w.-]+)\: *((.*\n\s+.+)+|(.*(?:\n))|(.*))?$/', $line, $matches)) { $parsed[$i][$matches[1]] = preg_replace('/\n +/', ' ', trim($matches[2])); } } } |