MCPcopy Create free account
hub / github.com/M66B/FairEmail / SMTPTransport

Class SMTPTransport

app/src/main/java/com/sun/mail/smtp/SMTPTransport.java:78–2918  ·  view source on GitHub ↗

This class implements the Transport abstract class using SMTP for message submission and transport. See the com.sun.mail.smtp package documentation for further information on the SMTP protocol provider. This class includes many protected methods that allo

Source from the content-addressed store, hash-verified

76 */
77
78public class SMTPTransport extends Transport {
79
80 private String name = "smtp"; // Name of this protocol
81 private int defaultPort = 25; // default SMTP port
82 private boolean isSSL = false; // use SSL?
83 private String host; // host we're connected to
84
85 // Following fields valid only during the sendMessage method.
86 private MimeMessage message; // Message to be sent
87 private Address[] addresses; // Addresses to which to send the msg
88 // Valid sent, valid unsent and invalid addresses
89 private Address[] validSentAddr, validUnsentAddr, invalidAddr;
90 // Did we send the message even though some addresses were invalid?
91 private boolean sendPartiallyFailed = false;
92 // If so, here's an exception we need to throw
93 private MessagingException exception;
94 // stream where message data is written
95 private SMTPOutputStream dataStream;
96
97 // Map of SMTP service extensions supported by server, if EHLO used.
98 private Hashtable<String, String> extMap;
99
100 private Map<String, Authenticator> authenticators
101 = new HashMap<>();
102 private String defaultAuthenticationMechanisms; // set in constructor
103
104 private boolean quitWait = false; // true if we should wait
105 private boolean quitOnSessionReject = false; // true if we should send quit when session initiation is rejected
106
107 private String saslRealm = UNKNOWN;
108 private String authorizationID = UNKNOWN;
109 private boolean enableSASL = false; // enable SASL authentication
110 private boolean useCanonicalHostName = false; // use canonical host name?
111 private String[] saslMechanisms = UNKNOWN_SA;
112
113 private String ntlmDomain = UNKNOWN; // for ntlm authentication
114
115 private boolean reportSuccess; // throw an exception even on success
116 private boolean useStartTLS; // use STARTTLS command
117 private boolean requireStartTLS; // require STARTTLS command
118 private boolean useRset; // use RSET instead of NOOP
119 private boolean noopStrict = true; // NOOP must return 250 for success
120
121 private MailLogger logger; // debug logger
122 private MailLogger traceLogger; // protocol trace logger
123 private String localHostName; // our own host name
124 private String lastServerResponse; // last SMTP response
125 private int lastReturnCode; // last SMTP return code
126 private boolean notificationDone; // only notify once per send
127
128 private SaslAuthenticator saslAuthenticator; // if SASL is being used
129
130 private boolean noauthdebug = true; // hide auth info in debug output
131 private boolean debugusername; // include username in debug output?
132 private boolean debugpassword; // include password in debug output?
133 private boolean allowutf8; // allow UTF-8 usernames and passwords?
134 private int chunkSize; // chunk size if CHUNKING supported
135

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected