Skip to content

Commit a363466

Browse files
adregneremersion
authored andcommitted
imapclient: fix FetchItems to end encoded list
#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`.
1 parent 47d6339 commit a363466

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

imapclient/fetch.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ func writeFetchItems(enc *imapwire.Encoder, uid bool, options *imap.FetchOptions
7474
for _, bss := range options.BinarySectionSize {
7575
writeFetchItemBinarySectionSize(listEnc.Item(), bss)
7676
}
77+
78+
listEnc.End()
7779
}
7880

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

0 commit comments

Comments
 (0)