rcarmo/imapbackup

Fails when mailbox contains quotation mark

Closed this issue · 2 comments

imapbackup.py 1.4h fails when a mailbox in the account contains quotation marks.

I was archiving a former user (have used imapbackup numerous times previously), and it failed with the following errors:

../imapbackup.py -s imap.server.net -u gala@domain.ca -p password
Connecting to 'imap.server.net' TCP port 143
Logging in as 'gala@domain.ca'
Finding Folders -Traceback (most recent call last):
File "../imapbackup.py", line 715, in
main()
File "../imapbackup.py", line 604, in main
config['nospinner'])
File "../imapbackup.py", line 350, in get_names
lst = parse_list(row)
File "../imapbackup.py", line 313, in parse_list
row = row.strip()
AttributeError: 'tuple' object has no attribute 'strip'

I logged into the user's account, and realized they had used quotation marks in several mailbox names. I removed the quotation marks and imapbackup proceeded without issue.

I have re-tested by creating a "test" mailbox (quotes included) in my own account, and running imapbackup. It fails with the same errors above. Removed the "test" mailbox fixed the problem.

I do not know if there is any standard recommendation against using quotation marks in a mailbox name, so I presume imapbackup should be able to escape them appropriately.

Running imapbackup 1.4h on Mac OS X Server 10.11.6 with Python 2.7.10.

Im going to assume this is a dupe of #12 and preserve that one as it is the latest (more active) issue.