Commit Graph

99 Commits

Author SHA1 Message Date
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
Nikolaus Schulz 810dea1bf5 Made IMAP password prompt a tad bit more verbose. 2006-11-01 21:05:10 +00:00
Nikolaus Schulz 3d8a1bda89 Don't prompt for the IMAP password if in quiet mode or if not running
interactively (stdin is not a terminal).
2006-11-01 20:57:58 +00:00
Nikolaus Schulz 89e6683334 Improved IMAP error handling: pass error messages from the server on to the
user, and check if deleting the messages was successful.
2006-11-01 20:35:53 +00:00
Nikolaus Schulz c7d074abde Streamlined verbose IMAP messages a bit. 2006-11-01 20:25:09 +00:00
Nikolaus Schulz d79da0ae99 Removed redundant check if imap login was succesful, since IMAP4.login then
raises an exception.
2006-11-01 20:23:44 +00:00
Nikolaus Schulz c5f194f3ec Tightened some blanket exception handlers. 2006-11-01 19:49:47 +00:00
Nikolaus Schulz e872f2211e Changed misleading references to 'message ids' in the IMAP code to the
technically correct 'message sequence number'.
2006-11-01 06:11:55 +00:00
Nikolaus Schulz bea6ef6390 Optimized IMAP code: just invert the message list from the SEARCH response
instead of querying the server another time with an inverted search filter.
Gather RFC822.SIZE in one big run.
2006-11-01 05:27:30 +00:00
Nikolaus Schulz 86f1fec50d Renamed variable 'filter' to prevent conflicts with the builtin function. 2006-11-01 00:40:26 +00:00
Nikolaus Schulz b3dc8a006e Always sanity-check each archive destination directory, not only when it's
specified with --output-dir.
2006-10-31 04:09:31 +00:00
Nikolaus Schulz dcd37f6466 Make stats report size totals for the mailboxes and the archived messages, and
while at it, make stats work with IMAP.
2006-10-31 03:07:02 +00:00
Nikolaus Schulz 9549c3e29d Minor code cleanup in build_imap_filter(). 2006-10-31 00:35:19 +00:00
Nikolaus Schulz a221f62f52 Shortened new option name "--dont-mangle-from" to "--dont-mangle". 2006-10-30 19:34:39 +00:00
Nikolaus Schulz 697c22daac Rewrote Mbox.procmail_lock() to fix locking race condition. Should now also be
NFS-safe.
2006-10-30 19:29:15 +00:00
Nikolaus Schulz 99cfab1f4e Don't run clean_up() by means of atexit, but use a plain finally clause in the
main archive() function.  This is simpler, and it works better with the
testsuite calling archive() directly, where the atexit handler isn't triggered.
2006-10-29 03:10:45 +00:00
Nikolaus Schulz 2dbd3c1940 Preparing per-testcase cleanup: made StaleFiles.clean() remember what it
deleted, so it's idempotent and e.g. doesn't stomp over someone else's files if
invoked twice and running as root.  Currently I don't see how this could happen,
but it will with a per-testcase cleanup.
2006-10-29 00:04:09 +00:00
Nikolaus Schulz 5eb4cf3cf6 Replaced all tempfile.mktemp() calls with mkstemp()/mkdtemp().
Should just serve as a last security fallback, since we operate in a safe
temporary directory and everything should be okay anyway, but that may be less
obvious. :-)
2006-10-27 03:23:16 +00:00
Nikolaus Schulz 3c0939a3ef When writing messages to mboxes, append os.linesep and mangle From_ only if the
message source is not an mbox-format folder.  
Attempts to fix broken mbox-formatted input are only asking for trouble, and
that's not our job anyway.
2006-10-18 01:20:05 +00:00
Nikolaus Schulz f4c6017d32 IMAPS and IMAP4.login_cram_md5() are new in Python 2.3; bump Python dependency
check to version 2.3.
2006-10-14 23:22:25 +00:00
Nikolaus Schulz 334d1ef9f1 Updated archivemail.__copyright__ 2006-10-14 22:45:25 +00:00
Nikolaus Schulz d631079250 Added maintainer entry in setup.py.
Updated copyright notices in archivemail.py and test_archivemail.py.
2006-10-12 23:02:03 +00:00
Nikolaus Schulz b682b26398 Added new option --dont-mangle-from to turn off From_ mangling. 2006-10-12 21:14:04 +00:00
Nikolaus Schulz 6198341eef Made From_ mangling work reliably with large messages, too. 2006-10-12 19:28:30 +00:00
Nikolaus Schulz 88ef628f20 Mangle From_ in message bodies. 2006-10-12 18:19:01 +00:00
Nikolaus Schulz a0994e6a57 Terminate each message in newly written mbox with an empty line. 2006-10-12 17:35:37 +00:00
Nikolaus Schulz 539894ced4 Implemented --dry-run and --delete for IMAP, both do no not download messages.
Stats are still missing.
2006-10-12 01:02:35 +00:00
Nikolaus Schulz 800a957b59 Preparing the implementation of IMAP --delete:
if not dry-running, delete messages whether we archived them or not.
2006-10-11 19:56:50 +00:00
Nikolaus Schulz 27ca6547c5 Kindly shutdown IMAP connection when doing a --dry-run, too. 2006-10-11 19:28:36 +00:00
Nikolaus Schulz b8b64804c9 _archive_imap(): deleted unused variable. 2006-10-11 19:18:43 +00:00
Nikolaus Schulz ab28001c84 Fixed invalid IMAP filter string for large messages (--size option).
Closes: #863813
2006-10-02 00:22:58 +00:00
Nikolaus Schulz 140596178c Convert on-the-wire CRLF to native EOL when saving messages from an IMAP folder. 2006-09-28 23:31:47 +00:00
Nikolaus Schulz 8d5b36dc3a Fixed IMAP authentication/URL parsing. Require username encoded in URL, but be
flexible with the password: handle both --pwfile and URL-encoded password, and
fallback to querying the user if neither is present.
2006-09-28 23:26:58 +00:00
Nikolaus Schulz dc023db895 Fixed guess_return_path() to actually extract 'Return-path' and 'From' headers. 2006-09-28 22:26:07 +00:00