public class MailConfig extends NetClientOptions
Modifier and Type | Field and Description |
---|---|
static boolean |
DEFAULT_ALLOW_RCPT_ERRORS |
static boolean |
DEFAULT_DISABLE_ESMTP |
static boolean |
DEFAULT_ENABLE_PIPELINING |
static String |
DEFAULT_HOST |
static boolean |
DEFAULT_KEEP_ALIVE |
static int |
DEFAULT_KEEP_ALIVE_TIMEOUT
The default keep alive timeout for SMTP connection = 5 minutes
|
static TimeUnit |
DEFAULT_KEEP_ALIVE_TIMEOUT_UNIT |
static LoginOption |
DEFAULT_LOGIN |
static long |
DEFAULT_MAILS_PER_CONNECTION |
static int |
DEFAULT_MAX_POOL_SIZE |
static boolean |
DEFAULT_MULTI_PART_ONLY |
static int |
DEFAULT_POOL_CLEANER_PERIOD
Default pool cleaner period = 1000 ms (1 second)
|
static TimeUnit |
DEFAULT_POOL_CLEANER_PERIOD_TIMEOUT_UNIT |
static int |
DEFAULT_PORT |
static StartTLSOptions |
DEFAULT_TLS |
static String |
DEFAULT_USER_AGENT |
DEFAULT_HOSTNAME_VERIFICATION_ALGORITHM, DEFAULT_RECONNECT_ATTEMPTS, DEFAULT_RECONNECT_INTERVAL, DEFAULT_REGISTER_WRITE_HANDLER
DEFAULT_CONNECT_TIMEOUT, DEFAULT_METRICS_NAME, DEFAULT_TRUST_ALL
DEFAULT_ENABLED_SECURE_TRANSPORT_PROTOCOLS, DEFAULT_IDLE_TIMEOUT, DEFAULT_IDLE_TIMEOUT_TIME_UNIT, DEFAULT_READ_IDLE_TIMEOUT, DEFAULT_SO_LINGER, DEFAULT_SSL, DEFAULT_SSL_ENGINE, DEFAULT_SSL_HANDSHAKE_TIMEOUT, DEFAULT_SSL_HANDSHAKE_TIMEOUT_TIME_UNIT, DEFAULT_TCP_CORK, DEFAULT_TCP_FAST_OPEN, DEFAULT_TCP_KEEP_ALIVE, DEFAULT_TCP_NO_DELAY, DEFAULT_TCP_QUICKACK, DEFAULT_TCP_USER_TIMEOUT, DEFAULT_USE_ALPN, DEFAULT_WRITE_IDLE_TIMEOUT
DEFAULT_LOG_ACTIVITY_FORMAT, DEFAULT_LOG_ENABLED, DEFAULT_RECEIVE_BUFFER_SIZE, DEFAULT_REUSE_ADDRESS, DEFAULT_REUSE_PORT, DEFAULT_SEND_BUFFER_SIZE, DEFAULT_TRAFFIC_CLASS
Constructor and Description |
---|
MailConfig()
construct a config object with default options
|
MailConfig(JsonObject config)
construct config object from Json representation
|
MailConfig(MailConfig other)
copy config object from another MailConfig object
|
MailConfig(String hostname)
construct a config object with hostname and default options
|
MailConfig(String hostname,
int port)
construct a config object with hostname/port and default options
|
MailConfig(String hostname,
int port,
StartTLSOptions starttls,
LoginOption login)
construct a config object with hostname/port and security and login options
|
Modifier and Type | Method and Description |
---|---|
MailConfig |
addCrlPath(String crlPath)
Add a CRL path
|
MailConfig |
addCrlValue(Buffer crlValue)
Add a CRL value
|
MailConfig |
addDKIMSignOption(DKIMSignOptions dkimSignOptions)
Adds a DKIMSignOptions.
|
MailConfig |
addEnabledCipherSuite(String suite)
Add an enabled cipher suite, appended to the ordered suites.
|
MailConfig |
addEnabledSecureTransportProtocol(String protocol)
Add an enabled SSL/TLS protocols, appended to the ordered protocols.
|
boolean |
equals(Object o) |
String |
getAuthMethods()
get string of allowed auth methods, if set only these methods will be used
if the server supports them.
|
DKIMSignOptions |
getDKIMSignOption()
Gets the DKIM options.
|
List<DKIMSignOptions> |
getDKIMSignOptions()
Gets the DKIM options.
|
String |
getHostname()
get the hostname of the mailserver
|
int |
getKeepAliveTimeout() |
TimeUnit |
getKeepAliveTimeoutUnit()
Gets the
TimeUnit of keeping the connections alive timeout. |
String |
getKeyStore()
Deprecated.
|
String |
getKeyStorePassword()
Deprecated.
|
LoginOption |
getLogin()
get login options
|
long |
getMaxMailsPerConnection()
The max emails count per connection.
|
int |
getMaxPoolSize()
get the max allowed number of open connections to the mailserver
if not set the default is 10
|
String |
getNtDomain()
Domain used on NTLM authentication.
|
String |
getOwnHostname()
get the hostname to be used for HELO/EHLO and the Message-ID
|
String |
getPassword()
get password
|
int |
getPoolCleanerPeriod() |
TimeUnit |
getPoolCleanerPeriodUnit()
Gets the
TimeUnit of pool cleaning period. |
int |
getPort()
get the port of the mailserver
|
StartTLSOptions |
getStarttls()
get security (TLS) options
|
String |
getUserAgent()
Gets the Mail User Agent(MUA) name that will be used to generate boundary and message id.
|
String |
getUsername()
get username
|
String |
getWorkstation()
Workstation used on NTLM authentication
|
int |
hashCode() |
boolean |
isAllowRcptErrors()
get if sending allows rcpt errors (default is false)
|
boolean |
isDisableEsmtp()
get if ESMTP should be tried as first command (EHLO) (default is true)
|
boolean |
isEnableDKIM()
Is DKIM enabled, defaults to false.
|
boolean |
isKeepAlive()
get if connection pool is enabled
default is true
|
boolean |
isMultiPartOnly()
Should the mail message be always encoded as multipart.
|
boolean |
isPipelining()
Is the pipelining will be used if SMTP server supports it.
|
MailConfig |
removeEnabledSecureTransportProtocol(String protocol)
Removes an enabled SSL/TLS protocol from the ordered protocols.
|
MailConfig |
setAllowRcptErrors(boolean allowRcptErrors)
set if sending allows rcpt errors
|
MailConfig |
setAuthMethods(String authMethods)
set string of allowed auth methods.
|
MailConfig |
setConnectTimeout(int connectTimeout)
Set the connect timeout
|
MailConfig |
setDisableEsmtp(boolean disableEsmtp)
set if ESMTP should be tried as first command (EHLO)
|
MailConfig |
setDKIMSignOption(DKIMSignOptions dkimSignOptions)
Sets one DKIMSignOptions for convenient.
|
MailConfig |
setDKIMSignOptions(List<DKIMSignOptions> dkimSignOptions)
Sets DKIMSignOptions.
|
MailConfig |
setEnableDKIM(boolean enableDKIM)
Sets true to enable DKIM Signatures, sets false to disable it.
|
MailConfig |
setEnabledSecureTransportProtocols(Set<String> enabledSecureTransportProtocols)
Sets the list of enabled SSL/TLS protocols.
|
MailConfig |
setHostname(String hostname)
Set the hostname of the smtp server.
|
MailConfig |
setHostnameVerificationAlgorithm(String hostnameVerificationAlgorithm)
Set the hostname verification algorithm interval
To disable hostname verification, set hostnameVerificationAlgorithm to an empty String
|
MailConfig |
setIdleTimeout(int idleTimeout)
Set the idle timeout, default time unit is seconds.
|
MailConfig |
setIdleTimeoutUnit(TimeUnit idleTimeoutUnit)
Set the idle timeout unit.
|
MailConfig |
setJdkSslEngineOptions(JdkSSLEngineOptions sslEngineOptions) |
MailConfig |
setKeepAlive(boolean keepAlive)
set if connection pool is enabled
default is true
|
MailConfig |
setKeepAliveTimeout(int keepAliveTimeout)
Set the keep alive timeout for SMTP connection, Defaults in seconds.
|
MailConfig |
setKeepAliveTimeoutUnit(TimeUnit keepAliveTimeoutUnit)
Sets
TimeUnit of keeping connections in the pool alive. |
MailConfig |
setKeyCertOptions(KeyCertOptions options)
Set the key/cert options.
|
MailConfig |
setKeyStore(String keyStore)
Deprecated.
|
MailConfig |
setKeyStoreOptions(JksOptions options)
Set the key/cert options in jks format, aka Java keystore.
|
MailConfig |
setKeyStorePassword(String keyStorePassword)
Deprecated.
|
MailConfig |
setLocalAddress(String localAddress)
Set the local interface to bind for network connections.
|
MailConfig |
setLogActivity(boolean logEnabled)
Set to true to enabled network activity logging: Netty's pipeline is configured for logging on Netty's logger.
|
MailConfig |
setLogin(LoginOption login)
Set the login mode for the connection.
|
MailConfig |
setMaxMailsPerConnection(long maxMailsPerConnection)
Sets the max emails count per connection before it gets closed.
|
MailConfig |
setMaxPoolSize(int maxPoolSize)
set the max allowed number of open connections to the mail server
if not set the default is 10
|
MailConfig |
setMetricsName(String metricsName)
Set the metrics name identifying the reported metrics, useful for grouping metrics
with the same name.
|
MailConfig |
setMultiPartOnly(boolean multiPartOnly)
Sets to encode multipart only or not.
|
MailConfig |
setNtDomain(String ntDomain)
Sets the domain used on NTLM authentication
|
MailConfig |
setOpenSslEngineOptions(OpenSSLEngineOptions sslEngineOptions) |
MailConfig |
setOwnHostname(String ownHostname)
set the hostname to be used for HELO/EHLO and the Message-ID
|
MailConfig |
setPassword(String password)
Set the password for the login.
|
MailConfig |
setPemKeyCertOptions(PemKeyCertOptions options)
Set the key/cert store options in pem format.
|
MailConfig |
setPemTrustOptions(PemTrustOptions options)
Set the trust options in pem format
|
MailConfig |
setPfxKeyCertOptions(PfxOptions options)
Set the key/cert options in pfx format.
|
MailConfig |
setPfxTrustOptions(PfxOptions options)
Set the trust options in pfx format
|
MailConfig |
setPipelining(boolean pipelining)
Sets to enable/disable the pipelining capability if SMTP server supports it.
|
MailConfig |
setPoolCleanerPeriod(int poolCleanerPeriod)
Set the connection pool cleaner period, defaults in milli seconds, a non positive value disables expiration checks and connections
will remain in the pool until they are closed.
|
MailConfig |
setPoolCleanerPeriodUnit(TimeUnit poolCleanerPeriodUnit)
Sets the
TimeUnit of pool cleaning period. |
MailConfig |
setPort(int port)
Set the port of the smtp server.
|
MailConfig |
setProxyOptions(ProxyOptions proxyOptions)
Set proxy options for connections via CONNECT proxy (e.g.
|
MailConfig |
setReceiveBufferSize(int receiveBufferSize)
Set the TCP receive buffer size
|
MailConfig |
setReconnectAttempts(int attempts)
Set the value of reconnect attempts
|
MailConfig |
setReconnectInterval(long interval)
Set the reconnect interval
|
MailConfig |
setReuseAddress(boolean reuseAddress)
Set the value of reuse address
|
MailConfig |
setReusePort(boolean reusePort)
Set the value of reuse port.
|
MailConfig |
setSendBufferSize(int sendBufferSize)
Set the TCP send buffer size
|
MailConfig |
setSoLinger(int soLinger)
Set whether SO_linger keep alive is enabled
|
MailConfig |
setSsl(boolean isSsl)
Set whether SSL/TLS is enabled
|
MailConfig |
setSslEngineOptions(SSLEngineOptions sslEngineOptions)
Set to use SSL engine implementation to use.
|
MailConfig |
setSslHandshakeTimeout(long sslHandshakeTimeout)
Set the SSL handshake timeout, default time unit is seconds.
|
MailConfig |
setSslHandshakeTimeoutUnit(TimeUnit sslHandshakeTimeoutUnit)
Set the SSL handshake timeout unit.
|
MailConfig |
setStarttls(StartTLSOptions starttls)
Set the tls security mode for the connection.
|
MailConfig |
setTcpCork(boolean tcpCork)
Enable the
TCP_CORK option - only with linux native transport. |
MailConfig |
setTcpFastOpen(boolean tcpFastOpen)
Enable the
TCP_FASTOPEN option - only with linux native transport. |
MailConfig |
setTcpKeepAlive(boolean tcpKeepAlive)
Set whether TCP keep alive is enabled
|
MailConfig |
setTcpNoDelay(boolean tcpNoDelay)
Set whether TCP no delay is enabled
|
MailConfig |
setTcpQuickAck(boolean tcpQuickAck)
Enable the
TCP_QUICKACK option - only with linux native transport. |
MailConfig |
setTrafficClass(int trafficClass)
Set the value of traffic class
|
MailConfig |
setTrustAll(boolean trustAll)
Set whether all server certificates should be trusted
|
MailConfig |
setTrustOptions(TrustOptions options)
Set the trust options.
|
MailConfig |
setTrustStoreOptions(JksOptions options)
Set the trust options in jks format, aka Java truststore
|
MailConfig |
setUseAlpn(boolean useAlpn)
Set the ALPN usage.
|
MailConfig |
setUserAgent(String userAgent)
Sets the Mail User Agent(MUA) name.
|
MailConfig |
setUsername(String username)
Set the username for the login.
|
MailConfig |
setWorkstation(String workstation)
Sets the workstation used on NTLM authentication
|
JsonObject |
toJson()
convert config object to Json representation
|
addNonProxyHost, getApplicationLayerProtocols, getHostnameVerificationAlgorithm, getReconnectAttempts, getReconnectInterval, isRegisterWriteHandler, removeEnabledCipherSuite, setActivityLogDataFormat, setApplicationLayerProtocols, setNonProxyHosts, setReadIdleTimeout, setRegisterWriteHandler, setWriteIdleTimeout
getConnectTimeout, getLocalAddress, getMetricsName, getNonProxyHosts, getProxyOptions, isTrustAll, setTcpUserTimeout
getCrlPaths, getCrlValues, getEnabledCipherSuites, getEnabledSecureTransportProtocols, getIdleTimeout, getIdleTimeoutUnit, getJdkSslEngineOptions, getKeyCertOptions, getKeyStoreOptions, getOpenSslEngineOptions, getPemKeyCertOptions, getPemTrustOptions, getPfxKeyCertOptions, getPfxTrustOptions, getReadIdleTimeout, getSoLinger, getSslEngineOptions, getSslHandshakeTimeout, getSslHandshakeTimeoutUnit, getSslOptions, getTcpUserTimeout, getTrustOptions, getTrustStoreOptions, getWriteIdleTimeout, isSsl, isTcpCork, isTcpFastOpen, isTcpKeepAlive, isTcpNoDelay, isTcpQuickAck, isUseAlpn
getActivityLogDataFormat, getLogActivity, getReceiveBufferSize, getSendBufferSize, getTrafficClass, isReuseAddress, isReusePort
public static final LoginOption DEFAULT_LOGIN
public static final StartTLSOptions DEFAULT_TLS
public static final int DEFAULT_PORT
public static final String DEFAULT_HOST
public static final int DEFAULT_MAX_POOL_SIZE
public static final boolean DEFAULT_ALLOW_RCPT_ERRORS
public static final boolean DEFAULT_KEEP_ALIVE
public static final boolean DEFAULT_DISABLE_ESMTP
public static final String DEFAULT_USER_AGENT
public static final boolean DEFAULT_ENABLE_PIPELINING
public static final boolean DEFAULT_MULTI_PART_ONLY
public static final long DEFAULT_MAILS_PER_CONNECTION
public static final int DEFAULT_POOL_CLEANER_PERIOD
public static final TimeUnit DEFAULT_POOL_CLEANER_PERIOD_TIMEOUT_UNIT
public static final int DEFAULT_KEEP_ALIVE_TIMEOUT
public static final TimeUnit DEFAULT_KEEP_ALIVE_TIMEOUT_UNIT
public MailConfig()
public MailConfig(String hostname)
hostname
- the hostname of the mail serverpublic MailConfig(String hostname, int port)
hostname
- the hostname of the mail serverport
- the port of the mail serverpublic MailConfig(String hostname, int port, StartTLSOptions starttls, LoginOption login)
hostname
- the hostname of the mail serverport
- the port of the mail serverstarttls
- whether to use TLS or notlogin
- whether to use Login or notpublic MailConfig(MailConfig other)
other
- the object to be copiedpublic MailConfig(JsonObject config)
config
- the config to copypublic MailConfig setSendBufferSize(int sendBufferSize)
NetworkOptions
setSendBufferSize
in class NetClientOptions
sendBufferSize
- the buffers size, in bytespublic MailConfig setReceiveBufferSize(int receiveBufferSize)
NetworkOptions
setReceiveBufferSize
in class NetClientOptions
receiveBufferSize
- the buffers size, in bytespublic MailConfig setReuseAddress(boolean reuseAddress)
NetworkOptions
setReuseAddress
in class NetClientOptions
reuseAddress
- the value of reuse addresspublic MailConfig setReusePort(boolean reusePort)
NetworkOptions
setReusePort
in class NetClientOptions
reusePort
- the value of reuse portpublic MailConfig setTrafficClass(int trafficClass)
NetworkOptions
setTrafficClass
in class NetClientOptions
trafficClass
- the value of traffic classpublic MailConfig setTcpNoDelay(boolean tcpNoDelay)
TCPSSLOptions
setTcpNoDelay
in class NetClientOptions
tcpNoDelay
- true if TCP no delay is enabled (Nagle disabled)public MailConfig setTcpKeepAlive(boolean tcpKeepAlive)
TCPSSLOptions
setTcpKeepAlive
in class NetClientOptions
tcpKeepAlive
- true if TCP keep alive is enabledpublic MailConfig setSoLinger(int soLinger)
TCPSSLOptions
setSoLinger
in class NetClientOptions
soLinger
- true if SO_linger is enabledpublic MailConfig setIdleTimeout(int idleTimeout)
TCPSSLOptions
TCPSSLOptions.setIdleTimeoutUnit(TimeUnit)
setIdleTimeout
in class NetClientOptions
idleTimeout
- the timeoutpublic MailConfig setIdleTimeoutUnit(TimeUnit idleTimeoutUnit)
TCPSSLOptions
setIdleTimeoutUnit
in class NetClientOptions
idleTimeoutUnit
- specify time unit.public MailConfig setKeyCertOptions(KeyCertOptions options)
TCPSSLOptions
setKeyCertOptions
in class NetClientOptions
options
- the key store optionspublic MailConfig setKeyStoreOptions(JksOptions options)
TCPSSLOptions
setKeyStoreOptions
in class NetClientOptions
options
- the key store in jks formatpublic MailConfig setPfxKeyCertOptions(PfxOptions options)
TCPSSLOptions
setPfxKeyCertOptions
in class NetClientOptions
options
- the key cert options in pfx formatpublic MailConfig setPemKeyCertOptions(PemKeyCertOptions options)
TCPSSLOptions
setPemKeyCertOptions
in class NetClientOptions
options
- the options in pem formatpublic MailConfig setTrustOptions(TrustOptions options)
TCPSSLOptions
setTrustOptions
in class NetClientOptions
options
- the trust optionspublic MailConfig setTrustStoreOptions(JksOptions options)
TCPSSLOptions
setTrustStoreOptions
in class NetClientOptions
options
- the trust options in jks formatpublic MailConfig setPemTrustOptions(PemTrustOptions options)
TCPSSLOptions
setPemTrustOptions
in class NetClientOptions
options
- the trust options in pem formatpublic MailConfig setPfxTrustOptions(PfxOptions options)
TCPSSLOptions
setPfxTrustOptions
in class NetClientOptions
options
- the trust options in pfx formatpublic MailConfig addEnabledCipherSuite(String suite)
TCPSSLOptions
addEnabledCipherSuite
in class NetClientOptions
suite
- the suiteTCPSSLOptions.getEnabledCipherSuites()
public MailConfig addEnabledSecureTransportProtocol(String protocol)
TCPSSLOptions
addEnabledSecureTransportProtocol
in class NetClientOptions
protocol
- the SSL/TLS protocol to enablepublic MailConfig removeEnabledSecureTransportProtocol(String protocol)
TCPSSLOptions
removeEnabledSecureTransportProtocol
in class NetClientOptions
protocol
- the SSL/TLS protocol to disablepublic MailConfig setUseAlpn(boolean useAlpn)
TCPSSLOptions
setUseAlpn
in class NetClientOptions
useAlpn
- true when Application-Layer Protocol Negotiation should be usedpublic MailConfig setSslEngineOptions(SSLEngineOptions sslEngineOptions)
TCPSSLOptions
setSslEngineOptions
in class NetClientOptions
sslEngineOptions
- the ssl engine to usepublic MailConfig setJdkSslEngineOptions(JdkSSLEngineOptions sslEngineOptions)
setJdkSslEngineOptions
in class NetClientOptions
public MailConfig setTcpFastOpen(boolean tcpFastOpen)
TCPSSLOptions
TCP_FASTOPEN
option - only with linux native transport.setTcpFastOpen
in class NetClientOptions
tcpFastOpen
- the fast open valuepublic MailConfig setTcpCork(boolean tcpCork)
TCPSSLOptions
TCP_CORK
option - only with linux native transport.setTcpCork
in class NetClientOptions
tcpCork
- the cork valuepublic MailConfig setTcpQuickAck(boolean tcpQuickAck)
TCPSSLOptions
TCP_QUICKACK
option - only with linux native transport.setTcpQuickAck
in class NetClientOptions
tcpQuickAck
- the quick ack valuepublic MailConfig setOpenSslEngineOptions(OpenSSLEngineOptions sslEngineOptions)
setOpenSslEngineOptions
in class NetClientOptions
public MailConfig addCrlPath(String crlPath) throws NullPointerException
TCPSSLOptions
addCrlPath
in class NetClientOptions
crlPath
- the pathNullPointerException
public MailConfig addCrlValue(Buffer crlValue) throws NullPointerException
TCPSSLOptions
addCrlValue
in class NetClientOptions
crlValue
- the valueNullPointerException
public MailConfig setConnectTimeout(int connectTimeout)
ClientOptionsBase
setConnectTimeout
in class NetClientOptions
connectTimeout
- connect timeout, in mspublic MailConfig setMetricsName(String metricsName)
ClientOptionsBase
setMetricsName
in class NetClientOptions
metricsName
- the metrics namepublic MailConfig setReconnectAttempts(int attempts)
NetClientOptions
setReconnectAttempts
in class NetClientOptions
attempts
- the maximum number of reconnect attemptspublic MailConfig setReconnectInterval(long interval)
NetClientOptions
setReconnectInterval
in class NetClientOptions
interval
- the reconnect interval in mspublic MailConfig setHostnameVerificationAlgorithm(String hostnameVerificationAlgorithm)
NetClientOptions
setHostnameVerificationAlgorithm
in class NetClientOptions
hostnameVerificationAlgorithm
- should be HTTPS, LDAPS or an empty Stringpublic MailConfig setLogActivity(boolean logEnabled)
NetworkOptions
setLogActivity
in class NetClientOptions
logEnabled
- true for logging the network activitypublic MailConfig setProxyOptions(ProxyOptions proxyOptions)
ClientOptionsBase
setProxyOptions
in class NetClientOptions
proxyOptions
- proxy options objectpublic MailConfig setLocalAddress(String localAddress)
ClientOptionsBase
setLocalAddress
in class NetClientOptions
localAddress
- the local addresspublic MailConfig setSslHandshakeTimeout(long sslHandshakeTimeout)
TCPSSLOptions
setSslHandshakeTimeout
in class NetClientOptions
sslHandshakeTimeout
- the SSL handshake timeout to set, in millisecondspublic MailConfig setSslHandshakeTimeoutUnit(TimeUnit sslHandshakeTimeoutUnit)
TCPSSLOptions
setSslHandshakeTimeoutUnit
in class NetClientOptions
sslHandshakeTimeoutUnit
- specify time unit.public String getHostname()
public MailConfig setHostname(String hostname)
hostname
- the hostname (default is localhost)public int getPort()
public MailConfig setPort(int port)
port
- the port (default is 25)public StartTLSOptions getStarttls()
public MailConfig setStarttls(StartTLSOptions starttls)
Either NONE, OPTIONAL or REQUIRED
starttls
- (default is OPTIONAL)public LoginOption getLogin()
public MailConfig setLogin(LoginOption login)
Either DISABLED, OPTIONAL or REQUIRED
login
- (default is OPTIONAL)public String getUsername()
public MailConfig setUsername(String username)
username
- the usernamepublic String getPassword()
public MailConfig setPassword(String password)
password
- the passwordpublic MailConfig setSsl(boolean isSsl)
TCPSSLOptions
setSsl
in class NetClientOptions
isSsl
- true if enabledpublic MailConfig setEnabledSecureTransportProtocols(Set<String> enabledSecureTransportProtocols)
TCPSSLOptions
setEnabledSecureTransportProtocols
in class NetClientOptions
enabledSecureTransportProtocols
- the SSL/TLS protocols to enablepublic MailConfig setTrustAll(boolean trustAll)
ClientOptionsBase
setTrustAll
in class NetClientOptions
trustAll
- true if all should be trusted@Deprecated public String getKeyStore()
TCPSSLOptions.getTrustStoreOptions()
@Deprecated public MailConfig setKeyStore(String keyStore)
TCPSSLOptions.getTrustStoreOptions()
if not set, an options object will be created based on other settings (ssl and trustAll)
keyStore
- the key store filename to be set@Deprecated public String getKeyStorePassword()
TCPSSLOptions.getTrustStoreOptions()
@Deprecated public MailConfig setKeyStorePassword(String keyStorePassword)
TCPSSLOptions.getTrustStoreOptions()
keyStorePassword
- the key store passwords to be setpublic String getAuthMethods()
public MailConfig setAuthMethods(String authMethods)
authMethods
- the authMethods to setpublic String getOwnHostname()
public MailConfig setOwnHostname(String ownHostname)
ownHostname
- my own hostname to setpublic int getMaxPoolSize()
public MailConfig setMaxPoolSize(int maxPoolSize)
public boolean isKeepAlive()
if the connection pooling is disabled, the max number of sockets is enforced nevertheless
public MailConfig setKeepAlive(boolean keepAlive)
if the connection pooling is disabled, the max number of sockets is enforced nevertheless
public boolean isAllowRcptErrors()
if true, the mail will be sent to the recipients that the server accepted, if any
public MailConfig setAllowRcptErrors(boolean allowRcptErrors)
if true, the mail will be sent to the recipients that the server accepted, if any
allowRcptErrors
- the allowRcptErrors to set (default is false)public boolean isDisableEsmtp()
rfc 1869 states that clients should always attempt EHLO as first command to determine if ESMTP is supported, if this returns an error code, HELO is tried to use old SMTP. If there is a server that does not support EHLO and does not give an error code back, the connection should be closed and retried with HELO. We do not do that and rather support turning off ESMTP with a setting. The odds of this actually happening are very small since the client will not connect to arbitrary smtp hosts on the internet. Since the client knows that is connects to a host that doesn't support ESMTP/EHLO in that way, the property has to be set to false.
public MailConfig setDisableEsmtp(boolean disableEsmtp)
rfc 1869 states that clients should always attempt EHLO as first command to determine if ESMTP is supported, if this returns an error code, HELO is tried to use old SMTP. If there is a server that does not support EHLO and does not give an error code back, the connection should be closed and retried with HELO. We do not do that and rather support turning off ESMTP with a setting. The odds of this actually happening are very small since the client will not connect to arbitrary smtp hosts on the internet. Since the client knows that is connects to a host that doesn't support ESMTP/EHLO in that way, the property has to be set to false.
disableEsmtp
- the disableEsmtp to set (default is true)public String getUserAgent()
public MailConfig setUserAgent(String userAgent)
It is used to generate the boundary in case of MultiPart email and the Message-ID.
If null
is set, DEFAULT_USER_AGENT is used.
userAgent
- the Mail User Agent(MUA) name used to generate boundary and message id
length of userAgent must be smaller than 40 so that the generated boundary
has no longer 70 characters.public boolean isEnableDKIM()
public MailConfig setEnableDKIM(boolean enableDKIM)
This is used most for temporary disable DKIM without removing DKIM opations from current config.
enableDKIM
- if DKIM Singature should be enabledpublic List<DKIMSignOptions> getDKIMSignOptions()
public MailConfig addDKIMSignOption(DKIMSignOptions dkimSignOptions)
dkimSignOptions
- the DKIMSignOptionspublic MailConfig setDKIMSignOptions(List<DKIMSignOptions> dkimSignOptions)
dkimSignOptions
- the DKIM optionspublic MailConfig setDKIMSignOption(DKIMSignOptions dkimSignOptions)
dkimSignOptions
- the DKIM optionspublic DKIMSignOptions getDKIMSignOption()
public boolean isPipelining()
public MailConfig setPipelining(boolean pipelining)
pipelining
- enable pipelining or notpublic boolean isMultiPartOnly()
public MailConfig setMultiPartOnly(boolean multiPartOnly)
true
, the mail message will be encoded as multipart even for simple mails without
attachments, see https://github.com/vert-x3/vertx-mail-client/issues/161.multiPartOnly
- encoded as multipart only or not, default to false
.public int getPoolCleanerPeriod()
public MailConfig setPoolCleanerPeriod(int poolCleanerPeriod)
poolCleanerPeriod
- the pool cleaner periodpublic int getKeepAliveTimeout()
public MailConfig setKeepAliveTimeout(int keepAliveTimeout)
0
means there is no timeout.keepAliveTimeout
- the timeout, in secondspublic TimeUnit getPoolCleanerPeriodUnit()
TimeUnit
of pool cleaning period. Defaults to TimeUnit.MILLISECONDS
TimeUnit
of the pool cleaning period.public MailConfig setPoolCleanerPeriodUnit(TimeUnit poolCleanerPeriodUnit)
TimeUnit
of pool cleaning period.poolCleanerPeriodUnit
- the TimeUnit
of the pool cleaning period.public TimeUnit getKeepAliveTimeoutUnit()
TimeUnit
of keeping the connections alive timeout. Defaults to TimeUnit.SECONDS
TimeUnit
of keeping the connections alive timeoutpublic MailConfig setKeepAliveTimeoutUnit(TimeUnit keepAliveTimeoutUnit)
TimeUnit
of keeping connections in the pool alive.keepAliveTimeoutUnit
- the TimeUnit
of keeping the connections alive timeoutpublic String getNtDomain()
public MailConfig setNtDomain(String ntDomain)
ntDomain
- the NTLM domainpublic String getWorkstation()
public MailConfig setWorkstation(String workstation)
workstation
- the workstationpublic MailConfig setMaxMailsPerConnection(long maxMailsPerConnection)
Some SMTP servers have requirement to allow only a number of emails sent per connection.
maxMailsPerConnection
- the emails count per connectionpublic long getMaxMailsPerConnection()
public JsonObject toJson()
toJson
in class NetClientOptions
Copyright © 2024 Eclipse. All rights reserved.