Gmail IMAP按UID范围搜索似乎跳过了第一条消息

Gmail IMAP按UID范围搜索似乎跳过了第一条消息,gmail,imap,gmail-imap,Gmail,Imap,Gmail Imap,我在gmail上有一个邮箱,如果我搜索“全部”,它有以下UID [ 2, 5, 6, 51 ] 奇怪的是,如果我搜索“3:*”,我只能得到[6,51] ==> A6 UID SEARCH 3:* <== '* SEARCH 6 51\r\nA6 OK SEARCH completed (Success)\r\n' [parsing incoming] saw untagged SEARCH <== 'A6 OK SEARCH completed (Success)\r\n'

我在gmail上有一个邮箱,如果我搜索“全部”,它有以下UID

[ 2, 5, 6, 51 ]
奇怪的是,如果我搜索“3:*”,我只能得到[6,51]

==> A6 UID SEARCH 3:*
<== '* SEARCH 6 51\r\nA6 OK SEARCH completed (Success)\r\n'
[parsing incoming] saw untagged SEARCH
<== 'A6 OK SEARCH completed (Success)\r\n'
==>A6 UID搜索3:*

您需要
UID搜索UID 3::
。您正在按消息序列号进行搜索。1 -> 2, 2 -> 5, 3 -> 6, 4 -> 51. 因此,您正在搜索邮件3和4,其中包含UID6和51。

谢谢,让我困惑的是,在范围之前需要额外的
UID