Author: jleroux
Date: Sun Sep 18 07:53:49 2011
New Revision: 1172213
URL:
http://svn.apache.org/viewvc?rev=1172213&view=revLog:
A patch from Varun Bhansaly "Issue receiving emails with attachment"
https://issues.apache.org/jira/browse/OFBIZ-4413Some Background : In our customization we have configured MCA to process incoming emails which is basically a custom service this service in turn calls service storeIncomingEmail, and rest of the custom code follows.
Now though we are able to receive emails (which can be seen in the communications in party manager), we have noticed that system does not some process the attachments and creates the link between communication event and content.
Analysis shows, MimeMessageWrapper.getAttachmentIndexes() while checking for content disposition, does a case sensitive comparison, which should rather be case insensitive.
This small change fixes the issue.
Modified:
ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/MimeMessageWrapper.java
Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/MimeMessageWrapper.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/MimeMessageWrapper.java?rev=1172213&r1=1172212&r2=1172213&view=diff==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/MimeMessageWrapper.java (original)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/MimeMessageWrapper.java Sun Sep 18 07:53:49 2011
@@ -255,14 +255,14 @@ public class MimeMessageWrapper implemen
if (subPartCount > 0) {
for (int si = 0; si < subPartCount; si++) {
String sidx = idx + "." + Integer.toString(si);
- if (getPartDisposition(sidx) != null && (getPartDisposition(sidx).equals(Part.ATTACHMENT) ||
- getPartDisposition(sidx).equals(Part.INLINE))) {
+ if (getPartDisposition(sidx) != null && (getPartDisposition(sidx).equalsIgnoreCase(Part.ATTACHMENT) ||
+ getPartDisposition(sidx).equalsIgnoreCase(Part.INLINE))) {
attachments.add(sidx);
}
}
} else {
- if (getPartDisposition(idx) != null && (getPartDisposition(idx).equals(Part.ATTACHMENT) ||
- getPartDisposition(idx).equals(Part.INLINE))) {
+ if (getPartDisposition(idx) != null && (getPartDisposition(idx).equalsIgnoreCase(Part.ATTACHMENT) ||
+ getPartDisposition(idx).equalsIgnoreCase(Part.INLINE))) {
attachments.add(idx);
}
}