Skip to content

Commit

Permalink
imapclient: fix FetchItems to end encoded list
Browse files Browse the repository at this point in the history
#517 uses the new `enc.BeginList()` to encode fetch options over the IMAP protocol, but never calls `.End()` so the closing `)` character is never written out, causing errors like `T6 BAD Could not parse command`.
  • Loading branch information
adregner authored and emersion committed Jul 2, 2023
1 parent 47d6339 commit a363466
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions imapclient/fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ func writeFetchItems(enc *imapwire.Encoder, uid bool, options *imap.FetchOptions
for _, bss := range options.BinarySectionSize {
writeFetchItemBinarySectionSize(listEnc.Item(), bss)
}

listEnc.End()
}

func writeFetchItemBodySection(enc *imapwire.Encoder, item *imap.FetchItemBodySection) {
Expand Down

0 comments on commit a363466

Please sign in to comment.