You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Order of attachments is lost when converting a MimeMessage to an Email #497
I'm writing a script that monitors an IMAP box, and clones bounce messages, adjusting the recipients so that they reach our customers' corresponding Administrators. I'm using simple-java-mail to convert an IMAPMessage/MimeMessage into an Email, which we can then feed into our existing mail subsystem. I've noticed that the order of attachments gets lost during this conversion. Bounce messages follow a specific standard, and the order of these attachments matters.
I traced it down to org.simplejavamail.converter.internal.mimemessage.ParsedMimeMessageComponents.attachmentList being a SortedSet. This effectively orders the attachments by their name. Is there a reason this isn't simply an ArrayList?
Hmm, I'm not sure, but the decision was made in the early days of this project, presumably due to testing challenges where the attachments were out of order otherwise. However, I replaced it LinkedHashSet and everything tested fine still. Would that would for you?
Activity
bbottema commentedon Mar 14, 2024
Hmm, I'm not sure, but the decision was made in the early days of this project, presumably due to testing challenges where the attachments were out of order otherwise. However, I replaced it LinkedHashSet and everything tested fine still. Would that would for you?
brian-tsb commentedon Mar 14, 2024
#497: Order of attachments is lost when converting a MimeMessage to a…
bbottema commentedon Mar 20, 2024
Released in 8.7.1, can you please verify?
brian-tsb commentedon Mar 20, 2024
#497: Order of attachments is lost when converting a MimeMessage to a…