summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNavaL <mnandri@thoughtworks.com>2016-02-20 19:17:17 +0100
committerNavaL <mnandri@thoughtworks.com>2016-02-20 19:17:17 +0100
commitf92e802df2aeec9b2341ba5b4efea48356edf01f (patch)
tree327c126f1ba7251854006e43380e3eba6122d0d1
parentf1b338e5564a8458c906f903ee7e0383dae86287 (diff)
Revert "Filter keys from attachments #608 w/ @deniscostadsc"
This reverts commit f1b338e5564a8458c906f903ee7e0383dae86287.
-rw-r--r--service/pixelated/adapter/mailstore/leap_mailstore.py7
m---------service/src/leap.auth0
m---------service/src/leap.common0
m---------service/src/leap.keymanager0
m---------service/src/leap.mail0
m---------service/src/leap.soledad.client0
m---------service/src/leap.soledad.common0
m---------service/src/leap.soledad.server0
-rw-r--r--service/src/pip-delete-this-directory.txt5
-rw-r--r--service/test/integration/test_leap_mailstore.py14
10 files changed, 0 insertions, 26 deletions
diff --git a/service/pixelated/adapter/mailstore/leap_mailstore.py b/service/pixelated/adapter/mailstore/leap_mailstore.py
index 72a16dfa..6cbbe10a 100644
--- a/service/pixelated/adapter/mailstore/leap_mailstore.py
+++ b/service/pixelated/adapter/mailstore/leap_mailstore.py
@@ -29,9 +29,6 @@ from pixelated.support import log_time_deferred
from pixelated.support.functional import to_unicode
-MIME_PGP_KEY = 'application/pgp-keys'
-
-
class AttachmentInfo(object):
def __init__(self, ident, name, encoding=None, ctype='application/octet-stream', size=0):
self.ident = ident
@@ -325,14 +322,10 @@ class LeapMailStore(MailStore):
mbox_uuid = message.get_wrapper().fdoc.mbox_uuid
mbox_name = yield self._mailbox_name_from_uuid(mbox_uuid)
attachments = self._extract_attachment_info_from(message)
- attachments = self._filter_keys(attachments)
mail = LeapMail(mail_id, mbox_name, message.get_wrapper().hdoc.headers, set(message.get_tags()), set(message.get_flags()), body=body, attachments=attachments) # TODO assert flags are passed on
defer.returnValue(mail)
- def _filter_keys(self, attachments):
- return filter(lambda attachment: attachment.ctype != MIME_PGP_KEY, attachments)
-
@defer.inlineCallbacks
def _raw_message_body(self, message):
content_doc = (yield message.get_wrapper().get_body(self.soledad))
diff --git a/service/src/leap.auth b/service/src/leap.auth
deleted file mode 160000
-Subproject 89cb3a5e36bf3f243b55148e58e48e1a91923d3
diff --git a/service/src/leap.common b/service/src/leap.common
deleted file mode 160000
-Subproject eb65db3e4a7e0d5f42fb7269b98aed6fc59788b
diff --git a/service/src/leap.keymanager b/service/src/leap.keymanager
deleted file mode 160000
-Subproject f77d42a25b135e4d11546afde48c24e304ca62d
diff --git a/service/src/leap.mail b/service/src/leap.mail
deleted file mode 160000
-Subproject f303fd99f2f7ff59c24fe34094a91ac17e17649
diff --git a/service/src/leap.soledad.client b/service/src/leap.soledad.client
deleted file mode 160000
-Subproject 2eb96f7f3cb35e48c87af1452749e413a59ffa6
diff --git a/service/src/leap.soledad.common b/service/src/leap.soledad.common
deleted file mode 160000
-Subproject 2eb96f7f3cb35e48c87af1452749e413a59ffa6
diff --git a/service/src/leap.soledad.server b/service/src/leap.soledad.server
deleted file mode 160000
-Subproject 2eb96f7f3cb35e48c87af1452749e413a59ffa6
diff --git a/service/src/pip-delete-this-directory.txt b/service/src/pip-delete-this-directory.txt
deleted file mode 100644
index c8883ea9..00000000
--- a/service/src/pip-delete-this-directory.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-This file is placed here by pip to indicate the source was put
-here by pip.
-
-Once this package is successfully installed this source code will be
-deleted (unless you remove this file).
diff --git a/service/test/integration/test_leap_mailstore.py b/service/test/integration/test_leap_mailstore.py
index f52d7c9c..885aa62b 100644
--- a/service/test/integration/test_leap_mailstore.py
+++ b/service/test/integration/test_leap_mailstore.py
@@ -50,19 +50,6 @@ class LeapMailStoreTest(SoledadTestBase):
self.assertEqual(expected_mail_dict['header'], fetched_mail.as_dict()['header'])
@defer.inlineCallbacks
- def test_remove_key_from_attachments(self):
- input_mail = MIMEMultipart()
- input_mail.attach(MIMEText(u'a utf8 message', _charset='utf-8'))
- attachment = MIMEApplication('pretend to be binary attachment data')
- attachment.add_header('Content-Disposition', 'attachment', filename='pub.key')
- attachment.replace_header('Content-Type', 'application/pgp-keys')
- input_mail.attach(attachment)
-
- mail = yield self.mail_store.add_mail('INBOX', input_mail.as_string())
- fetched_mail = yield self.mail_store.get_mail(mail.ident, include_body=True)
- self.assertEquals(fetched_mail.as_dict().get('attachments'), [])
-
- @defer.inlineCallbacks
def test_round_trip_through_soledad_keeps_attachment(self):
input_mail = MIMEMultipart()
input_mail.attach(MIMEText(u'a utf8 message', _charset='utf-8'))
@@ -72,7 +59,6 @@ class LeapMailStoreTest(SoledadTestBase):
mail = yield self.mail_store.add_mail('INBOX', input_mail.as_string())
fetched_mail = yield self.mail_store.get_mail(mail.ident, include_body=True)
- self.assertDictEqual(mail.as_dict(), fetched_mail.as_dict())
@defer.inlineCallbacks
def test_all_mails(self):