IMAP获取所选文件夹的UID列表 [英] IMAP getting UID List of selected folder

查看:446
本文介绍了IMAP获取所选文件夹的UID列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从所选文件夹中检索IMAP UID列表?我想获取邮件UID的列表,所以我传递了1150 UID FETCH FLAGS (\Seen \Flagged),但是我无法检索该列表:它给了我类似BAD Command的错误.那么如何从所选文件夹中检索UID列表?

How can I retrieve the list of IMAP UIDs from the selected folder? I want to get the list of mail UIDs, so I am passing the 1150 UID FETCH FLAGS (\Seen \Flagged), but I am not able to retrieve the list: it gives me an error like BAD Command. So how I can retrieve the list of UID from the selected folder?

推荐答案

列出当前所选文件夹中所有UID的最简单(也是最紧凑)的方法是通过UID SEARCH ALL:

The easiest (and most compact) way to list all the UIDs in the currently-selected folder is via UID SEARCH ALL:

A001 UID SEARCH ALL
* SEARCH 288 291 292 293 295 323 324 325 326 327 385 387 472 474 641 720 748
A001 OK UID SEARCH completed

UID FETCH请求中的错误是遗漏了序列集,并包括了标志列表.如果您将其改写为

The errors in your UID FETCH request were leaving out the sequence-set and including a list of flags. If you rewrote it as

A002 UID FETCH 1:* (UID)

A002 UID FETCH 1:* (UID FLAGS)

它会工作.

这篇关于IMAP获取所选文件夹的UID列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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