You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However there is no rule which specifies the order between UID and other data(RFC822 or RFC822.HEADER).
For example, if client send 123 UID FETCH 10 (RFC822)\r\n command, imap server can send following responses.
(123 is tag, 10 is uid)
RFC822 data after UID data
* 3 FETCH (UID 10 RFC822 {6}\r\n
3 is message sequence number
abcd\r\n
)\r\n
123 OK Fetch completed.\r\n
UID data after RFC822 data
* 3 FETCH (RFC822 {6}\r\n
3 is message sequence number
abcd\r\n
UID 10)\r\n
123 OK Fetch completed.\r\n
The second case cannot be covered by the current mailio:imap::fetch function logic because it gets out of for loop(checking if requested tokens exist or not) when it met RFC822 token.
So even though it gets UID data after receiving literal response, it can't parse UID data.
This case actually happens often.
So... i recommend to parse response after receiving all responses is completed(until parenthesis_list_counter_ becomes 0).
The text was updated successfully, but these errors were encountered:
For the test purposes, I am using Dovecot, Gmail, Outlook, Zoho, Yahoo, Vkontakte servers. So far, I did not see such case, but I will take a more detailed look with UIDs.
Thank you for replying!
Naver(the parent company of LINE) mail service is the most famous in Korea, and it gives UID FETCH response like following example.
$ openssl s_client -connect imap.naver.com:993 -quiet
... # login, select
3 UID FETCH 38 (RFC822) # request UID FETCH command# receive data* 1 FETCH (RFC822 {1998} # untagged response
... # mime data
UID 38) # receive UID data after RFC822 data
3 OK Fetch completed. # tagged response
i searched rfc document but i cannot find that UID should come before RFC822.
I have used mailio::imap after fixing it, it works well whether UID comes before RFC822 or not.
(I tested in more than 10 imap servers including Gmail, Outlook, Naver and minor imap server)
If you don't have time, I can help.
As you know, if imap client send
UID FETCH
command, then imap server must sendUID
data in the response.https://www.rfc-editor.org/rfc/rfc3501#section-6.4.8
However there is no rule which specifies the order between
UID
and other data(RFC822
orRFC822.HEADER
).For example, if client send
123 UID FETCH 10 (RFC822)\r\n
command, imap server can send following responses.(
123
is tag,10
is uid)RFC822
data afterUID
data* 3 FETCH (UID 10 RFC822 {6}\r\n
3
is message sequence numberabcd\r\n
)\r\n
123 OK Fetch completed.\r\n
UID
data afterRFC822
data* 3 FETCH (RFC822 {6}\r\n
3
is message sequence numberabcd\r\n
UID 10)\r\n
123 OK Fetch completed.\r\n
The second case cannot be covered by the current mailio:imap::fetch function logic because it gets out of
for loop
(checking if requested tokens exist or not) when it metRFC822
token.So even though it gets
UID
data after receiving literal response, it can't parseUID
data.This case actually happens often.
So... i recommend to parse response after receiving all responses is completed(until
parenthesis_list_counter_
becomes 0).The text was updated successfully, but these errors were encountered: