diff options
author | Kali Kaneko <kali@leap.se> | 2015-09-23 11:45:58 -0400 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2015-09-23 11:45:58 -0400 |
commit | b10951322602dbbd6a5e77064144bcd9c2622e0b (patch) | |
tree | dab314533216fce84ca8ddd635f39308a011f4a1 | |
parent | cc437cd97cb8ee43e6042cd510963f57a7db53c2 (diff) | |
parent | 40a8f4b5f8e9263e4f358a4e4bc96b0ac0c18208 (diff) |
Merge remote-tracking branch 'leapcode/pr/206' into develop
-rw-r--r-- | mail/src/leap/mail/mail.py | 18 | ||||
-rw-r--r-- | mail/src/leap/mail/outgoing/service.py | 4 | ||||
-rw-r--r-- | mail/src/leap/mail/smtp/gateway.py | 3 |
3 files changed, 14 insertions, 11 deletions
diff --git a/mail/src/leap/mail/mail.py b/mail/src/leap/mail/mail.py index 258574e..fc5abd2 100644 --- a/mail/src/leap/mail/mail.py +++ b/mail/src/leap/mail/mail.py @@ -916,17 +916,19 @@ class Account(object): adaptor_class = SoledadMailAdaptor - # This is a mapping to collection instances so that we always - # return a reference to them instead of creating new ones. However, being a - # dictionary of weakrefs values, they automagically vanish from the dict - # when no hard refs is left to them (so they can be garbage collected) - # This is important because the different wrappers rely on several - # kinds of deferredLocks that are kept as class or instance variables - _collection_mapping = weakref.WeakValueDictionary() - def __init__(self, store, ready_cb=None): self.store = store self.adaptor = self.adaptor_class() + + # this is a mapping to collection instances so that we always + # return a reference to them instead of creating new ones. however, + # being a dictionary of weakrefs values, they automagically vanish + # from the dict when no hard refs is left to them (so they can be + # garbage collected) this is important because the different wrappers + # rely on several kinds of deferredlocks that are kept as class or + # instance variables + self._collection_mapping = weakref.WeakValueDictionary() + self.mbox_indexer = MailboxIndexer(self.store) # This flag is only used from the imap service for the moment. diff --git a/mail/src/leap/mail/outgoing/service.py b/mail/src/leap/mail/outgoing/service.py index 3708f33..3754650 100644 --- a/mail/src/leap/mail/outgoing/service.py +++ b/mail/src/leap/mail/outgoing/service.py @@ -241,7 +241,7 @@ class OutgoingMail: def signal_encrypt_sign(newmsg): emit_async(catalog.SMTP_END_ENCRYPT_AND_SIGN, - "%s,%s" % (self._from_address, to_address)) + "%s,%s" % (self._from_address, to_address)) return newmsg, recipient def if_key_not_found_send_unencrypted(failure, message): @@ -260,7 +260,7 @@ class OutgoingMail: log.msg("Will encrypt the message with %s and sign with %s." % (to_address, from_address)) emit_async(catalog.SMTP_START_ENCRYPT_AND_SIGN, - "%s,%s" % (self._from_address, to_address)) + "%s,%s" % (self._from_address, to_address)) d = self._maybe_attach_key(origmsg, from_address, to_address) d.addCallback(maybe_encrypt_and_sign) return d diff --git a/mail/src/leap/mail/smtp/gateway.py b/mail/src/leap/mail/smtp/gateway.py index dd110e0..c988367 100644 --- a/mail/src/leap/mail/smtp/gateway.py +++ b/mail/src/leap/mail/smtp/gateway.py @@ -204,7 +204,8 @@ class SMTPDelivery(object): # verify if recipient key is available in keyring def found(_): log.msg("Accepting mail for %s..." % user.dest.addrstr) - emit_async(catalog.SMTP_RECIPIENT_ACCEPTED_ENCRYPTED, user.dest.addrstr) + emit_async(catalog.SMTP_RECIPIENT_ACCEPTED_ENCRYPTED, + user.dest.addrstr) def not_found(failure): failure.trap(KeyNotFound) |