简体   繁体   中英

imaplib - What is the correct folder name for Archive/All Mail in Gmail?

I have a script which exports all the email in Gmail as text files.

It works fine with this line where you select the folder:

mail.select("inbox")

But I am not sure what the name is for Gmail's archive, where all of the email is stored. I've tried archive and all mail and stuff, but no luck.

Anyone know the correct name?

Solved it.

It is [Gmail]/All Mail or, if you are a Gmail UK user like me, it may be [Google Mail]/All Mail , because Gmail used to be called Google Mail in the UK due to trademark issues.

If you're doing this for general use, I'd recommend testing to see if [Gmail]/All Mail works (most common), and if not testing for [Google Mail]/All Mail .

The last one works perfectly for me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM