public class SMTPMailServerImpl extends AbstractMailServer implements SMTPMailServer
isAuthenticating, logDEFAULT_SMTP_PORT| Constructor and Description |
|---|
SMTPMailServerImpl() |
SMTPMailServerImpl(Long id,
String name,
String description,
String from,
String prefix,
boolean isSession,
boolean removePrecedence,
MailProtocol protocol,
String location,
String smtpPort,
boolean tlsRequired,
String username,
String password,
long timeout) |
SMTPMailServerImpl(Long id,
String name,
String description,
String from,
String prefix,
boolean isSession,
boolean removePrecedence,
MailProtocol protocol,
String location,
String smtpPort,
boolean tlsRequired,
String username,
String password,
long timeout,
String socksHost,
String socksPort) |
SMTPMailServerImpl(Long id,
String name,
String description,
String from,
String prefix,
boolean isSession,
MailProtocol protocol,
String location,
String smtpPort,
boolean tlsRequired,
String username,
String password) |
SMTPMailServerImpl(Long id,
String name,
String description,
String from,
String prefix,
boolean isSession,
MailProtocol protocol,
String location,
String smtpPort,
boolean tlsRequired,
String username,
String password,
long timeout) |
SMTPMailServerImpl(Long id,
String name,
String description,
String from,
String prefix,
boolean isSession,
MailProtocol protocol,
String location,
String smtpPort,
boolean tlsRequired,
String username,
String password,
long timeout,
String socksHost,
String socksPort) |
SMTPMailServerImpl(Long id,
String name,
String description,
String from,
String prefix,
boolean isSession,
String location,
String username,
String password) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
protected javax.mail.Authenticator |
getAuthenticator() |
String |
getDefaultFrom() |
String |
getJndiLocation() |
protected Object |
getJndiSession() |
String |
getPrefix() |
javax.mail.Session |
getSession()
get the mail session
|
String |
getType() |
int |
hashCode() |
boolean |
isRemovePrecedence() |
boolean |
isSessionServer() |
protected void |
propertyChanged()
Discard the cached session when a property of the server changes.
|
void |
quietSend(Email email)
Send a message - but don't throw exceptions, just log the errors
|
void |
send(Email email)
Sends the given email.
|
protected void |
sendMimeMessage(javax.mail.internet.MimeMessage message,
javax.mail.Transport transport)
Extracted method, it can be used for testing purposes.
|
void |
sendWithMessageId(Email email,
String messageId)
Sends the given email using the given Message-ID header.
|
void |
setDefaultFrom(String defaultFrom) |
void |
setJndiLocation(String jndiLocation) |
void |
setPrefix(String prefix) |
void |
setRemovePrecedence(boolean precedence) |
void |
setSessionServer(boolean sessionServer) |
String |
toString() |
getConnectionTimeout, getDebug, getDebugStream, getDescription, getHostname, getId, getMailProtocol, getMoreDebugInfoAboutCreatedSession, getName, getPassword, getPort, getProperties, getSessionFromServerManager, getSocksHost, getSocksPort, getTimeout, getUsername, isTlsRequired, loadSystemProperties, setConnectionTimeout, setDebug, setDebugStream, setDescription, setHostname, setId, setLogger, setMailProtocol, setName, setPassword, setPort, setProperties, setSocksHost, setSocksPort, setTimeout, setTlsRequired, setUsernameclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetDebug, getDebugStream, isTlsRequired, setDebug, setTlsRequiredgetDescription, getHostname, getId, getMailProtocol, getName, getPassword, getPort, getProperties, getSocksHost, getSocksPort, getTimeout, getUsername, setDebugStream, setDescription, setHostname, setId, setLogger, setMailProtocol, setName, setPassword, setPort, setProperties, setSocksHost, setSocksPort, setTimeout, setUsernamepublic SMTPMailServerImpl()
public SMTPMailServerImpl(Long id, String name, String description, String from, String prefix, boolean isSession, String location, String username, String password)
public SMTPMailServerImpl(Long id, String name, String description, String from, String prefix, boolean isSession, MailProtocol protocol, String location, String smtpPort, boolean tlsRequired, String username, String password)
public SMTPMailServerImpl(Long id, String name, String description, String from, String prefix, boolean isSession, MailProtocol protocol, String location, String smtpPort, boolean tlsRequired, String username, String password, long timeout)
public SMTPMailServerImpl(Long id, String name, String description, String from, String prefix, boolean isSession, MailProtocol protocol, String location, String smtpPort, boolean tlsRequired, String username, String password, long timeout, String socksHost, String socksPort)
public SMTPMailServerImpl(Long id, String name, String description, String from, String prefix, boolean isSession, boolean removePrecedence, MailProtocol protocol, String location, String smtpPort, boolean tlsRequired, String username, String password, long timeout)
public SMTPMailServerImpl(Long id, String name, String description, String from, String prefix, boolean isSession, boolean removePrecedence, MailProtocol protocol, String location, String smtpPort, boolean tlsRequired, String username, String password, long timeout, String socksHost, String socksPort)
public String getJndiLocation()
getJndiLocation in interface SMTPMailServerpublic void setJndiLocation(String jndiLocation)
setJndiLocation in interface SMTPMailServerprotected javax.mail.Authenticator getAuthenticator()
getAuthenticator in class AbstractMailServerpublic javax.mail.Session getSession()
throws NamingException,
MailException
getSession in interface MailServerNamingExceptionMailExceptionprotected Object getJndiSession() throws NamingException
NamingExceptionpublic void send(Email email) throws MailException
SMTPMailServerFor backward-compatibility, this method will ignore any Message-ID header set in the email parameter, and let JavaMail set its own Message-ID, then populate the header in the email parameter.
send in interface SMTPMailServeremail - the Email to send.MailException - if the email could not be sentSMTPMailServer.sendWithMessageId(com.atlassian.mail.Email, String)public void sendWithMessageId(Email email, String messageId) throws MailException
SMTPMailServerNote that this is an advanced method and should only be used if you understand the requirements and restrictions as per RFC 2822; namely that the message-ID must be globally unique and can only contain certain ASCII characters.
If the given messageId parameter is null, then we let JavaMail create a Message-ID. Note that (for back-compatibility reasons) the email.getMessageId() is ignored for input, but set with the actual Message-ID used.
sendWithMessageId in interface SMTPMailServeremail - the Email to send.messageId - the desired Message-ID header, or null to let JavaMail create one automatically.
Do not include the angle-brackets - these will be added automatically.MailException - if the email could not be sentSMTPMailServer.send(com.atlassian.mail.Email)protected void sendMimeMessage(javax.mail.internet.MimeMessage message,
javax.mail.Transport transport)
throws javax.mail.MessagingException
javax.mail.MessagingExceptionpublic void quietSend(Email email) throws MailException
quietSend in interface SMTPMailServerMailExceptionpublic String getType()
getType in interface MailServerpublic String getDefaultFrom()
getDefaultFrom in interface SMTPMailServerpublic void setDefaultFrom(String defaultFrom)
setDefaultFrom in interface SMTPMailServerpublic String getPrefix()
getPrefix in interface SMTPMailServerpublic void setPrefix(String prefix)
setPrefix in interface SMTPMailServerpublic boolean isRemovePrecedence()
isRemovePrecedence in interface SMTPMailServerpublic void setRemovePrecedence(boolean precedence)
setRemovePrecedence in interface SMTPMailServerpublic boolean isSessionServer()
isSessionServer in interface SMTPMailServerpublic void setSessionServer(boolean sessionServer)
setSessionServer in interface SMTPMailServerpublic boolean equals(Object o)
equals in class AbstractMailServerpublic int hashCode()
hashCode in class AbstractMailServerpublic String toString()
toString in class AbstractMailServerprotected void propertyChanged()
propertyChanged in class AbstractMailServerCopyright © 2018 Atlassian. All rights reserved.