aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikolaus Schulz <microschulz@web.de>2007-11-07 23:57:03 +0000
committerNikolaus Schulz <microschulz@web.de>2007-11-07 23:57:03 +0000
commit4b64da911e2af608782554d7e376fce9bfb54307 (patch)
treeef1ebc226e31e2d52bc442392f59f1e35e73f424
parentadf6515746be0882f08a4c1be1aa183111dc2eb1 (diff)
downloadarchivemail-4b64da911e2af608782554d7e376fce9bfb54307.tar.gz
archivemail-4b64da911e2af608782554d7e376fce9bfb54307.tar.bz2
archivemail-4b64da911e2af608782554d7e376fce9bfb54307.zip
Debug message improvements. Explicitely say if we're selecting an IMAP mailbox
read-only. Improve some formatting.
-rwxr-xr-xarchivemail.py8
1 files 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: