Skip to content

Commit

Permalink
Allow continuous SP between CAPABILITY items
Browse files Browse the repository at this point in the history
Before logged in, imap-n.global-mail.cn sends:

    * CAPABILITY IMAP4<...>LITERAL+<SP><SP>STARTTLS<...>SPECIAL-USE
  • Loading branch information
qjebbs authored and emersion committed Nov 22, 2024
1 parent 5a974f9 commit 9c5b158
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions imapclient/capability.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ func (cmd *CapabilityCommand) Wait() (imap.CapSet, error) {
func readCapabilities(dec *imapwire.Decoder) (imap.CapSet, error) {
caps := make(imap.CapSet)
for dec.SP() {
// Some IMAP servers send multiple SP between caps:
// https://github.com/emersion/go-imap/pull/652
for dec.SP() {
}

var name string
if !dec.ExpectAtom(&name) {
return caps, fmt.Errorf("in capability-data: %v", dec.Err())
Expand Down

0 comments on commit 9c5b158

Please sign in to comment.