Seam 2.2.0.GA Mail MIME Attachment IS NOT TO SPEC
nathandennis Sep 6, 2011 11:29 PMI have multiple Enterprise Systems deployed.. all using Seam 2.2.0.GA on Jboss AS..
All have worked flawlessly sending PDF's in emails for a long time. (some of the code is years old now)
type
Thunderbird clients can no longer view these messages because Seams is setting the content type MIME to related. And while this is correct for inline objects, boys we got a serious problem with PDF's. Should be set to mixed to handle non graphics objects not displayed inline.
And believe me,, i dont want to touch anything in my well oiled machine,,, talked to those nuts over at mozilla about them screwing up backwards compatibility... they pretty much send me a list of things not to do on their forum... number 1 of course being not to disagree with any of their decisions. so the truth of it is,,, ive got a problem with archived emails incorrectly formatted. and ive got an even bigger problem with seams continuing to generate emails that those who chose to adhere to the spec, wont read.
should i even bother to file a bug report? would this be fixed in this version if i did?
the offending bit of code is in UIBody.java
System.out.println("related"); MimeMultipart bodyRootMultipart = new MimeMultipart("related"); //MimeMultipart bodyRootMultipart = new MimeMultipart("mixed"); bodyRootMultipart.addBodyPart(bodyPart, 0); for (MimeBodyPart attachment: findMessage().getAttachments()) { bodyRootMultipart.addBodyPart(attachment); } bodyPart = new MimeBodyPart(); bodyPart.setContent(bodyRootMultipart);
simply switching it to mixed makes these PDF's show up again.. and breaks all the inline images. (image will be attached at the bottom,, which in a formatted email blast goes over about like a fart in a diving helmet)
i tried to just capture the type of attachment and adjust the MIME type for the PDF's.. pretty sure that is how this should work, but im not familiar enough with the workings and structure of messages to succeed on my own.
Please help if you can, because this whole situation is spiraling from bad to really sucks in a hurry.