diff --git a/Milter/policy.py b/Milter/policy.py index a533ba3..c1d1711 100644 --- a/Milter/policy.py +++ b/Milter/policy.py @@ -27,6 +27,10 @@ class MTAPolicy(object): if not access_file: access_file = conf.access_file self.use_nulls = conf.access_file_nulls + try: + self.use_colon = conf.access_file_colon + except: + self.use_colon = True self.sender = sender self.domain = sender.split('@')[-1].lower() self.acf = None @@ -52,7 +56,11 @@ class MTAPolicy(object): if not acf: return None if self.use_nulls: sfx = b'\x00' else: sfx = b'' - pfx = pfx.encode() + b'!' + if self.use_colon: + sep = b':' + else: + sep = b'!' + pfx = pfx.encode() + sep try: return acf[pfx + self.sender.encode() + sfx].rstrip(b'\x00').decode() except KeyError: diff --git a/README.md b/README.md index 503f287..d2a85ea 100644 --- a/README.md +++ b/README.md @@ -11,9 +11,11 @@ sending DSNs or doing CBVs. # Requirements -Python milter extension: https://pypi.python.org/pypi/pymilter/ +Python milter extension: https://pypi.org/project/pymilter/ Python: http://www.python.org Sendmail: http://www.sendmail.org + or +Postfix: http://www.postfix.org/MILTER_README.html # Quick Installation