/** * 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); } }
/** * 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); }
/** * 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; }
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"))); }
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"))); }
/** * Get the value of a boolean property. * Print out the value if logging is enabled. */ private final synchronized boolean getBoolProp(Properties props, String prop) { boolean val = PropUtil.getBooleanProperty(props, prop, false); if (logger.isLoggable(Level.CONFIG)) logger.config(prop + ": " + val); return val; }
/** * Get the value of a boolean property. * Print out the value if logging is enabled. */ private final synchronized boolean getBoolProp(Properties props, String prop) { boolean val = PropUtil.getBooleanProperty(props, prop, false); if (logger.isLoggable(Level.CONFIG)) logger.config(prop + ": " + val); return val; }
/** * Constructor for debugging. * * @param in the InputStream from which to read * @param out the PrintStream to which to write * @param props Properties object used by this protocol * @param debug true to enable debugging output * @exception IOException for I/O errors */ public IMAPProtocol(InputStream in, PrintStream out, Properties props, boolean debug) throws IOException { super(in, out, props, debug); this.name = "imap"; noauthdebug = !PropUtil.getBooleanProperty(props, "mail.debug.auth", false); if (capabilities == null) capabilities = new HashMap<String, String>(); searchCharsets = new String[2]; // 2, for now. searchCharsets[0] = "UTF-8"; searchCharsets[1] = MimeUtility.mimeCharset( MimeUtility.getDefaultJavaCharset() ); connected = true; // must be last statement in constructor }
/** * Constructor for debugging. * * @param in the InputStream from which to read * @param out the PrintStream to which to write * @param props Properties object used by this protocol * @param debug true to enable debugging output * @exception IOException for I/O errors */ public IMAPProtocol(InputStream in, PrintStream out, Properties props, boolean debug) throws IOException { super(in, out, props, debug); this.name = "imap"; noauthdebug = !PropUtil.getBooleanProperty(props, "mail.debug.auth", false); if (capabilities == null) capabilities = new HashMap<>(); searchCharsets = new String[2]; // 2, for now. searchCharsets[0] = "UTF-8"; searchCharsets[1] = MimeUtility.mimeCharset( MimeUtility.getDefaultJavaCharset() ); connected = true; // must be last statement in constructor }
private void initStreams() throws IOException { boolean quote = PropUtil.getBooleanProperty(session.getProperties(), "mail.debug.quote", false); traceInput = new TraceInputStream(serverSocket.getInputStream(), traceLogger); traceInput.setQuote(quote); traceOutput = new TraceOutputStream(serverSocket.getOutputStream(), traceLogger); traceOutput.setQuote(quote); serverOutput = new BufferedOutputStream(traceOutput); serverInput = new BufferedInputStream(traceInput); lineInputStream = new LineInputStream(serverInput); }
/** * Get the value of a boolean property. * Print out the value if logging is enabled. */ private final synchronized boolean getBoolProp(String prop) { prop = "mail." + name + "." + prop; boolean val = PropUtil.getBooleanProperty(session.getProperties(), prop, false); if (logger.isLoggable(Level.CONFIG)) logger.config(prop + ": " + val); return val; }
this.name = name; noauthdebug = !PropUtil.getBooleanProperty(props, "mail.debug.auth", false); referralException = PropUtil.getBooleanProperty(props, prefix + ".referralexception", false);
this.name = name; noauthdebug = !PropUtil.getBooleanProperty(props, "mail.debug.auth", false); referralException = PropUtil.getBooleanProperty(props, prefix + ".referralexception", false);
this.logger = logger; traceLogger = logger.getSubLogger("protocol", null); noauthdebug = !PropUtil.getBooleanProperty(props, "mail.debug.auth", false); PropUtil.getBooleanProperty(props, prefix + ".pipelining", false); if (pipelining) logger.config("PIPELINING enabled");
quote = PropUtil.getBooleanProperty(props, "mail.debug.quote", false);
this.logger = logger; traceLogger = logger.getSubLogger("protocol", null); noauthdebug = !PropUtil.getBooleanProperty(props, "mail.debug.auth", false); PropUtil.getBooleanProperty(props, prefix + ".pipelining", false); if (pipelining) logger.config("PIPELINING enabled");
quote = PropUtil.getBooleanProperty(props, "mail.debug.quote", false);
Properties props = session.getProperties(); boolean debug = PropUtil.getBooleanProperty(props, "mail." + name + ".connectionpool.debug", false); logger = plogger.getSubLogger("connectionpool", PropUtil.getBooleanProperty(props, "mail." + name + ".separatestoreconnection", false); if (separateStoreConnection)
referralException = PropUtil.getBooleanProperty(props, prefix + ".referralexception", false); if (referralException)
referralException = PropUtil.getBooleanProperty(props, prefix + ".referralexception", false); if (referralException)