From 4b64da911e2af608782554d7e376fce9bfb54307 Mon Sep 17 00:00:00 2001 From: Nikolaus Schulz Date: Wed, 7 Nov 2007 23:57:03 +0000 Subject: Debug message improvements. Explicitely say if we're selecting an IMAP mailbox read-only. Improve some formatting. --- archivemail.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/archivemail.py b/archivemail.py index 2e73ff9..91bc322 100755 --- a/archivemail.py +++ b/archivemail.py @@ -1348,16 +1348,18 @@ def _archive_imap(mailbox_name, final_archive_name): except imaplib.IMAP4.error: result, response = imap_srv.login(imap_username, imap_password) - vprint("selecting imap folder '%s'" % imap_folder) - # Open mailbox read-only? roflag = options.dry_run or options.copy_old_mail + if roflag: + vprint("examining imap folder '%s' read-only" % imap_folder) + else: + vprint("selecting imap folder '%s'" % imap_folder) # First try the given folder name, if this doesn't work, try to fix it. result, response = imap_srv.select(imap_folder, roflag) if result != 'OK': errmsg = "cannot select imap folder; server says '%s'" % response[0] if not os.path.sep in imap_folder: unexpected_error(errmsg) - vprint("Selecting '%s' failed; server says: '%s'. Trying to " + vprint("Selecting '%s' failed; server says: '%s'.\nTrying to " "fix mailbox path..." % (imap_folder, response[0])) delim = imap_getdelim(imap_srv) if not delim: -- cgit v1.2.3