"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/fuglu/addrcheck.py" between
fuglu-0.10.8.tar.gz and fuglu-1.0.0.tar.gz

About: FuGlu is a mail scanning daemon for Postfix written in Python. It acts as a glue application between the MTA and spam checkers and antivirus software.

addrcheck.py  (fuglu-0.10.8):addrcheck.py  (fuglu-1.0.0)
skipping to change at line 62 skipping to change at line 62
self._method = LazyLocalPart() self._method = LazyLocalPart()
elif name == "NoCheck": elif name == "NoCheck":
self._method = NoCheck() self._method = NoCheck()
elif name == "AsciiOnly": elif name == "AsciiOnly":
self._method = AsciiOnly() self._method = AsciiOnly()
else: else:
logger = logging.getLogger("%s.Addrcheck" % __package__) logger = logging.getLogger("%s.Addrcheck" % __package__)
logger.warning("Mail address check \"%s\" not valid, using default.. ."%name) logger.warning("Mail address check \"%s\" not valid, using default.. ."%name)
self._method = Default() self._method = Default()
def valid(self, address): def valid(self, address: str, allow_postmaster: bool = False):
""" """
Args: Args:
address (String): Address to be checked address (String): Address to be checked
allow_postmaster (Bool):
Returns: Returns:
(Boolean) True if address is valid using internal validation method (Boolean) True if address is valid using internal validation method
""" """
if allow_postmaster and address and address.lower() == "postmaster":
# According to RFC5321 (https://tools.ietf.org/html/rfc5321#section-
4.1.1.3)
# postmaster is allowed as recipient without domain
return True
return self._method(address) return self._method(address)
class Addrcheckint(object): class Addrcheckint(object):
""" """
Functor interface for method called by Addrcheck Functor interface for method called by Addrcheck
""" """
def __init__(self): def __init__(self):
pass pass
def __call__(self, mailAddress): def __call__(self, mailAddress):
raise NotImplemented raise NotImplemented
 End of changes. 3 change blocks. 
1 lines changed or deleted 8 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)