summaryrefslogtreecommitdiff
path: root/src/leap/mx/tcp_map.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/tcp_map.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/tcp_map.py')
-rw-r--r--src/leap/mx/tcp_map.py20
1 files changed, 0 insertions, 20 deletions
diff --git a/src/leap/mx/tcp_map.py b/src/leap/mx/tcp_map.py
index b7066ff..b62441f 100644
--- a/src/leap/mx/tcp_map.py
+++ b/src/leap/mx/tcp_map.py
@@ -18,7 +18,6 @@
from twisted.python import log
-from twisted.internet import defer
from twisted.internet.protocol import ServerFactory
@@ -42,24 +41,6 @@ class LEAPPostfixTCPMapServerFactory(ServerFactory):
"""
self._cdb = couchdb
- def _getPubKey(self, uuid):
- """
- Look up PGP public key based on user uid.
-
- :param uuid: The user uid.
- :type uuid: str
-
- :return: A deferred that is fired with the uuid and the public key, if
- available.
- :rtype: DeferredList
- """
- if uuid is None:
- return defer.succeed([None, None])
- return defer.gatherResults([
- defer.succeed(uuid),
- self._cdb.getPubKey(uuid),
- ])
-
def get(self, key):
"""
Look up uuid based on key, only up to the username id of the key.
@@ -71,6 +52,5 @@ class LEAPPostfixTCPMapServerFactory(ServerFactory):
"""
log.msg("Query key: %s" % (key,))
d = self._cdb.queryByAddress(key)
- d.addCallback(self._getPubKey)
d.addErrback(log.err)
return d