fix #8131 - chinese translations
[Pman.Core] / DataObjects / Core_notify_blacklist.php
index 6aa5b8e..305f0af 100644 (file)
@@ -17,6 +17,57 @@ class Pman_Core_DataObjects_Core_notify_blacklist extends DB_DataObject
     public $added_dt;
     
     
+    function messageIsBlacklisted($err)
+    {
+        $match = array(
+            '5.7.0 DT:SPM', // 163.com
+            '5.7.1 H:DYNB', // some other black list
+            'on our block list',  // live.com
+            'spameatingmonkey.net', // spameatingmonkey.net (users)
+            'sender is listed on the block', // korian?
+            'proofpoint.com', // another spam detecotr
+            'cloud-security.net', // another spam protector..
+            'spam complain',
+            'ANTISPAM',
+            'probability of spam',
+            'block list by spam', // spamhaus
+            'blocked using Spamhaus',
+            'spamhaus.org',  // www zen rbl...
+            'detected as Spam',
+            'poor reputation',
+            'AntiSpam',
+            'ip address in rbl',
+            'blacklisted',
+            'spamauditor.org',
+            'detect spam',
+            'message as spam',
+            'DNSBL:RBL',
+            'SpamHaus SBL-XBL',
+            'blocked by sbl-xbl.spam',
+            'Sophos Anti Spam Engine',
+            'spam filters',
+            'JunkMail',
+            'block list',
+            'Cloudmark Sender Intelligence',
+            'Blocked by CSI',
+            
+            
+        );
+        foreach($match as $str) {
+            if (strpos($err, $str) !== false) {
+                return true;
+            }
+        }
+        return false;
+    }
     
+    // delete blacklists older than 1 week (and try again)
+    function prune()
+    {
+        $this->query("
+            DELETE FROM {$this->tableName()} where added_dt < NOW()  - INTERVAL 1 WEEK
+        ");
+            
+    }
     
 }
\ No newline at end of file