1
0
Fork 0
mirror of https://git.code.sf.net/p/archivemail/code synced 2024-12-22 15:56:27 +00:00

Added --debug-imap option which just sets imaplib.Debug.

This commit is contained in:
Nikolaus Schulz 2008-02-14 22:26:10 +00:00
parent 6abf732d2e
commit 704d5a961e

View file

@ -192,6 +192,7 @@ class Options:
script_name = os.path.basename(sys.argv[0]) script_name = os.path.basename(sys.argv[0])
min_size = None min_size = None
verbose = 0 verbose = 0
debug_imap = 0
warn_duplicates = 0 warn_duplicates = 0
copy_old_mail = 0 copy_old_mail = 0
@ -212,7 +213,8 @@ class Options:
"include-flagged", "no-compress", "output-dir=", "include-flagged", "no-compress", "output-dir=",
"filter-append=", "pwfile=", "dont-mangle", "filter-append=", "pwfile=", "dont-mangle",
"preserve-unread", "quiet", "size=", "suffix=", "preserve-unread", "quiet", "size=", "suffix=",
"verbose", "version", "warn-duplicate", "copy"]) "verbose", "debug-imap=", "version",
"warn-duplicate", "copy"])
except getopt.error, msg: except getopt.error, msg:
user_error(msg) user_error(msg)
@ -262,6 +264,8 @@ class Options:
self.mangle_from = 0 self.mangle_from = 0
if o in ('-v', '--verbose'): if o in ('-v', '--verbose'):
self.verbose = 1 self.verbose = 1
if o == '--debug-imap':
self.debug_imap = int(a)
if o == '--copy': if o == '--copy':
if self.delete_old_mail: if self.delete_old_mail:
user_error("found conflicting options --copy and --delete") user_error("found conflicting options --copy and --delete")
@ -673,6 +677,7 @@ Options are as follows:
--no-compress do not compress archives with gzip --no-compress do not compress archives with gzip
--warn-duplicate warn about duplicate Message-IDs in the same mailbox --warn-duplicate warn about duplicate Message-IDs in the same mailbox
-v, --verbose report lots of extra debugging information -v, --verbose report lots of extra debugging information
--debug-imap=NUM set IMAP debugging output level (0 is none)
-q, --quiet quiet mode - print no statistics (suitable for crontab) -q, --quiet quiet mode - print no statistics (suitable for crontab)
-V, --version display version information -V, --version display version information
-h, --help display this message -h, --help display this message
@ -1331,6 +1336,8 @@ def _archive_imap(mailbox_name, final_archive_name):
import cStringIO import cStringIO
import getpass import getpass
vprint("Setting imaplib.Debug = %d" % options.debug_imap)
imaplib.Debug = options.debug_imap
archive = None archive = None
stats = Stats(mailbox_name, final_archive_name) stats = Stats(mailbox_name, final_archive_name)
cache = IdentityCache(mailbox_name) cache = IdentityCache(mailbox_name)