Use re to recognize failure DSNs.
This commit is contained in:
@@ -1,6 +1,17 @@
|
|||||||
Here is a history of user visible changes to Python milter.
|
Here is a history of user visible changes to Python milter.
|
||||||
|
|
||||||
0.8.6
|
0.8.6 Delay reject of unsigned RCPT for postmaster and abuse only
|
||||||
|
Fix dsn reporting of hard permerror
|
||||||
|
Resolve FIXME for wrap_close in miltermodule.c
|
||||||
|
Add Message-ID to DSNs
|
||||||
|
Use signed Message-ID in delayed reject to blacklist senders
|
||||||
|
Auto-train via blacklist and auto-whitelist
|
||||||
|
Don't check userlist for signed MFROM
|
||||||
|
Accept but skip DSPAM training for whitelisted senders without SPF PASS
|
||||||
|
Report GC stats
|
||||||
|
Support CIDR matching for IP lists
|
||||||
|
Support pysrs sign feature
|
||||||
|
Support localpart specific SPF policy in access file
|
||||||
0.8.5 Simple trusted_forwarder implementation.
|
0.8.5 Simple trusted_forwarder implementation.
|
||||||
Fix access_file neutral policy
|
Fix access_file neutral policy
|
||||||
Move Received-SPF header to beginning of headers
|
Move Received-SPF header to beginning of headers
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
Make all dictionaries work like honeypot. Do not train as ham unless
|
||||||
|
whitelisted. Train on blacklisted messages, or spam feedback.
|
||||||
|
|
||||||
Allow unsigned DSNs from selected domains (that don't accept signed MFROM,
|
Allow unsigned DSNs from selected domains (that don't accept signed MFROM,
|
||||||
e.g. verizon.net).
|
e.g. verizon.net).
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
# A simple milter that has grown quite a bit.
|
# A simple milter that has grown quite a bit.
|
||||||
# $Log$
|
# $Log$
|
||||||
|
# Revision 1.57 2006/03/07 20:50:54 customdesigned
|
||||||
|
# Use signed Message-ID in delayed reject to blacklist senders
|
||||||
|
#
|
||||||
# Revision 1.56 2006/02/24 02:12:54 customdesigned
|
# Revision 1.56 2006/02/24 02:12:54 customdesigned
|
||||||
# Properly report hard PermError (lax mode fails also) by always setting
|
# Properly report hard PermError (lax mode fails also) by always setting
|
||||||
# perm_error attribute with PermError exception. Improve reporting of
|
# perm_error attribute with PermError exception. Improve reporting of
|
||||||
@@ -222,6 +225,14 @@ try: import spf
|
|||||||
except: spf = None
|
except: spf = None
|
||||||
|
|
||||||
ip4re = re.compile(r'^[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*$')
|
ip4re = re.compile(r'^[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*$')
|
||||||
|
subjpats = (
|
||||||
|
r'^failure notice',
|
||||||
|
r'^returned mail',
|
||||||
|
r'^undeliverable',
|
||||||
|
r'^delivery\b.*\bfailure',
|
||||||
|
r'^delivery problem',
|
||||||
|
)
|
||||||
|
refaildsn = re.compile('|'.join(subjpats),re.IGNORECASE)
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
# Thanks to Chris Liechti for config parsing suggestions
|
# Thanks to Chris Liechti for config parsing suggestions
|
||||||
@@ -1168,9 +1179,7 @@ class bmsMilter(Milter.Milter):
|
|||||||
|
|
||||||
# check for delayed bounce of CBV
|
# check for delayed bounce of CBV
|
||||||
if self.is_bounce and srs:
|
if self.is_bounce and srs:
|
||||||
for w in ("delivery failure", "failure notice",
|
if refaildsn.match(lval):
|
||||||
"returned mail", "undeliverable"):
|
|
||||||
if lval.startswith(w):
|
|
||||||
self.delayed_failure = val.strip()
|
self.delayed_failure = val.strip()
|
||||||
# if confirmed by finding our signed Message-ID,
|
# if confirmed by finding our signed Message-ID,
|
||||||
# original sender (encoded in Message-ID) is blacklisted
|
# original sender (encoded in Message-ID) is blacklisted
|
||||||
|
|||||||
Reference in New Issue
Block a user