Changed misleading references to 'message ids' in the IMAP code to the

technically correct 'message sequence number'.
This commit is contained in:
Nikolaus Schulz 2006-11-01 06:11:55 +00:00
parent bea6ef6390
commit e872f2211e
1 changed files with 5 additions and 4 deletions

View File

@ -1341,7 +1341,7 @@ def _archive_imap(mailbox_name, final_archive_name):
result, response = imap_srv.search(None, imap_filter) result, response = imap_srv.search(None, imap_filter)
if result != 'OK': unexpected_error("imap search failed") if result != 'OK': unexpected_error("imap search failed")
# response is a list with a single item, listing message ids # response is a list with a single item, listing message sequence numbers
# like ['1 2 3 1016'] # like ['1 2 3 1016']
message_list = response[0].split() message_list = response[0].split()
vprint("%d messages are matching filter" % len(message_list)) vprint("%d messages are matching filter" % len(message_list))
@ -1351,7 +1351,8 @@ def _archive_imap(mailbox_name, final_archive_name):
result, response = imap_srv.fetch('1:*', '(RFC822.SIZE)') result, response = imap_srv.fetch('1:*', '(RFC822.SIZE)')
if result != 'OK': unexpected_error("Failed to fetch message sizes") if result != 'OK': unexpected_error("Failed to fetch message sizes")
# response is a list with entries like '1016 (RFC822.SIZE 3118)', # response is a list with entries like '1016 (RFC822.SIZE 3118)',
# where the first number is the message id, the second is the size. # where the first number is the message sequence number, the second is
# the size.
for x in response: for x in response:
msn, blurb, msg_size = x.split() msn, blurb, msg_size = x.split()
msg_size = int(msg_size.rstrip(')')) msg_size = int(msg_size.rstrip(')'))
@ -1361,8 +1362,8 @@ def _archive_imap(mailbox_name, final_archive_name):
if not options.dry_run: if not options.dry_run:
if not options.delete_old_mail: if not options.delete_old_mail:
for msg_id in message_list: for msn in message_list:
result, response = imap_srv.fetch(msg_id, '(RFC822 FLAGS)') result, response = imap_srv.fetch(msn, '(RFC822 FLAGS)')
if result != 'OK': unexpected_error("Failed to fetch message") if result != 'OK': unexpected_error("Failed to fetch message")
if "\r\n" == os.linesep: if "\r\n" == os.linesep:
msg_str = response[0][1] msg_str = response[0][1]