emersion / go-imap

📥 An IMAP library for clients and servers
MIT License
2.06k stars 290 forks source link

Aliyun mail uses UidSearch() or Search() method reporting "invalid command or parameters" #638

Closed xuecangqiuye closed 1 week ago

xuecangqiuye commented 2 weeks ago

I'm using v2 version. I saw the same problem at #412, but it seems that it doesn't have a solution for this problem. Can you tell that if this problem is caused by Aliyun mail server or by my mistaken usage?

image

emersion commented 2 weeks ago

Can you obtain debug logs?

xuecangqiuye commented 1 week ago

Thanks for your reply! Sorry for taking so long, here is the log

* OK AliYun IMAP Server Ready
T2 CAPABILITY
T1 OK LOGIN completed
T3 CAPABILITY
T4 SELECT INBOX
* CAPABILITY IMAP4rev1 IDLE XLIST UIDPLUS ID SASL-IR AUTH=XOAUTH AUTH=XOAUTH2 AUTH=EXTERNAL
T2 OK CAPABILITY completed
* CAPABILITY IMAP4rev1 IDLE XLIST UIDPLUS ID SASL-IR AUTH=XOAUTH AUTH=XOAUTH2 AUTH=EXTERNAL
T3 OK CAPABILITY completed
* 33 EXISTS
* 0 RECENT
* OK [UNSEEN 32]
* OK [UIDNEXT 75] Predicted next UID.
* OK [UIDVALIDITY 2] UIDs valid.
* FLAGS (\Answered \Seen \Deleted \Draft \Flagged)
* OK [PERMANENTFLAGS (\Answered \Seen \Deleted \Draft \Flagged)] Limited.
T4 OK [READ-WRITE] SELECT completed
T5 UID SEARCH (SUBJECT "test134")
T5 BAD invalid command or parameters
emersion commented 1 week ago

Hm. That command looks correct to me. I'm not sure why the server refuses it.

xuecangqiuye commented 1 week ago

Hm. That command looks correct to me. I'm not sure why the server refuses it.

So it may be a server problem. Thanks a lot!