diff options
author | Kali Kaneko <kali@leap.se> | 2013-08-07 13:20:06 +0200 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2013-08-09 16:51:16 +0200 |
commit | 26a743c6a0415be5f7c1276811fad919700d6dbf (patch) | |
tree | a0fe6d0194a9b880ae3f5bd2f6db8d15aaee0701 /src/leap/mx/check_recipient_access.py | |
parent | 92e1115f6aa76ec656972820021f24387bac117d (diff) |
Return code even if bare username
Diffstat (limited to 'src/leap/mx/check_recipient_access.py')
-rw-r--r-- | src/leap/mx/check_recipient_access.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/leap/mx/check_recipient_access.py b/src/leap/mx/check_recipient_access.py index b75d1eb..0520c7c 100644 --- a/src/leap/mx/check_recipient_access.py +++ b/src/leap/mx/check_recipient_access.py @@ -18,6 +18,8 @@ """ Classes for resolving postfix recipient access + +Test this with postmap -v -q "foo" tcp:localhost:2244 """ from twisted.protocols import postfix @@ -25,9 +27,14 @@ from twisted.protocols import postfix from leap.mx.alias_resolver import AliasResolverFactory -class CheckRecipientAccess(postfix.PostfixTCPMapServer): - pass +class LEAPPostFixTCPMapserverAccess(postfix.PostfixTCPMapServer): + def _cbGot(self, value): + if value is None: + self.sendCode(500, postfix.quote("NOT FOUND SORRY")) + else: + # We do not send the value in this case + self.sendCode(200) class CheckRecipientAccessFactory(AliasResolverFactory): - protocol = CheckRecipientAccess + protocol = LEAPPostFixTCPMapserverAccess |