Created
November 22, 2011 15:59
-
-
Save alister/1385998 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// bootstrap the DB access and configs... | |
// ..... | |
$m = new ParseBounces(); | |
require_once 'Zend/Mail/Storage/Maildir.php'; | |
try { | |
$mail = new Zend_Mail_Storage_Maildir( | |
array('dirname' => $bounceMaildir) | |
); | |
} catch (Zend_Mail_Exception $e) { | |
die ("can't open the maildir"); | |
} | |
echo $mail->countMessages() . " messages found\n"; | |
foreach ($mail as $message) { | |
// is it spam? | |
if ($m->isspam($message)) { | |
// delete the message | |
} | |
if ($emails = $m->isBounce($message)) { | |
// set a flag for the emails return, | |
// then delete the message | |
} | |
// we don't know what it is, leave it there. | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment