fix #8131 - chinese translations
[Pman.Core] / NotifySend.php
index e9c37a0..f94ff33 100644 (file)
@@ -87,7 +87,9 @@ class Pman_Core_NotifySend extends Pman
    
     function get($id,$opts=array())
     {
-
+        //if ($this->database_is_locked()) {
+        //    die("LATER - DATABASE IS LOCKED");
+       // }
         //print_r($opts);
         if (!empty($opts['DB_DataObject-debug'])) {
             DB_DataObject::debugLevel($opts['DB_DataObject-debug']);
@@ -242,7 +244,7 @@ class Pman_Core_NotifySend extends Pman
          
         
         if (isset($email['later'])) {
-            
+             
             $this->server->updateNotifyToNextServer($w, $email['later'],true);
              
             $this->errorHandler("Delivery postponed by email creator to {$email['later']}");
@@ -367,7 +369,8 @@ class Pman_Core_NotifySend extends Pman
             $this->errorHandler("config Mail[helo] is not set");
         }
         
-        
+        $email = DB_DataObject::factory('core_notify_sender')->filterEmail($email, $w);
+            
                         
         foreach($mxs as $mx) {
             
@@ -443,6 +446,8 @@ class Pman_Core_NotifySend extends Pman
                 
             }
         
+           
+            
             
             $res = $mailer->send($p->email, $email['headers'], $email['body']);
             if (is_object($res)) {
@@ -535,7 +540,11 @@ class Pman_Core_NotifySend extends Pman
                 $errmsg=  $res->userinfo['smtpcode'] . ':' . $res->userinfo['smtptext'];
             }
             
-            if ($res->userinfo['smtpcode'] == 550) {
+            if ( $res->userinfo['smtpcode']> 500 ) {
+                
+                DB_DataObject::factory('core_notify_sender')->checkSmtpResponse($email, $w, $errmsg);
+
+                
                 if ($this->server->checkSmtpResponse($errmsg, $core_domain)) {
                     $ev = $this->addEvent('NOTIFY', $w, 'BLACKLISTED  - ' . $errmsg);
                     $this->server->updateNotifyToNextServer($w,  $retry_when,true);