Class MailerRuntimeConfig
-
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanSets if sending allows recipients errors.Allows sending emails to these recipients only.Sets the allowed authentication methods.Sets the default bounce email address.booleanDisable ESMTP.Configures DKIM signature verification.Sets the default `from` attribute when not specified in theMailinstance.Sets the SMTP host name.booleanSets if connection pool is enabled.Set the keep alive timeout for the SMTP connection.Deprecated.Use the TLS registry instead.Deprecated.Use the TLS registry instead.Sets the login mode for the connection.booleanLog invalid recipients as warnings.booleanLog rejected recipients as warnings.intSets the max number of open connections to the mail server.Enables the mock mode.booleanWhether the mail should always been sent as multipart even if they don't have attachments.Configures NTLM (Windows New Technology LAN Manager).Sets the hostname to be used for HELO/EHLO and the Message-ID.Sets the password to connect to the SMTP server.booleanEnables or disables the pipelining capability if the SMTP server supports it.Sets the connection pool cleaner period.The SMTP port.booleanDeprecated.Use {tls}Sets the TLS security mode for the connection.Whether the connection should be secured using TLS.The name of the TLS configuration to use.Deprecated.Use the TLS registry instead.Deprecated.Use the TLS registry instead.Sets the username to connect to the SMTP server. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
from
Sets the default `from` attribute when not specified in theMailinstance. It's the sender email address. -
mock
Enables the mock mode. When enabled, mails are not sent, but stored in an in-memory mailbox. The content of the emails is also printed on the console.Disabled by default on PROD, enabled by default on DEV and TEST modes.
-
bounceAddress
Sets the default bounce email address. A bounced email, or bounce, is an email message that gets rejected by a mail server. -
host
Sets the SMTP host name. -
port
The SMTP port. The default value depends on the configuration. The port 25 is used as default whensslis disabled. This port continues to be used primarily for SMTP relaying. SMTP relaying is the transmission of email from email server to email server. The port 587 is the default port whensslis enabled. It ensures that email is submitted securely.Note that the port 465 may be used by SMTP servers, however, IANA has reassigned a new service to this port, and it should no longer be used for SMTP communications.
-
username
Sets the username to connect to the SMTP server. -
password
Sets the password to connect to the SMTP server. -
tlsConfigurationName
The name of the TLS configuration to use.If a name is configured, it uses the configuration from
quarkus.tls.<name>.*If a name is configured, but no TLS configuration is found with that name then an error will be thrown.If no TLS configuration name is set then, the specific TLS configuration (from
quarkus.mailer.*) will be used.The default TLS configuration is not used by default.
-
ssl
Deprecated.Use {tls}Enables or disables the TLS/SSL. -
tls
Whether the connection should be secured using TLS.SMTP allows establishing connection with or without TLS. When establishing a connection with TLS, the connection is secured and encrypted. When establishing a connection without TLS, it can be secured and encrypted later using the STARTTLS command. In this case, the connection is initially unsecured and unencrypted. To configure this case, set this property to
falseandstartTLStoREQUIREDNote that if a TLS configuration is set, TLS is enabled automatically. So, setting this property tofalseis required to not establish a connection with TLS. -
trustAll
Deprecated.Use the TLS registry instead.Set whether all server certificates should be trusted. This option is only used whensslis enabled. -
maxPoolSize
@ConfigItem(defaultValue="10") public int maxPoolSizeSets the max number of open connections to the mail server. -
ownHostName
Sets the hostname to be used for HELO/EHLO and the Message-ID. -
keepAlive
@ConfigItem(defaultValue="true") public boolean keepAliveSets if connection pool is enabled. If the connection pooling is disabled, the max number of sockets is enforced nevertheless. -
disableEsmtp
@ConfigItem(defaultValue="false") public boolean disableEsmtpDisable ESMTP.The RFC-1869 states that clients should always attempt
EHLOas first command to determine if ESMTP is supported, if this returns an error code,HELOis tried to use the regular SMTP command. -
startTLS
Sets the TLS security mode for the connection. EitherDISABLED,OPTIONALorREQUIRED. -
dkim
Configures DKIM signature verification. -
login
Sets the login mode for the connection. EitherNONE, @{code DISABLED},OPTIONAL,REQUIREDorXOAUTH2.- DISABLED means no login will be attempted
- NONE means a login will be attempted if the server supports in and login credentials are set
- REQUIRED means that a login will be attempted if the server supports it and the send operation will fail otherwise
- XOAUTH2 means that a login will be attempted using Google Gmail Oauth2 tokens
-
authMethods
Sets the allowed authentication methods. These methods will be used only if the server supports them. If not set, all supported methods may be used.The list is given as a space separated list, such as
DIGEST-MD5 CRAM-SHA256 CRAM-SHA1 CRAM-MD5 PLAIN LOGIN. -
keyStore
Deprecated.Use the TLS registry instead.Set the trust store. -
keyStorePassword
Deprecated.Use the TLS registry instead.Sets the trust store password if any. -
truststore
Deprecated.Use the TLS registry instead.Configures the trust store. -
multiPartOnly
@ConfigItem(defaultValue="false") public boolean multiPartOnlyWhether the mail should always been sent as multipart even if they don't have attachments. When sets to true, the mail message will be encoded as multipart even for simple mails without attachments. -
allowRcptErrors
@ConfigItem(defaultValue="false") public boolean allowRcptErrorsSets if sending allows recipients errors. If set to true, the mail will be sent to the recipients that the server accepted, if any. -
pipelining
@ConfigItem(defaultValue="true") public boolean pipeliningEnables or disables the pipelining capability if the SMTP server supports it. -
poolCleanerPeriod
Sets the connection pool cleaner period. Zero disables expiration checks and connections will remain in the pool until they are closed. -
keepAliveTimeout
Set the keep alive timeout for the SMTP connection. This value determines how long a connection remains unused in the pool before being evicted and closed. A timeout of 0 means there is no timeout. -
ntlm
Configures NTLM (Windows New Technology LAN Manager). -
approvedRecipients
@ConfigItem @ConvertWith(TrimmedPatternConverter.class) public Optional<List<Pattern>> approvedRecipientsAllows sending emails to these recipients only.Approved recipients are compiled to a
Patternand must be a valid regular expression. The createdPatternis case-insensitive as emails are case insensitive. Provided patterns are trimmed before being compiled. -
logRejectedRecipients
@ConfigItem(defaultValue="false") public boolean logRejectedRecipientsLog rejected recipients as warnings.If false, the rejected recipients will be logged at the DEBUG level.
-
logInvalidRecipients
@ConfigItem(defaultValue="false") public boolean logInvalidRecipientsLog invalid recipients as warnings.If false, the invalid recipients will not be logged and the thrown exception will not contain the invalid email address.
-
-
Constructor Details
-
MailerRuntimeConfig
public MailerRuntimeConfig()
-