diff options
author | Tomás Touceda <chiiph@leap.se> | 2013-08-09 11:58:06 -0300 |
---|---|---|
committer | Tomás Touceda <chiiph@leap.se> | 2013-08-09 11:58:06 -0300 |
commit | 653d69d3e0ea8059870cb2081e6a0dbeaba80728 (patch) | |
tree | 9bb8922c9ae1b02c665cbedea56c59f39ec4f22c /src/leap/mx/check_recipient_access.py | |
parent | 8137a6e7dd461335f0fedbe7314a1fcf866b5d4d (diff) | |
parent | 26a743c6a0415be5f7c1276811fad919700d6dbf (diff) |
Merge remote-tracking branch 'kali/bug/3405_return_for_bare_username' into develop
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 |