public
Created

  • Download Gist
gistfile1.diff
Diff
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
diff --git a/mail/src/main/java/javax/mail/internet/MimeMultipart.java b/mail/src/main/java/javax/mail/internet/MimeMultipart.java
index 58537ef..0278d12 100644
--- a/mail/src/main/java/javax/mail/internet/MimeMultipart.java
+++ b/mail/src/main/java/javax/mail/internet/MimeMultipart.java
@@ -468,6 +468,10 @@ public class MimeMultipart extends Multipart {
los.writeln(boundary + "--");
}
+ private boolean getWithSystemDefault(Properties props, String name, boolean df) {
+ return PropUtil.getBooleanProperty(props, name, PropUtil.getBooleanSystemProperty(name, df));
+ }
+
/**
* Parse the InputStream from our DataSource, constructing the
* appropriate MimeBodyParts. The <code>parsed</code> flag is
@@ -482,22 +486,22 @@ public class MimeMultipart extends Multipart {
return;
// read properties that control parsing
+
+ Properties props = new MessageContext(this.parent).getSession().getProperties();
// default to true
- ignoreMissingEndBoundary = PropUtil.getBooleanSystemProperty(
- "mail.mime.multipart.ignoremissingendboundary", true);
+ ignoreMissingEndBoundary = getWithSystemDefault(props,
+ "mail.mime.multipart.ignoremissingendboundary", true);
// default to true
- ignoreMissingBoundaryParameter = PropUtil.getBooleanSystemProperty(
+ ignoreMissingBoundaryParameter = getWithSystemDefault(props,
"mail.mime.multipart.ignoremissingboundaryparameter", true);
// default to false
- ignoreExistingBoundaryParameter = PropUtil.getBooleanSystemProperty(
+ ignoreExistingBoundaryParameter = getWithSystemDefault(props,
"mail.mime.multipart.ignoreexistingboundaryparameter", false);
// default to false
- allowEmpty = PropUtil.getBooleanSystemProperty(
- "mail.mime.multipart.allowempty", false);
+ allowEmpty = getWithSystemDefault(props, "mail.mime.multipart.allowempty", false);
// default to true
- bmparse = PropUtil.getBooleanSystemProperty(
- "mail.mime.multipart.bmparse", true);
+ bmparse = getWithSystemDefault(props, "mail.mime.multipart.bmparse", true);
if (bmparse) {
parsebm();

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.