I've figured out how to read my email directory for bounced emails. The end goal here is to cull the email addresses from bounced emails, insert them into a mySQL table so I can query against the userTbl and delete bounced emails. Following is what I've come up with so far:
Code: Select all
$directory = '/home/myaccount/mail/mysite.com/admin/new';
// create an array to hold directory list
$results = array();
// create a handler for the directory
$handler = opendir($directory);
// open directory and walk through the filenames
while ($file = readdir($handler)) {
// if file isn't this directory or its parent, add it to the results
if ($file != "." && $file != "..") {
$results[] = $file;
var_dump($results);
}
}
// tidy up: close the handler
closedir($handler);Any suggestions are welcome.
Thanks in advance - Pavilion