The BODYSTRUCTURE response for a message/global attachment is different in IMAP4rev1 and IMAP4rev2.
In rev2, message/global is treated like message/rfc822. The BODYSTRUCTURE response includes the envelope, bodystructure, and number of lines of the embedded message. But rev1 treats message/global as an opaque attachment and does not include those items.
The imapclient package assumes that a message/global BODYSTRUCTURE response will include those items, and fails to parse the response from a rev1 server (or from Dovecot, which mostly follows rev2, but doesn't in this case).
The BODYSTRUCTURE response for a message/global attachment is different in IMAP4rev1 and IMAP4rev2.
In rev2, message/global is treated like message/rfc822. The BODYSTRUCTURE response includes the envelope, bodystructure, and number of lines of the embedded message. But rev1 treats message/global as an opaque attachment and does not include those items.
The imapclient package assumes that a message/global BODYSTRUCTURE response will include those items, and fails to parse the response from a rev1 server (or from Dovecot, which mostly follows rev2, but doesn't in this case).