从Gmail中删除邮件“所有邮件";通过IMAP文件夹 [英] Delete message from Gmail "All Mail" folder via IMAP

查看:195
本文介绍了从Gmail中删除邮件“所有邮件";通过IMAP文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 RFC 3501 通过imap访问Gmail All Mail文件夹.我需要从文件夹中删除一条消息(移至垃圾箱或永久删除).以下命令似乎不起作用:

I am accessing Gmail All Mail folder via imap, using RFC 3501. I need to delete a message (Move to Trash or Permanently delete) from the folder. The following commands do not seem to work:

UID STORE 123 +FLAGS (\Deleted)
EXPUNGE

我可以使用 X-GM-LABELS ,但是没有添加垃圾箱"标签的选项.

I can modify labels using X-GM-LABELS, but there is no option to add a "Trash" label.

RFC 3501没有"MOVE"命令,因此我需要将邮件复制到垃圾箱"文件夹,然后将其从父文件夹中删除.出路是什么??

The RFC 3501, does not have a "MOVE" command, so I need to copy the message to "Trash" folder and then remove it from the parent folder. What's the way out??

谢谢.

找到部分答案.

要将废纸rash"设置为标签,我们需要使用"\\ Trash"作为标签.这是将邮件移至垃圾箱的命令(删除收件箱标签并添加垃圾箱标签).

To set Trash as a label, we need to use "\\Trash" as the label. Here are the commands to move the message to trash (delete inbox label and add trash label).

UID STORE 123 -X-GM-LABELS (\\Inbox)
UID STORE 123 +X-GM-LABELS (\\Trash)

现在,我被困在如何永久删除消息上.

Now, I am stuck on how to delete the message permanently.

推荐答案

这些命令将永久删除消息:

These commands delete the message permanently:

// sequence number 123, 234 are the same message in different folders
SELECT "[Gmail]/AllMail"
COPY 123 "[Gmail]/Trash"
CLOSE

SELECT "[Gmail]/Trash"
STORE 234 +FLAGS (\Deleted)
EXPUNGE

只需尝试一下就可以了.

Just tried it out and it works.

这篇关于从Gmail中删除邮件“所有邮件";通过IMAP文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆