Commit Graph

17 Commits

Author SHA1 Message Date
Nikolaus Schulz e1a6028332 test suite: bail out on python versions << 2.4
The test suite uses function that were introduced in Python 2.4 (e.g.
set(), sorted()).
2012-11-04 23:29:08 +01:00
Nikolaus Schulz 22d4393cb6 Bump year in copyright notes 2011-07-09 19:58:36 +02:00
Nikolaus Schulz 483a58879f test suite: adapt to new behaviour of parse_imap_url()
This also removes some pretty bogus test URLs.
2011-07-09 19:03:16 +02:00
Nikolaus Schulz 14e5cd6eb1 test suite: add simple test for parsing IMAP urls specifying port numbers 2011-07-09 18:03:40 +02:00
Nikolaus Schulz 6b0fefc45f IMAP: add support for non-ascii mailbox names 2011-07-05 23:45:28 +02:00
Nikolaus Schulz f6046b9d69 test suite: let FixedGzipFile.seek() pass on what gzip.GzipFile.seek() returned
This fixes test suite failures with Python 2.7.

Starting with Python 2.7, gzip.GzipFile is subclassing io.IOBase.
The seek() method of io.IOBase differs from file.seek() and the old
gzip.GzipFile.seek() in that it returns the new file position, not None.

And in Python 2.7, gzip.GzipFile.tell() is inherited from
io.IOBase.tell(), which is implemented using its seek() method.
FixedGzipFile subclasses gzip.GzipFile and overrides seek(); therefore,
this method need be adapted for this change in the interface.

Closes: #3314293.
2011-06-18 00:13:41 +02:00
Nikolaus Schulz eb8bc7a4ec IMAP: correctly handle IMAP `literal' and unquoted `astring' in LIST reply
The LIST reply handling in imap_find_mailboxes() was buggy in several
ways.  It expected a non-NIL hierarchy delimiter, and it assumed that the
mailbox name in a LIST reply is always quoted; but it can be an astring, a
quoted string, or a literal (see RFC 3501 for the definitions of these
tokens).  These variants should now all be interpreted correctly.

In addition, quoted mailbox names are now handled more strictly to the
letter of the RFC; this only affects mailbox names containing a " or a
backslash, though.
2010-09-26 21:28:54 +02:00
Nikolaus Schulz 3a9a5cd4b8 New option --archive-name, alias -a, to hard-code the archive filename 2010-07-31 20:49:30 +02:00
Nikolaus Schulz 04bf8eaa23 test suite: fix buggy test of --suffix and --prefix option parsing 2010-07-31 20:49:30 +02:00
Nikolaus Schulz 0921a1c91a test suite: replace some plain assertions with TestCase.assertEqual() 2010-07-31 20:49:30 +02:00
Nikolaus Schulz f1f34ca46e Don't create hidden archives when archiving mailboxes with leading dots in the name
When archiving a mailbox with leading dots in the name and no archive name
prefix specified, strip the dots off the archive name.  This is targeting
Maildir++ subfolders.
2010-07-31 20:49:29 +02:00
Nikolaus Schulz 67f23e1af4 Only use the default archive name suffix when the user specified no affix
Also add more archive name affix testing to the test suite.
2010-07-31 20:49:29 +02:00
Nikolaus Schulz b6bc92c34f New option --archive-prefix, alias -p
Technically, this works just like the --suffix option.  This commit also
updates the manpage accordingly.

Currently, the prefix is not checked for slashes, so it could contain path
components.  (The same applies for the suffix, btw).  Since the expanded
string is prepended to the archive base name, this can be used to dynamically
configure the archive directory, depending on the archive cutoff date.  I'm
not sure if this can be considered a reasonable feature, though.
2010-07-31 20:49:03 +02:00
Nikolaus Schulz f22fe4decd 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.
2010-07-30 19:15:21 +02:00
Nikolaus Schulz e9446e2fc4 test suite: test unlocking an mbox after dotlocking failed with EACCES 2010-07-30 13:30:20 +02:00
Nikolaus Schulz a102b5baf9 Rename archivemail.py to archivemail
On Unix, most scripts don't come with a file extension, it's not needed, and
we distribute the script as "archivemail" anyway.  And most importantly, I
like it better without the extension. :)

With a little trick we can still load the script as a module from the test
suite.
2010-07-29 21:35:58 +02:00
Nikolaus Schulz febd030e14 Drop .py extension from the unittest script 2010-07-29 21:02:12 +02:00
Renamed from test_archivemail.py (Browse further)