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

 ̄綄美尐妖づ 提交于 2020-01-02 06:23:06

问题


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?


回答1:


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.




回答2:


This:

https://github.com/goerz/gmail_archive.py/blob/master/libgmail/lgconstants.py

Seems to indicate that it's all.



来源:https://stackoverflow.com/questions/10570889/imaplib-what-is-the-correct-folder-name-for-archive-all-mail-in-gmail

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!