Exemplo n.º 1
0
 public function getFromEmail(Mzax_Bounce_Message $message)
 {
     $email = $this->findEmail($message->getFrom());
     // ingore certain non-user emails
     $skip = array('abuse', 'scomp', 'feedbackloop');
     foreach ($skip as $check) {
         if (strpos($email, $check) !== false) {
             return false;
         }
     }
     return $email;
 }
Exemplo n.º 2
0
 public function isFailure(Mzax_Bounce_Message $message)
 {
     $from = $this->findEmail($message->getFrom());
     /* FROM CHECK */
     if (preg_match("/^(postmaster|mailer-daemon)\\@?/i", $from)) {
         $message->info('bounce_justification', 'From: ' . $from);
         return true;
     }
     $subject = $message->getSubject();
     self::normalizeSubject($subject);
     if ($subject) {
         foreach (self::$subjects as $needle) {
             if (stripos($subject, $needle) !== false) {
                 $message->info('bounce_justification', 'Subject: ' . $subject);
                 return true;
             }
         }
     }
     return false;
 }
Exemplo n.º 3
0
 /**
  * Try to find an email that has been recently sent
  * to the sender address within the past 60 minutes
  * 
  * This might not be fail proof, but lets see how we go
  * 
  * @param Mzax_Bounce_Message $message
  * @return Mzax_Emarketing_Model_Outbox_Email|NULL
  */
 public function detectRecientlySentEmail(Mzax_Bounce_Message $message)
 {
     $date = $message->getDate();
     $email = $message->getFrom();
     $emailId = Mage::getResourceSingleton('mzax_emarketing/outbox_email')->findRecentlySent($email, $date, 60);
     if ($emailId) {
         return Mage::getModel('mzax_emarketing/outbox_email')->load($emailId);
     }
     return null;
 }