emersion / go-imap

📥 An IMAP library for clients and servers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

in response: imapwire: expected CRLF, got " "

k773 opened this issue · comments

commented

Code to reproduce:

func TestOutlook(t *testing.T) {
	client, e := imapclient.DialTLS("outlook.office365.com:993", &imapclient.Options{DebugWriter: os.Stderr})
	if e != nil {
		panic(e)
	}
	if e = client.Login(username, password).Wait(); e != nil {
		panic(e)
	}
	if _, e = client.Select("INBOX", nil).Wait(); e != nil {
		panic(e)
	}
	if _, e = client.Status("INBOX", &imap.StatusOptions{NumMessages: true}).Wait(); e != nil {
		panic(e)  // <- panics here
	}
}

This code produces the following error:

panic: in response: imapwire: expected CRLF, got " " [recovered]
	panic: in response: imapwire: expected CRLF, got " "

From the debug output I can see that there is a space symbol after the ')' (second line), which go-imap does not expect:

T5 STATUS INBOX (MESSAGES)
* STATUS Inbox (MESSAGES 1) 
T5 OK STATUS completed.

Does #541 help?

commented

Yes, it does. Thank you.