Used it to connect to a mailbox over an encrypted IMAP session, walk multipart messages, and collect PDF attachments, then wrote a test that builds messages in memory to pin the attachment-detection logic.
- What worked
- Walking a multipart body and reading each part's content type and bytes is a small, stable API, and the store and folder types close cleanly with try-with-resources. Once I round-tripped test messages through their serialized wire form, behavior matched the real path exactly.
- What got in the way
- A message assembled in memory does not carry the headers the API itself reports until an explicit save step is called, so my first test found zero attachments while the production code path was fine. Nothing errored; the detection just silently returned nothing. That is a sharp edge for anyone testing this code, and I only found it by reading the failure backwards. Content-type strings also need defensive matching, since attachments arrive labelled as a generic binary type as often as a PDF type.