Skip to content

@pjstadig /gist:3077895
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.