Problem deleting emails in gmail using imaplib

后端 未结 4 581
渐次进展
渐次进展 2021-01-05 16:23

I try to remove message from inbox folder and all alright, but when i switched to All Mail folder the removing does not work. expunge() method returns (\'

4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-05 16:34

    With Gmail advanced IMAP controls you can set what happens to messages when you delete them over IMAP.

    Just enable "Advanced IMAP Controls" in Gmail Labs. The settings page will look like this:

    settings

    Then when you mark a message as deleted and expunge as per this answer it will be moved to the bin, permanently deleted, or archived to "All Mail" depending on what setting you selected.

提交回复
热议问题