Commit Graph

132 Commits

Author SHA1 Message Date
Nikolaus Schulz 78b4923832 IMAP: be NAMESPACE-aware; improved probing for guessed mailbox names.
* Automatically add NAMESPACE prefix to the mailbox path if necessary, 
  * Explicitely check for guessed mailbox names with LIST instead of just trying
    to SELECT them. 
  * Updated documentation about NAMESPACE handling.
2008-04-08 15:38:51 +00:00
Nikolaus Schulz bfff00e395 Code structuring: made a separate group of IMAP functions.
No code changes, just moved functions around.
2008-04-07 20:16:29 +00:00
Nikolaus Schulz 07219ff14b IMAP: servers should never advertise LOGINDISABLED with SSL; removed the check
for it, which was just used to spit a special error message anyway.
2008-03-21 01:05:15 +00:00
Nikolaus Schulz 26ab4611ec Archiving an IMAP folder with --all didn't archive *any* messages.
The message sequence numbers must be strings, but were generated as integers;
fixed.
2008-03-19 18:30:43 +00:00
Nikolaus Schulz efe02ea32a Updated year in another copyright note, which I overlooked before. 2008-03-16 17:57:18 +00:00
Nikolaus Schulz a9215463c4 Removed an assertion which choked upon --days=0. 2008-03-15 20:34:52 +00:00
Nikolaus Schulz f43cbb106d Added new option --all to archive all messages in a mailbox.
Updated documentation, and added a first simple unittest for this.
Closes: #1764846.
2008-03-15 20:24:46 +00:00
Nikolaus Schulz 2719645f2c Updated copyright notes to include year 2008. 2008-03-15 19:39:28 +00:00
Nikolaus Schulz c0f0ad33d7 Fixed crash when archiving an empty maildir with python 2.5.
The incompatible changes in mailbox.Maildir triggered an assertion in
_archive_dir(); removing that assertion since it looks not useful anyway.
2008-03-15 18:42:56 +00:00
Nikolaus Schulz 22e23d9d38 Sanitized parsing some IMAP server responses by switching to regular
expressions.
2008-03-15 15:59:05 +00:00
Nikolaus Schulz 704d5a961e Added --debug-imap option which just sets imaplib.Debug. 2008-02-14 22:26:10 +00:00
Nikolaus Schulz 6abf732d2e IMAP: catch LOGINDISABLED, and suggest using imaps. 2008-02-14 22:24:16 +00:00
Nikolaus Schulz 533628c2fc Only try CRAM-MD5 authentication if the server advertises it. 2008-02-14 22:19:34 +00:00
Nikolaus Schulz 77481169d8 _archive_imap() used SSL only if the 'imaps://' url scheme was all lowercase.
Fixed.
2008-01-19 00:04:01 +00:00
Nikolaus Schulz 8e5c870057 guess_delivery_time():
* look for the timestamp of the latest 'Received' header before resorting to
   'Date' or 'Resent-Date'.  
 * let 'Resent-date' header take precedence over 'Date'. 
Document these changes in manpage and changelog. 
Closes: #1481316, #1764855, Debian bug #272666.
2007-11-13 21:13:38 +00:00
Nikolaus Schulz 4584dffe14 Fixed date header parsing to be precise with timezone information. Also, when
writing From_ line timestamps, don't use UTC but local time, without timezone
information.
2007-11-13 02:59:31 +00:00
Nikolaus Schulz 5178c956bc !%&$*# Repair previous broken commit where an unrelated hunk slipped through.
Reverted that hunk.
2007-11-13 00:36:51 +00:00
Nikolaus Schulz d9ffaf4a3b When converting from other formats to mbox, re-use existing 'Status' and
'X-Status' headers if appropriate (instead of deleting and re-generating them).
2007-11-13 00:32:49 +00:00
Nikolaus Schulz ead112daba If running as root, only call seteuid/setegid if the if the owner of the mailbox
is not root.
2007-11-09 17:04:52 +00:00
Nikolaus Schulz 0ae7edab86 Bumped version to 0.7.2, and updated release info on the webpage. 2007-11-09 14:54:54 +00:00
Nikolaus Schulz e0c75a1001 IMAP: fixed crash by working around python bug #1277098, which is still pending
in python << 2.5.
2007-11-09 14:33:13 +00:00
Nikolaus Schulz 4b64da911e Debug message improvements. Explicitely say if we're selecting an IMAP mailbox
read-only.  Improve some formatting.
2007-11-07 23:57:03 +00:00
Nikolaus Schulz adf6515746 Added more debugging messages to the IMAP flag conversion. 2007-11-07 23:51:41 +00:00
Nikolaus Schulz 9439e1fa8a Minor code cleanup. 2007-11-07 23:50:18 +00:00
Nikolaus Schulz d5cb3dad61 IMAP: if selecting a mailbox fails with both the original path name and with
replaced path delimiters, report failure for the original path.
2007-11-07 21:10:08 +00:00
Nikolaus Schulz f47de26676 Minor code cleanups. 2007-11-07 19:52:52 +00:00
Nikolaus Schulz fbb00e08f4 IMAP: if selecting the mailbox fails, then detect the server's mailbox hierarchy
delimiter, replace slashes in the mailbox name with the delimiter and try again.
2007-11-07 16:31:49 +00:00
Nikolaus Schulz 1e5cb090e7 Fixed IMAP --verbose mode to say what we're *intending* to do next, instead of
reporting success after the fact.  This makes a lot more sense for debugging. 
Also added some more messages.
2007-11-07 14:33:17 +00:00
Nikolaus Schulz bcb01613d0 archivemail.py, setup.py, test_archivemail.py:
bumped version to 0.7.1, and updated copyright.
2007-11-07 00:57:44 +00:00
Nikolaus Schulz 74c871644e When converting from other formats to mbox, don't preserve existing 'Status' and
'X-Status' mbox headers, we better overwrite them with correct values.
2007-11-02 23:35:50 +00:00
Nikolaus Schulz c0552fcd06 With IMAP no IdentityCache object was initialized, causing a crash if
--warn-duplicates was used.  Closes: Debian bug #434786.
2007-11-02 21:53:20 +00:00
Nikolaus Schulz b40da3124a archivemail.py: added --copy option to the usage message. 2007-11-02 21:21:17 +00:00
Nikolaus Schulz aae08fe3fb Let archivemail accept --days=0. 2007-11-02 21:18:23 +00:00
Nikolaus Schulz 59e9715021 Expand tilde in argument of long option --pwfile. 2007-11-02 21:06:59 +00:00
Nikolaus Schulz b2f94206b1 Deprecate the old automatic seteuid feature; document this in the manpage and
changelog, and let archivemail spit a warning when it changes the effective user
id.
2007-11-02 20:26:40 +00:00
Nikolaus Schulz 3ee105d766 If running as root, only switch the effective uid and gid back if we have
actually switched them before.
2007-11-02 18:47:23 +00:00
Nikolaus Schulz 3240b24d9f New option --copy: archive mail, but don't delete it from the mailbox.
Closes: #981865, #988803, #1764851, Debian bug #434798
2007-11-02 17:44:38 +00:00
Nikolaus Schulz 0eba452d93 IMAP: first fetch message flags, then the body. Doing it together always
returns the \Seen flag set.  
Closes: Debian bug #434807 (well, the outstanding part of it).
2007-11-02 13:21:18 +00:00
Nikolaus Schulz 130a5ef117 When converting from maildir or IMAP to mbox, report existing 'Status' and
'X-Status' headers in verbose mode, since they are preserved, which can give
surprising results.
2007-11-02 12:27:32 +00:00
Nikolaus Schulz 82e3be1987 IMAP: fixed message flags retrieval, which failed to extract the right string
from the server response.  Tough.
2007-11-02 12:00:12 +00:00
Nikolaus Schulz 6ea7c7d810 If dry-running, open IMAP mailboxes read-only. This uses EXAMINE instead of
select, thus preserving the \Recent flag.
2007-11-02 11:44:21 +00:00
Nikolaus Schulz 9e70e576af add_status_headers_imap():
* mark message 'old' iff it's not \Recent (drop requirement that it's
      unread; this probably confused mutt's message status flags in the index
      with mbox status flags). 
    * a message not \Seen and not \Recent was marked as 'N', but there is no
      such thing like an mbox status flag 'N'.
2007-11-02 11:26:20 +00:00
Nikolaus Schulz 8e73e315e4 Skip invalid messages/files in Maildirs.
Closes: #1783369, Debian bug #255944, and Debian bug #305902 also seems about
        this issue.
2007-10-24 02:23:59 +00:00
Nikolaus Schulz 0e9ae1d91b New IMAP URL parser that understands double-quoted usernames and passwords.
Closes: #1640878
2007-10-23 22:48:15 +00:00
Nikolaus Schulz 1493a22f38 Define very simple exception classes, mapping to the error functions
user_error() and unexpected_error().  If archivemail is used as a module, let
the functions raise the corresponding exceptions rather than writing to stderr
and calling sys.exit().
2007-10-23 22:27:57 +00:00
Nikolaus Schulz 255a475978 Use a wrapper around rfc822.Message.fp to find the filename for Maildir/MH
emails.  Python 2.5 broke backward compatibility for Maildirs. :-/
Closes: #1670422
2007-10-22 22:03:44 +00:00
Nikolaus Schulz 8abd70093f Expand tilde in argument of long option --output-dir, the shell doesn't. 2006-11-14 22:20:37 +00:00
Nikolaus Schulz faa68b2048 Bumped version to 0.7.0 2006-11-02 06:43:09 +00:00
Nikolaus Schulz 8de4715e5c Renamed __cvs_id__ to __svn_id__. 2006-11-02 06:40:31 +00:00
Nikolaus Schulz 46f9aa44a9 Split the final stats message in two lines, because it might otherwise linewrap. 2006-11-02 05:36:17 +00:00