session.getDebug(), session.getDebugOut()); traceLogger = logger.getSubLogger("protocol", null); noauthdebug = !PropUtil.getBooleanProperty(props, "mail.debug.auth", false); debugusername = PropUtil.getBooleanProperty(props, "mail.debug.auth.username", true); debugpassword = PropUtil.getBooleanProperty(props, "mail.debug.auth.password", false); if (urlname != null) this.name = name; if (!isSSL) isSSL = PropUtil.getBooleanProperty(props, "mail." + name + ".ssl.enable", false); if (isSSL) quitWait = PropUtil.getBooleanProperty(props, "mail." + name + ".quitwait", true); reportSuccess = PropUtil.getBooleanProperty(props, "mail." + name + ".reportsuccess", false); useStartTLS = PropUtil.getBooleanProperty(props, "mail." + name + ".starttls.enable", false); requireStartTLS = PropUtil.getBooleanProperty(props, "mail." + name + ".starttls.required", false); useRset = PropUtil.getBooleanProperty(props,
/** * Create a BASE64 decoder that decodes the specified input stream. * The System property <code>mail.mime.base64.ignoreerrors</code> * controls whether errors in the encoded data cause an exception * or are ignored. The default is false (errors cause exception). * * @param in the input stream */ public BASE64DecoderStream(InputStream in) { super(in); // default to false ignoreErrors = PropUtil.getBooleanSystemProperty( "mail.mime.base64.ignoreerrors", false); }
/** * Get a boolean valued property. * * @param props the properties * @param name the property name * @param def default value if property not found * @return the property value */ public static boolean getBooleanProperty(Properties props, String name, boolean def) { return getBoolean(getProp(props, name), def); }
/** * Get an integer valued property. * * @param props the properties * @param name the property name * @param def default value if property not found * @return the property value */ public static int getIntProperty(Properties props, String name, int def) { return getInt(getProp(props, name), def); }
/** * Set the strict flag based on property. */ private void initStrict() { if (session != null) { Properties props = session.getProperties(); strict = PropUtil.getBooleanProperty(props, "mail.mime.address.strict", true); allowutf8 = PropUtil.getBooleanProperty(props, "mail.mime.allowutf8", false); } }
int level = PropUtil.getIntProperty(props, prefix + ".compress.level", Deflater.DEFAULT_COMPRESSION); int strategy = PropUtil.getIntProperty(props, prefix + ".compress.strategy", Deflater.DEFAULT_STRATEGY);
/** * Get an integer valued property. * * @param props the properties * @param name the property name * @param def default value if property not found * @return the property value */ public static int getIntProperty(Properties props, String name, int def) { return getInt(getProp(props, name), def); }
/** * If a SELECT succeeds, but indicates that the folder is * READ-ONLY, and the user asked to open the folder READ_WRITE, * do we allow the open to succeed? */ boolean allowReadOnlySelect() { return PropUtil.getBooleanProperty(session.getProperties(), "mail." + name + ".allowreadonlyselect", false); }
@Override String getInitialResponse(String host, String authzid, String user, String passwd) throws MessagingException, IOException { ntlm = new Ntlm(getNTLMDomain(), getLocalHost(), user, passwd, logger); flags = PropUtil.getIntProperty( session.getProperties(), "mail." + name + ".auth.ntlm.flags", 0); String type1 = ntlm.generateType1Msg(flags); return type1; }
/** * Get a boolean valued property. * * @param props the properties * @param name the property name * @param def default value if property not found * @return the property value */ public static boolean getBooleanProperty(Properties props, String name, boolean def) { return getBoolean(getProp(props, name), def); }
/** * Get an integer valued property. * * @param session the Session * @param name the property name * @param def default value if property not found * @return the property value */ public static int getIntSessionProperty(Session session, String name, int def) { return getInt(getProp(session.getProperties(), name), def); }
Properties props = session.getProperties(); boolean debug = PropUtil.getBooleanProperty(props, "mail." + name + ".connectionpool.debug", false); logger = plogger.getSubLogger("connectionpool", int size = PropUtil.getIntProperty(props, "mail." + name + ".connectionpoolsize", -1); if (size > 0) { int connectionPoolTimeout = PropUtil.getIntProperty(props, "mail." + name + ".connectionpooltimeout", -1); if (connectionPoolTimeout > 0) { int serverTimeout = PropUtil.getIntProperty(props, "mail." + name + ".servertimeout", -1); if (serverTimeout > 0) { int pruning = PropUtil.getIntProperty(props, "mail." + name + ".pruninginterval", -1); if (pruning > 0) { PropUtil.getBooleanProperty(props, "mail." + name + ".separatestoreconnection", false); if (separateStoreConnection)
/** * Compute the tag prefix to be used for this connection. * Start with "A" - "Z", then "AA" - "ZZ", and finally "AAA" - "ZZZ". * Wrap around after that. */ private String computePrefix(Properties props, String prefix) { // XXX - in case someone depends on the tag prefix if (PropUtil.getBooleanProperty(props, prefix + ".reusetagprefix", false)) return "A"; // tag prefix, wrap around after three letters int n = tagNum.getAndIncrement() % (26*26*26 + 26*26 + 26); String tagPrefix; if (n < 26) tagPrefix = new String(new char[] { (char)('A' + n) }); else if (n < (26*26 + 26)) { n -= 26; tagPrefix = new String(new char[] { (char)('A' + n/26), (char)('A' + n%26) }); } else { n -= (26*26 + 26); tagPrefix = new String(new char[] { (char)('A' + n/(26*26)), (char)('A' + (n%(26*26))/26), (char)('A' + n%26) }); } return tagPrefix; }
/** * Create a BASE64 decoder that decodes the specified input stream. * The System property <code>mail.mime.base64.ignoreerrors</code> * controls whether errors in the encoded data cause an exception * or are ignored. The default is false (errors cause exception). * * @param in the input stream */ public BASE64DecoderStream(InputStream in) { super(in); // default to false ignoreErrors = PropUtil.getBooleanSystemProperty( "mail.mime.base64.ignoreerrors", false); }
String getInitialResponse(String host, String authzid, String user, String passwd) throws MessagingException, IOException { ntlm = new Ntlm(getNTLMDomain(), getLocalHost(), user, passwd, logger); flags = PropUtil.getIntProperty( session.getProperties(), "mail." + name + ".auth.ntlm.flags", 0); String type1 = ntlm.generateType1Msg(flags); return type1; }
/** * Get a boolean valued property. * * @param session the Session * @param name the property name * @param def default value if property not found * @return the property value */ public static boolean getBooleanSessionProperty(Session session, String name, boolean def) { return getBoolean(getProp(session.getProperties(), name), def); }
/** * Get an integer valued property. * * @param session the Session * @param name the property name * @param def default value if property not found * @return the property value */ @Deprecated public static int getIntSessionProperty(Session session, String name, int def) { return getInt(getProp(session.getProperties(), name), def); }
if (props == null) props = new Properties(); // empty int cto = PropUtil.getIntProperty(props, prefix + ".connectiontimeout", -1); Socket socket = null; if (localaddrstr != null) localaddr = InetAddress.getByName(localaddrstr); int localport = PropUtil.getIntProperty(props, prefix + ".localport", 0); boolean fb = PropUtil.getBooleanProperty(props, prefix + ".socketFactory.fallback", true); int to = PropUtil.getIntProperty(props, prefix + ".timeout", -1); try { sfPort = PropUtil.getIntProperty(props, prefix + sfPortName, -1);
private void initStreams() throws IOException { boolean quote = PropUtil.getBooleanProperty(props, "mail.debug.quote", false); traceInput = new TraceInputStream(socket.getInputStream(), traceLogger); traceInput.setQuote(quote); traceOutput = new TraceOutputStream(socket.getOutputStream(), traceLogger); traceOutput.setQuote(quote); // should be US-ASCII, but not all JDK's support it so use iso-8859-1 input = new BufferedReader(new InputStreamReader(traceInput, "iso-8859-1")); output = new PrintWriter( new BufferedWriter( new OutputStreamWriter(traceOutput, "iso-8859-1"))); }
/** * Initialize flags that control parsing behavior, * based on System properties described above in * the class documentation. * * @since JavaMail 1.5 */ protected void initializeProperties() { // read properties that control parsing // default to true ignoreMissingEndBoundary = PropUtil.getBooleanSystemProperty( "mail.mime.multipart.ignoremissingendboundary", true); // default to true ignoreMissingBoundaryParameter = PropUtil.getBooleanSystemProperty( "mail.mime.multipart.ignoremissingboundaryparameter", true); // default to false ignoreExistingBoundaryParameter = PropUtil.getBooleanSystemProperty( "mail.mime.multipart.ignoreexistingboundaryparameter", false); // default to false allowEmpty = PropUtil.getBooleanSystemProperty( "mail.mime.multipart.allowempty", false); }