/** * Does the server we're connected to support the specified * authentication mechanism? Uses the extension information * returned by the server from the EHLO command. * * @param auth the authentication mechanism * @return true if the authentication mechanism is supported * * @since JavaMail 1.4.1 */ protected boolean supportsAuthentication(String auth) { assert Thread.holdsLock(this); if (extMap == null) return false; String a = extMap.get("AUTH"); if (a == null) return false; StringTokenizer st = new StringTokenizer(a); while (st.hasMoreTokens()) { String tok = st.nextToken(); if (tok.equalsIgnoreCase(auth)) return true; } // hack for buggy servers that advertise capability incorrectly if (auth.equalsIgnoreCase("LOGIN") && supportsExtension("AUTH=LOGIN")) { logger.fine("use AUTH=LOGIN hack"); return true; } return false; }
/** * Does the server we're connected to support the specified * authentication mechanism? Uses the extension information * returned by the server from the EHLO command. * * @param auth the authentication mechanism * @return true if the authentication mechanism is supported * * @since JavaMail 1.4.1 */ protected boolean supportsAuthentication(String auth) { assert Thread.holdsLock(this); if (extMap == null) return false; String a = extMap.get("AUTH"); if (a == null) return false; StringTokenizer st = new StringTokenizer(a); while (st.hasMoreTokens()) { String tok = st.nextToken(); if (tok.equalsIgnoreCase(auth)) return true; } // hack for buggy servers that advertise capability incorrectly if (auth.equalsIgnoreCase("LOGIN") && supportsExtension("AUTH=LOGIN")) { logger.fine("use AUTH=LOGIN hack"); return true; } return false; }
if (allowutf8 && supportsExtension("SMTPUTF8")) cmd += " SMTPUTF8"; if (supportsExtension("DSN")) { String ret = null; if (message instanceof SMTPMessage) if (supportsExtension("AUTH")) { String submitter = null; if (message instanceof SMTPMessage) try { String s = xtext(submitter, allowutf8 && supportsExtension("SMTPUTF8")); cmd += " AUTH=" + s; } catch (IllegalArgumentException ex) {
if (supportsExtension("DSN")) { if (message instanceof SMTPMessage) notify = ((SMTPMessage)message).getDSNNotify();
if (supportsExtension("DSN")) { if (message instanceof SMTPMessage) notify = ((SMTPMessage)message).getDSNNotify();
if (supportsExtension("DSN")) { String ret = null; if (message instanceof SMTPMessage) if (supportsExtension("AUTH")) { String submitter = null; if (message instanceof SMTPMessage)
if (serverSocket instanceof SSLSocket) { logger.fine("STARTTLS requested but already using SSL"); } else if (supportsExtension("STARTTLS")) { startTLS(); if (allowutf8 && !supportsExtension("SMTPUTF8")) logger.log(Level.INFO, "mail.mime.allowutf8 set " + "but server doesn't advertise SMTPUTF8 support"); (supportsExtension("AUTH") || supportsExtension("AUTH=LOGIN"))) { if (logger.isLoggable(Level.FINE)) logger.fine("protocolConnect login" +
private boolean shouldAdapt(SMTPTransport transport) { // If the transport is a SMTPTransport (from sun) some performance enhancement can be done. // If the transport is not the one developed by Sun we are not sure of how it handles the 8 bit mime stuff, so I // convert the message to 7bit. return !transport.getClass().getName().endsWith(".SMTPTransport") || !transport.supportsExtension(BIT_MIME_8); // if the message is already 8bit or binary and the server doesn't support the 8bit extension it has to be converted // to 7bit. Javamail api doesn't perform that conversion, but it is required to be a rfc-compliant smtp server. }
if (serverSocket instanceof SSLSocket) { logger.fine("STARTTLS requested but already using SSL"); } else if (supportsExtension("STARTTLS")) { startTLS(); (supportsExtension("AUTH") || supportsExtension("AUTH=LOGIN"))) { if (logger.isLoggable(Level.FINE)) logger.fine("protocolConnect login" +
/** * Does the server we're connected to support the specified * authentication mechanism? Uses the extension information * returned by the server from the EHLO command. * * @param auth the authentication mechanism * @return true if the authentication mechanism is supported * * @since JavaMail 1.4.1 */ protected boolean supportsAuthentication(String auth) { assert Thread.holdsLock(this); if (extMap == null) return false; String a = (String)extMap.get("AUTH"); if (a == null) return false; StringTokenizer st = new StringTokenizer(a); while (st.hasMoreTokens()) { String tok = st.nextToken(); if (tok.equalsIgnoreCase(auth)) return true; } // hack for buggy servers that advertise capability incorrectly if (auth.equalsIgnoreCase("LOGIN") && supportsExtension("AUTH=LOGIN")) { out.println("DEBUG SMTP: use AUTH=LOGIN hack"); return true; } return false; }
/** * Does the server we're connected to support the specified * authentication mechanism? Uses the extension information * returned by the server from the EHLO command. * * @param auth the authentication mechanism * @return true if the authentication mechanism is supported * * @since JavaMail 1.4.1 */ protected boolean supportsAuthentication(String auth) { assert Thread.holdsLock(this); if (extMap == null) return false; String a = extMap.get("AUTH"); if (a == null) return false; StringTokenizer st = new StringTokenizer(a); while (st.hasMoreTokens()) { String tok = st.nextToken(); if (tok.equalsIgnoreCase(auth)) return true; } // hack for buggy servers that advertise capability incorrectly if (auth.equalsIgnoreCase("LOGIN") && supportsExtension("AUTH=LOGIN")) { logger.fine("use AUTH=LOGIN hack"); return true; } return false; }
/** * Does the server we're connected to support the specified * authentication mechanism? Uses the extension information * returned by the server from the EHLO command. * * @param auth the authentication mechanism * @return true if the authentication mechanism is supported * * @since JavaMail 1.4.1 */ protected boolean supportsAuthentication(String auth) { assert Thread.holdsLock(this); if (extMap == null) return false; String a = extMap.get("AUTH"); if (a == null) return false; StringTokenizer st = new StringTokenizer(a); while (st.hasMoreTokens()) { String tok = st.nextToken(); if (tok.equalsIgnoreCase(auth)) return true; } // hack for buggy servers that advertise capability incorrectly if (auth.equalsIgnoreCase("LOGIN") && supportsExtension("AUTH=LOGIN")) { logger.fine("use AUTH=LOGIN hack"); return true; } return false; }
/** * Does the server we're connected to support the specified * authentication mechanism? Uses the extension information * returned by the server from the EHLO command. * * @param auth the authentication mechanism * @return true if the authentication mechanism is supported * * @since JavaMail 1.4.1 */ protected boolean supportsAuthentication(String auth) { assert Thread.holdsLock(this); if (extMap == null) return false; String a = extMap.get("AUTH"); if (a == null) return false; StringTokenizer st = new StringTokenizer(a); while (st.hasMoreTokens()) { String tok = st.nextToken(); if (tok.equalsIgnoreCase(auth)) return true; } // hack for buggy servers that advertise capability incorrectly if (auth.equalsIgnoreCase("LOGIN") && supportsExtension("AUTH=LOGIN")) { logger.fine("use AUTH=LOGIN hack"); return true; } return false; }
/** * Does the server we're connected to support the specified * authentication mechanism? Uses the extension information * returned by the server from the EHLO command. * * @param auth the authentication mechanism * @return true if the authentication mechanism is supported * * @since JavaMail 1.4.1 */ protected boolean supportsAuthentication(String auth) { assert Thread.holdsLock(this); if (extMap == null) return false; String a = extMap.get("AUTH"); if (a == null) return false; StringTokenizer st = new StringTokenizer(a); while (st.hasMoreTokens()) { String tok = st.nextToken(); if (tok.equalsIgnoreCase(auth)) return true; } // hack for buggy servers that advertise capability incorrectly if (auth.equalsIgnoreCase("LOGIN") && supportsExtension("AUTH=LOGIN")) { logger.fine("use AUTH=LOGIN hack"); return true; } return false; }
/** * Does the server we're connected to support the specified * authentication mechanism? Uses the extension information * returned by the server from the EHLO command. * * @param auth the authentication mechanism * @return true if the authentication mechanism is supported * * @since JavaMail 1.4.1 */ protected boolean supportsAuthentication(String auth) { assert Thread.holdsLock(this); if (extMap == null) return false; String a = extMap.get("AUTH"); if (a == null) return false; StringTokenizer st = new StringTokenizer(a); while (st.hasMoreTokens()) { String tok = st.nextToken(); if (tok.equalsIgnoreCase(auth)) return true; } // hack for buggy servers that advertise capability incorrectly if (auth.equalsIgnoreCase("LOGIN") && supportsExtension("AUTH=LOGIN")) { logger.fine("use AUTH=LOGIN hack"); return true; } return false; }
if (logger.isLoggable(Level.FINE)) logger.fine("use8bit " + use8bit); if (use8bit && supportsExtension("8BITMIME")) { if (convertTo8Bit(this.message)) { mailFrom(); rcptTo(); if (chunkSize > 0 && supportsExtension("CHUNKING")) {
if (logger.isLoggable(Level.FINE)) logger.fine("use8bit " + use8bit); if (use8bit && supportsExtension("8BITMIME")) { if (convertTo8Bit(this.message)) {
if (supportsExtension("STARTTLS")) { startTLS(); (supportsExtension("AUTH") || supportsExtension("AUTH=LOGIN"))) { connected = authenticate(user, passwd); return connected;
if (supportsExtension("DSN")) { String ret = null; if (message instanceof SMTPMessage) if (supportsExtension("AUTH")) { String submitter = null; if (message instanceof SMTPMessage)
if (supportsExtension("DSN")) { String ret = null; if (message instanceof SMTPMessage) if (supportsExtension("AUTH")) { String submitter = null; if (message instanceof SMTPMessage)