Closed dicarsio closed 1 year ago
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
Have same problem, it's general problem, because I got this error against GroupWise IMAP server
I believe the gmail related issue is a bit more of a Gmail specific thing.
A fix should be available in 1.2.4. @dicarsio can you confirm if this fixes your issue please?
TL;DR: Check your folder name and make sure your mail provider doesn't prefix the folder names with anything. In my case, all my folders had the prefix "INBOX."
I had the same problem but it wasn't a bug, the error message was just misleading. In my case the names of the folders I created in my IMAP mailbox were all prefixed with "INBOX.". So, if I created the folder "scans" it's actual name was "INBOX.scans".
If you are using an unknown folder name with Imbox (the module used by this library for IMAP) it throws this error message. By setting my parameter --imap-folder
correctly, with the proper prefix, everything worked like a charm.
I figured out the prefix used by my provider simply by printing all of the folders found by Imbox like this:
from imbox import Imbox
import ssl
mail = Imbox("example.com",
username="mail@example.com",
password="123456",
port=993,
ssl=True,
ssl_context=ssl.create_default_context(),
starttls=False)
print(mail.folders())
There is an open issue at Imbox that suggests to compare the supplied folder name with the folders returned by the inbox in order to print a more accurate error message: https://github.com/martinrusev/imbox/issues/38
Not a difficult thing to do but I haven't gotten around to making a pull request to fix it in either repository.
Thanks for your feedback @thaasoph
1.2.4 includes better logging that will log out the folder names as they apear in Imbox - https://github.com/jamesridgway/attachment-downloader/blob/master/bin/attachment-downloader#L183
As this doesn't appear to be an actual bug as such I'll close this issue
Gmail seems to be erroring when we define an imap folder that does not exist. Maybe check if the folder exists and return a clearer error?
Sample command:
Thanks,
C.