IndexError: list index out of range
crashcoq opened this issue · 2 comments
Hello
I have tested the soft, my problem:
account1/ALL (on imap.free.fr)
Traceback (most recent call last):
File "imapbox.py", line 98, in
main()
File "imapbox.py", line 91, in main
print("Saving folder: " + folder_name[1])
IndexError: list index out of range
i have modified the imapbox.py:
if account['remote_folder'] == "ALL":
for folder_entry in get_folder_fist(account):
folder_name = folder_entry.decode().split(' "." ')
-> print(folder_name)
print("Saving folder: " + folder_name[1])
account['remote_folder'] = folder_name[1]
save_emails(account, options)
else:
save_emails(account, options)
the error is:
account1/ALL (on imap.free.fr)
['(\HasNoChildren) "/" "Apple"']
Traceback (most recent call last):
File "imapbox.py", line 99, in
main()
File "imapbox.py", line 92, in main
print("Saving folder: " + folder_name[1])
IndexError: list index out of range
Could you help me?
Hello crashcoq ,
I have the same issue, my provider is Fastmail.
In Fastmail the folders use this structure INBOX, INBOX/Drafts ...
The script assume there are dot and get the 2 second element.
I didn't have dot in folder name so index 1 doesn't exist.
I changed the line
folder_name = folder_entry.decode().split(' "." ')
By :
folder_name = folder_entry.decode().replace("/",".").split(' "." ')
Now the script run for me
Hi, script updated for folders with /