是否使用Indy检索Gmail标签? [英] Retrieve Gmail Labels with Indy?

查看:108
本文介绍了是否使用Indy检索Gmail标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据此线程(以及源代码中的各种提示,如变量名),Indy支持获取gmail标签,但不设置或删除它们.但是,到目前为止,此功能似乎尚未记录.谁能帮我填写有关如何使用Imap检索Gmail标签的详细信息?

According to this thread (and various hints in the source code like variable names) Indy supports fetching gmail labels but not setting or removing them. However, as of yet, this functionality appears to be undocumented. Can anyone help me with filling in the details about how to retrieve Gmail labels with Imap?

我应该调用哪个函数来检索标签并让Indy为我解析结果?尽管我当然可以手动调用SendCmd()来请求标签("C2 UID FETCH 92(X-GM-LABELS)"),类似于我手动设置/删除标签(Indy尚未这样做)的方式,我知道FETCH结果已经内置在Indy中,所以我不想在这里重新发明轮子来解码FETCH结果.现在,为简单起见,假设我 just 只需要标签,而不需要其他信封/标题/消息部分.

Which function(s) should I call to retrieve the labels and have Indy parse out the results for me? Although I could certainly manually call SendCmd() to request the labels ('C2 UID FETCH 92 (X-GM-LABELS)') similar to how I'm manually setting/removing labels (which Indy doesn't yet do), parsing FETCH results is something that I know is already built into Indy, so I don't want to re-invent the wheel here to decode the FETCH results. For now, to keep things simple, presume I just want the labels and not other envelopes/headers/message parts.

似乎确实有很多功能可能相关(或可能不相关),但有很多可供选择的功能,其中许多功能只有自动生成的文档,才能确定要尝试的功能,以及查找实际标签的属性(或子属性)或函数有点令人生畏.有人可以在这里向我指出正确的方向吗?

There do appear to be quite a few functions that might (or might not) be relevant, but with so many to choose from, and so many of them only having auto-generated documentation, figuring out which one to try, and which property (or sub-property) or function to find the actual labels is a little daunting. Can anyone point me in the right direction here?

推荐答案

Indy支持获取gmail标签,但不设置或删除它们.

Indy supports fetching gmail labels but not setting or removing them.

不完全是. TIdIMAP4支持按Gmail标签搜索电子邮件,但尚不支持为特定电子邮件检索Gmail标签.

Not quite. TIdIMAP4 supports searching for emails by Gmail label, but does not yet support retrieving Gmail labels for specific emails.

但是,到目前为止,此功能似乎尚未记录.

However, as of yet, this functionality appears to be undocumented.

过去几年中Indy新增的许多功能仍未记录.

A lot of functionality added to Indy in the past several years is still undocumented.

有人可以帮我填写有关如何使用Imap检索Gmail标签的详细信息吗?

Can anyone help me with filling in the details about how to retrieve Gmail labels with Imap?

已将某些GMail IMAP扩展添加到TIdIMAP4

TIdIMAP4SearchKey枚举已更新,新增了项,以支持SearchMailBox发出的SEARCH命令中的X-GM-RAW,X-GM-MSGID,X-GM-THRID和X-GM-LABELS扩展 ()和UIDSearchMailBox()方法.

TIdIMAP4FetchDataItem枚举已更新为新项,以支持FETCH命令中的X-GM-MSGID,X-GM-THRID和X-GM-LABELS扩展,但是当前没有TIdIMAP方法使用这些新项项.

The TIdIMAP4FetchDataItem enum has been updated with new items to support the X-GM-MSGID, X-GM-THRID, and X-GM-LABELS extensions in the FETCH command, however no TIdIMAP methods currently use these new items yet.

尚未实现STORE命令中对X-GM-LABELS扩展的支持.

我应该调用哪个函数来检索标签并让Indy为我解析结果?

Which function(s) should I call to retrieve the labels and have Indy parse out the results for me?

目前唯一支持GMail标签的方法是TIdIMAP4.SearchMailBox()TIdIMAP4.UIDSearchMailBox().

The only methods that support GMail labels at this time are TIdIMAP4.SearchMailBox() and TIdIMAP4.UIDSearchMailBox().

尽管我当然可以手动调用SendCmd()来请求标签('C2 UID FETCH 92(X-GM-LABELS)'),类似于我手动设置/删除标签的方式(Indy尚未这样做) ),解析FETCH结果是Indy已内置的功能,因此,我不想在这里重新发明轮子来解码FETCH结果.

Although I could certainly manually call SendCmd() to request the labels ('C2 UID FETCH 92 (X-GM-LABELS)') similar to how I'm manually setting/removing labels (which Indy doesn't yet do), parsing FETCH results is something that I know is already built into Indy, so I don't want to re-invent the wheel here to decode the FETCH results.

对不起,但是您必须这样做.尽管TIdIMAP4确实解析了FETCH响应中的标志,但它会丢弃TIdMessageFlagsSet不支持的任何标志(已回答,已标记,已删除,草稿,已看到,最近).因此,尽管可以自动解析Gmail标签,但TIdIMAP4尚无保存位置.

Sorry, but you will have to. Although TIdIMAP4 does parse flags in FETCH responses, it discards any flag that is not supported by TIdMessageFlagsSet (Answered, Flagged, Deleted, Draft, Seen, Recent). So while Gmail labels can be parsed automatically, TIdIMAP4 has nowhere to save them yet.

有人可以在这里向我指出正确的方向吗?

Can anyone point me in the right direction here?

这时,您必须手动实施它.

At this time, you have to implement it manually.

这篇关于是否使用Indy检索Gmail标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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