summaryrefslogtreecommitdiff
path: root/src/leap/mx/check_recipient_access.py
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2013-08-21 20:35:18 +0200
committerKali Kaneko <kali@leap.se>2013-08-21 20:35:18 +0200
commit42741614d8a68033c0cc28273a3279fc09e22f85 (patch)
tree3f4fcddb2767de468866b5299f38dc5bfbd62da7 /src/leap/mx/check_recipient_access.py
parent92e1115f6aa76ec656972820021f24387bac117d (diff)
parent53bc81a863351cdf7bfb7a252bffdd8870e71742 (diff)
Merge remote-tracking branch 'chiiph/bug/migrate_couch' into develop
Diffstat (limited to 'src/leap/mx/check_recipient_access.py')
-rw-r--r--src/leap/mx/check_recipient_access.py13
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