aboutsummaryrefslogtreecommitdiffstats
path: root/test_archivemail
diff options
context:
space:
mode:
authorNikolaus Schulz <microschulz@web.de>2010-07-30 19:13:14 +0200
committerNikolaus Schulz <microschulz@web.de>2010-07-30 19:15:21 +0200
commitf22fe4decd9a70a2eb826ecdd14f9d1bb3b4e394 (patch)
treef2d3353d1764877ea9eb936c6e99977d09560f70 /test_archivemail
parentd99b4b4414e90240524ceca6bb3ccd1ffa7fbbec (diff)
downloadarchivemail-f22fe4decd9a70a2eb826ecdd14f9d1bb3b4e394.tar.gz
archivemail-f22fe4decd9a70a2eb826ecdd14f9d1bb3b4e394.tar.bz2
archivemail-f22fe4decd9a70a2eb826ecdd14f9d1bb3b4e394.zip
Detect and never archive IMAP server pseudo mbox messages
IMAP servers (Dovecot and UW-IMAP at least) may store mailbox meta data for mboxes in a pseudo message. Such messages are now detected and never archived. This commit includes a test case in the test suite.
Diffstat (limited to 'test_archivemail')
-rwxr-xr-xtest_archivemail22
1 files changed, 22 insertions, 0 deletions
diff --git a/test_archivemail b/test_archivemail
index 2d63d78..fda2d63 100755
--- a/test_archivemail
+++ b/test_archivemail
@@ -1103,6 +1103,28 @@ class TestArchiveSize(unittest.TestCase):
archivemail.options.min_size = None
+class TestXIMAPMessage(TestArchive):
+ """Test if IMAP pseudo messages in mboxes are properly handled."""
+ def setUp(self):
+ super(TestXIMAPMessage, self).setUp()
+ archivemail.options.quiet = True
+
+ def testXIMAPMbox(self):
+ """IMAP pseudo messages in an mbox are always preserved."""
+ self.good_mbox = make_mbox(hours_old=181*24, headers={'X-IMAP': 'dummytext'},
+ messages=1)
+ self.good_archive = make_mbox(hours_old=181*24, messages=3)
+ self.mbox = tempfile.mkstemp()[-1]
+ shutil.copyfile(self.good_mbox, self.mbox)
+ append_file(self.good_archive, self.mbox)
+ archivemail.archive(self.mbox)
+ self.verify()
+
+ def tearDown(self):
+ super(TestXIMAPMessage, self).tearDown()
+ archivemail.options.quiet = False
+
+
############# Test archiving maildirs ###############
class TestArchiveMailboxdir(TestCaseInTempdir):