summaryrefslogtreecommitdiff
path: root/src/leap/mx/alias_resolver.py
diff options
context:
space:
mode:
authordrebs <drebs@leap.se>2015-03-26 15:25:50 -0300
committerdrebs <drebs@leap.se>2015-04-09 18:19:53 -0300
commit45adb4d6cfdb8b9ed11e3efc398d00ec6dbdc0b0 (patch)
treefb07b5c686aa872608279679de57cd79fd2e0c4c /src/leap/mx/alias_resolver.py
parente8fd9feb5891b6cd0840afdcae996314ea3849a9 (diff)
[bug] limit pgp key lookup to access check server
In order to minimize the number of couchdb queries and the number of mx lookups in case of junk mail this commit restricts the pgp key lookup to the access check server (and removes it from the alias server). Closes: #6795.
Diffstat (limited to 'src/leap/mx/alias_resolver.py')
-rw-r--r--src/leap/mx/alias_resolver.py14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/leap/mx/alias_resolver.py b/src/leap/mx/alias_resolver.py
index 9206ffb..a139dd0 100644
--- a/src/leap/mx/alias_resolver.py
+++ b/src/leap/mx/alias_resolver.py
@@ -30,9 +30,8 @@ TODO:
from twisted.protocols import postfix
-from leap.mx.tcp_map import LEAPostfixTCPMapServerFactory
+from leap.mx.tcp_map import LEAPPostfixTCPMapServerFactory
from leap.mx.tcp_map import TCP_MAP_CODE_SUCCESS
-from leap.mx.tcp_map import TCP_MAP_CODE_TEMPORARY_FAILURE
from leap.mx.tcp_map import TCP_MAP_CODE_PERMANENT_FAILURE
@@ -41,30 +40,25 @@ class LEAPPostfixTCPMapAliasServer(postfix.PostfixTCPMapServer):
A postfix tcp map alias resolver server.
"""
- def _cbGot(self, value):
+ def _cbGot(self, uuid):
"""
Return a code and message depending on the result of the factory's
get().
- :param value: The uuid and public key.
+ :param value: The uuid.
:type value: list
"""
- uuid, pubkey = value
if uuid is None:
self.sendCode(
TCP_MAP_CODE_PERMANENT_FAILURE,
postfix.quote("NOT FOUND SRY"))
- elif pubkey is None:
- self.sendCode(
- TCP_MAP_CODE_TEMPORARY_FAILURE,
- postfix.quote("4.7.13 USER ACCOUNT DISABLED"))
else:
self.sendCode(
TCP_MAP_CODE_SUCCESS,
postfix.quote(uuid))
-class AliasResolverFactory(LEAPostfixTCPMapServerFactory):
+class AliasResolverFactory(LEAPPostfixTCPMapServerFactory):
"""
A factory for postfix tcp map alias resolver servers.
"""