Related discussion in https://github.com/duesee/imap-codec/pull/695#event-22957189376. It probably makes sense to add some general tests first, see https://github.com/duesee/imap-codec/issues/632.