diff options
author | Folker Bernitt <fbernitt@thoughtworks.com> | 2015-04-30 10:47:33 +0200 |
---|---|---|
committer | Folker Bernitt <fbernitt@thoughtworks.com> | 2015-04-30 10:47:33 +0200 |
commit | f0b9672a26b23c7440d915890159d6e4987d28ce (patch) | |
tree | adc36c596e5e87a4c4f3d653a8a0aeccf081670f /service | |
parent | 42321f2b6956370d00ab66b60451c51f718c52b0 (diff) |
Removed check for mail file names.
- Issue #337
Diffstat (limited to 'service')
-rw-r--r-- | service/pixelated/maintenance.py | 6 | ||||
-rw-r--r-- | service/test/unit/maintenance/test_commands.py | 11 |
2 files changed, 2 insertions, 15 deletions
diff --git a/service/pixelated/maintenance.py b/service/pixelated/maintenance.py index 5f5719f5..8e837c88 100644 --- a/service/pixelated/maintenance.py +++ b/service/pixelated/maintenance.py @@ -156,8 +156,6 @@ def load_mails(args, mail_paths): for root, dirs, files in os.walk(path): mbx = account.getMailbox('INBOX') for file_name in files: - if not is_mail_file_name_valid(file_name): - continue with open(join(root, file_name), 'r') as email_file: m = email.message_from_file(email_file) flags = ("\\RECENT",) @@ -188,10 +186,6 @@ def flush_to_soledad(args, finalize): return args -def is_mail_file_name_valid(file_name): - return re.match('mbox[0-9]+$', file_name) - - def dump_soledad(args): leap_session, soledad = args diff --git a/service/test/unit/maintenance/test_commands.py b/service/test/unit/maintenance/test_commands.py index 2c47da40..6c881cb9 100644 --- a/service/test/unit/maintenance/test_commands.py +++ b/service/test/unit/maintenance/test_commands.py @@ -16,7 +16,7 @@ import unittest import email -from pixelated.maintenance import delete_all_mails, load_mails, is_mail_file_name_valid +from pixelated.maintenance import delete_all_mails, load_mails from pixelated.bitmask_libraries.session import LeapSession from leap.mail.imap.account import SoledadBackedAccount from leap.soledad.client import Soledad @@ -80,7 +80,7 @@ class TestCommands(unittest.TestCase): def test_load_mails_adds_mails(self): mail_root = join(dirname(__file__), '..', 'fixtures', 'mailset') - load_mails(self.args, [mail_root]) + foo = load_mails(self.args, [mail_root]) self.assertTrue(self.mailbox.addMessage.called) self.mailbox.addMessage.assert_any_call(self._mail_content(join(mail_root, 'mbox00000000')), flags=("\\RECENT",), notify_on_disk=False) @@ -90,10 +90,3 @@ class TestCommands(unittest.TestCase): with open(mail_file, 'r') as fp: m = email.message_from_file(fp) return m.as_string() - - def test_the_filter_should_validate_right_file_naming(self): - file_name = 'mbox00000' - - validation = is_mail_file_name_valid(file_name) - - self.assertTrue(validation) |