Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MailConfig

represents the configuration of a mail service with mail server hostname, port, security options, login options and login/password

Hierarchy

  • any
    • MailConfig

Index

Constructors

Methods

Constructors

constructor

  • Returns MailConfig

  • Parameters

    Returns MailConfig

Methods

addCrlPath

  • Parameters

    • crlPaths: string

    Returns MailConfig

addCrlValue

  • Parameters

    • crlValues: Buffer

    Returns MailConfig

addDKIMSignOption

  • Sets DKIMSignOptions.

    Parameters

    Returns MailConfig

addEnabledCipherSuite

  • addEnabledCipherSuite(enabledCipherSuites: string): MailConfig
  • Parameters

    • enabledCipherSuites: string

    Returns MailConfig

addEnabledSecureTransportProtocol

  • addEnabledSecureTransportProtocol(enabledSecureTransportProtocols: string): MailConfig
  • Parameters

    • enabledSecureTransportProtocols: string

    Returns MailConfig

addNonProxyHost

  • addNonProxyHost(nonProxyHosts: string): MailConfig
  • Parameters

    • nonProxyHosts: string

    Returns MailConfig

getActivityLogDataFormat

  • getActivityLogDataFormat(): any
  • Returns any

getApplicationLayerProtocols

  • getApplicationLayerProtocols(): string[]
  • Returns string[]

getAuthMethods

  • getAuthMethods(): string
  • set string of allowed auth methods. if set only these methods will be used if the server supports them. If null or empty all supported methods may be used

    Returns string

getConnectTimeout

  • getConnectTimeout(): number
  • Returns number

getCrlPaths

  • getCrlPaths(): string[]
  • Returns string[]

getCrlValues

  • getCrlValues(): Buffer[]
  • Returns Buffer[]

getDKIMSignOption

  • Sets one DKIMSignOptions for convenient.

    Returns DKIMSignOptions

getDKIMSignOptions

  • Sets DKIMSignOptions.

    Returns DKIMSignOptions[]

getEnabledCipherSuites

  • getEnabledCipherSuites(): string[]
  • Returns string[]

getEnabledSecureTransportProtocols

  • getEnabledSecureTransportProtocols(): string[]
  • Returns string[]

getHostname

  • getHostname(): string
  • Set the hostname of the smtp server.

    Returns string

getHostnameVerificationAlgorithm

  • getHostnameVerificationAlgorithm(): string
  • Returns string

getIdleTimeout

  • getIdleTimeout(): number
  • Returns number

getIdleTimeoutUnit

  • getIdleTimeoutUnit(): any
  • Returns any

getJdkSslEngineOptions

  • getJdkSslEngineOptions(): JdkSSLEngineOptions
  • Returns JdkSSLEngineOptions

getKeepAliveTimeout

  • getKeepAliveTimeout(): number
  • Set the keep alive timeout for SMTP connection, Defaults in seconds.

    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.

    Returns number

getKeepAliveTimeoutUnit

  • getKeepAliveTimeoutUnit(): any
  • Sets TimeUnit of keeping connections in the pool alive.

    Returns any

getKeyStore

  • getKeyStore(): string
  • get the key store filename to be used when opening SMTP connections

    if not set, an options object will be created based on other settings (ssl and trustAll)

    Returns string

getKeyStoreOptions

  • getKeyStoreOptions(): JksOptions
  • Returns JksOptions

getKeyStorePassword

  • getKeyStorePassword(): string
  • get the key store password to be used when opening SMTP connections

    Returns string

getLocalAddress

  • getLocalAddress(): string
  • Returns string

getLogActivity

  • getLogActivity(): boolean
  • Returns boolean

getLogin

  • Set the login mode for the connection.

    Either DISABLED, OPTIONAL or REQUIRED

    Returns LoginOption

getMaxMailsPerConnection

  • getMaxMailsPerConnection(): number
  • Sets the max emails count per connection before it gets closed.

    Some SMTP servers have requirement to allow only a number of emails sent per connection.

    Returns number

getMaxPoolSize

  • getMaxPoolSize(): number
  • set the max allowed number of open connections to the mail server if not set the default is 10

    Returns number

getMetricsName

  • getMetricsName(): string
  • Returns string

getNonProxyHosts

  • getNonProxyHosts(): string[]
  • Returns string[]

getNtDomain

  • getNtDomain(): string
  • Sets the domain used on NTLM authentication

    Returns string

getOpenSslEngineOptions

  • getOpenSslEngineOptions(): OpenSSLEngineOptions
  • Returns OpenSSLEngineOptions

getOwnHostname

  • getOwnHostname(): string
  • set the hostname to be used for HELO/EHLO and the Message-ID

    Returns string

getPassword

  • getPassword(): string
  • Set the password for the login.

    Returns string

getPemKeyCertOptions

  • getPemKeyCertOptions(): PemKeyCertOptions
  • Returns PemKeyCertOptions

getPemTrustOptions

  • getPemTrustOptions(): PemTrustOptions
  • Returns PemTrustOptions

getPfxKeyCertOptions

  • getPfxKeyCertOptions(): PfxOptions
  • Returns PfxOptions

getPfxTrustOptions

  • getPfxTrustOptions(): PfxOptions
  • Returns PfxOptions

getPoolCleanerPeriod

  • getPoolCleanerPeriod(): number
  • 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.

    Returns number

getPoolCleanerPeriodUnit

  • getPoolCleanerPeriodUnit(): any
  • Sets the TimeUnit of pool cleaning period.

    Returns any

getPort

  • getPort(): number
  • Set the port of the smtp server.

    Returns number

getProxyOptions

  • getProxyOptions(): ProxyOptions
  • Returns ProxyOptions

getReadIdleTimeout

  • getReadIdleTimeout(): number
  • Returns number

getReceiveBufferSize

  • getReceiveBufferSize(): number
  • Returns number

getReconnectAttempts

  • getReconnectAttempts(): number
  • Returns number

getReconnectInterval

  • getReconnectInterval(): number
  • Returns number

getSendBufferSize

  • getSendBufferSize(): number
  • Returns number

getSoLinger

  • getSoLinger(): number
  • Returns number

getSslEngineOptions

  • getSslEngineOptions(): any
  • Returns any

getSslHandshakeTimeout

  • getSslHandshakeTimeout(): number
  • Returns number

getSslHandshakeTimeoutUnit

  • getSslHandshakeTimeoutUnit(): any
  • Returns any

getStarttls

  • Set the tls security mode for the connection.

    Either NONE, OPTIONAL or REQUIRED

    Returns StartTLSOptions

getTcpUserTimeout

  • getTcpUserTimeout(): number
  • Returns number

getTrafficClass

  • getTrafficClass(): number
  • Returns number

getTrustOptions

  • getTrustOptions(): any
  • Returns any

getTrustStoreOptions

  • getTrustStoreOptions(): JksOptions
  • Returns JksOptions

getUserAgent

  • getUserAgent(): string
  • Sets the Mail User Agent(MUA) name.

    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.

    Returns string

getUsername

  • getUsername(): string
  • Set the username for the login.

    Returns string

getWorkstation

  • getWorkstation(): string
  • Sets the workstation used on NTLM authentication

    Returns string

getWriteIdleTimeout

  • getWriteIdleTimeout(): number
  • Returns number

isAllowRcptErrors

  • isAllowRcptErrors(): boolean
  • set if sending allows rcpt errors

    if true, the mail will be sent to the recipients that the server accepted, if any

    Returns boolean

isDisableEsmtp

  • isDisableEsmtp(): boolean
  • set if ESMTP should be tried as first command (EHLO)

    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.

    Returns boolean

isEnableDKIM

  • isEnableDKIM(): boolean
  • Sets true to enable DKIM Signatures, sets false to disable it.

    This is used most for temporary disable DKIM without removing DKIM opations from current config.

    Returns boolean

isKeepAlive

  • isKeepAlive(): boolean
  • set if connection pool is enabled default is true

    if the connection pooling is disabled, the max number of sockets is enforced nevertheless

    Returns boolean

isMultiPartOnly

  • isMultiPartOnly(): boolean
  • Sets to encode multipart only or not.

    When sets to 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.

    Returns boolean

isPipelining

  • isPipelining(): boolean
  • Sets to enable/disable the pipelining capability if SMTP server supports it.

    Returns boolean

isRegisterWriteHandler

  • isRegisterWriteHandler(): boolean
  • Returns boolean

isReuseAddress

  • isReuseAddress(): boolean
  • Returns boolean

isReusePort

  • isReusePort(): boolean
  • Returns boolean

isSsl

  • isSsl(): boolean
  • Returns boolean

isTcpCork

  • isTcpCork(): boolean
  • Returns boolean

isTcpFastOpen

  • isTcpFastOpen(): boolean
  • Returns boolean

isTcpKeepAlive

  • isTcpKeepAlive(): boolean
  • Returns boolean

isTcpNoDelay

  • isTcpNoDelay(): boolean
  • Returns boolean

isTcpQuickAck

  • isTcpQuickAck(): boolean
  • Returns boolean

isTrustAll

  • isTrustAll(): boolean
  • Returns boolean

isUseAlpn

  • isUseAlpn(): boolean
  • Returns boolean

setActivityLogDataFormat

  • setActivityLogDataFormat(activityLogDataFormat: any): MailConfig
  • Parameters

    • activityLogDataFormat: any

    Returns MailConfig

setAllowRcptErrors

  • setAllowRcptErrors(allowRcptErrors: boolean): MailConfig
  • set if sending allows rcpt errors

    if true, the mail will be sent to the recipients that the server accepted, if any

    Parameters

    • allowRcptErrors: boolean

    Returns MailConfig

setApplicationLayerProtocols

  • setApplicationLayerProtocols(applicationLayerProtocols: string[]): MailConfig
  • Parameters

    • applicationLayerProtocols: string[]

    Returns MailConfig

setAuthMethods

  • set string of allowed auth methods. if set only these methods will be used if the server supports them. If null or empty all supported methods may be used

    Parameters

    • authMethods: string

    Returns MailConfig

setConnectTimeout

  • setConnectTimeout(connectTimeout: number): MailConfig
  • Parameters

    • connectTimeout: number

    Returns MailConfig

setDKIMSignOption

  • Sets one DKIMSignOptions for convenient.

    Parameters

    Returns MailConfig

setDKIMSignOptions

  • Sets DKIMSignOptions.

    Parameters

    Returns MailConfig

setDisableEsmtp

  • setDisableEsmtp(disableEsmtp: boolean): MailConfig
  • set if ESMTP should be tried as first command (EHLO)

    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.

    Parameters

    • disableEsmtp: boolean

    Returns MailConfig

setEnableDKIM

  • Sets true to enable DKIM Signatures, sets false to disable it.

    This is used most for temporary disable DKIM without removing DKIM opations from current config.

    Parameters

    • enableDKIM: boolean

    Returns MailConfig

setEnabledSecureTransportProtocols

  • setEnabledSecureTransportProtocols(enabledSecureTransportProtocols: string[]): MailConfig
  • Parameters

    • enabledSecureTransportProtocols: string[]

    Returns MailConfig

setHostname

  • Set the hostname of the smtp server.

    Parameters

    • hostname: string

    Returns MailConfig

setHostnameVerificationAlgorithm

  • setHostnameVerificationAlgorithm(hostnameVerificationAlgorithm: string): MailConfig
  • Parameters

    • hostnameVerificationAlgorithm: string

    Returns MailConfig

setIdleTimeout

  • Parameters

    • idleTimeout: number

    Returns MailConfig

setIdleTimeoutUnit

  • setIdleTimeoutUnit(idleTimeoutUnit: any): MailConfig
  • Parameters

    • idleTimeoutUnit: any

    Returns MailConfig

setJdkSslEngineOptions

  • setJdkSslEngineOptions(jdkSslEngineOptions: JdkSSLEngineOptions): MailConfig
  • Parameters

    • jdkSslEngineOptions: JdkSSLEngineOptions

    Returns MailConfig

setKeepAlive

  • set if connection pool is enabled default is true

    if the connection pooling is disabled, the max number of sockets is enforced nevertheless

    Parameters

    • keepAlive: boolean

    Returns MailConfig

setKeepAliveTimeout

  • setKeepAliveTimeout(keepAliveTimeout: number): MailConfig
  • Set the keep alive timeout for SMTP connection, Defaults in seconds.

    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.

    Parameters

    • keepAliveTimeout: number

    Returns MailConfig

setKeepAliveTimeoutUnit

  • setKeepAliveTimeoutUnit(keepAliveTimeoutUnit: any): MailConfig
  • Sets TimeUnit of keeping connections in the pool alive.

    Parameters

    • keepAliveTimeoutUnit: any

    Returns MailConfig

setKeyCertOptions

  • setKeyCertOptions(keyCertOptions: any): MailConfig
  • Parameters

    • keyCertOptions: any

    Returns MailConfig

setKeyStore

  • get the key store filename to be used when opening SMTP connections

    if not set, an options object will be created based on other settings (ssl and trustAll)

    Parameters

    • keyStore: string

    Returns MailConfig

setKeyStoreOptions

  • setKeyStoreOptions(keyStoreOptions: JksOptions): MailConfig
  • Parameters

    • keyStoreOptions: JksOptions

    Returns MailConfig

setKeyStorePassword

  • setKeyStorePassword(keyStorePassword: string): MailConfig
  • get the key store password to be used when opening SMTP connections

    Parameters

    • keyStorePassword: string

    Returns MailConfig

setLocalAddress

  • setLocalAddress(localAddress: string): MailConfig
  • Parameters

    • localAddress: string

    Returns MailConfig

setLogActivity

  • setLogActivity(logActivity: boolean): MailConfig
  • Parameters

    • logActivity: boolean

    Returns MailConfig

setLogin

  • Set the login mode for the connection.

    Either DISABLED, OPTIONAL or REQUIRED

    Parameters

    Returns MailConfig

setMaxMailsPerConnection

  • setMaxMailsPerConnection(maxMailsPerConnection: number): MailConfig
  • Sets the max emails count per connection before it gets closed.

    Some SMTP servers have requirement to allow only a number of emails sent per connection.

    Parameters

    • maxMailsPerConnection: number

    Returns MailConfig

setMaxPoolSize

  • set the max allowed number of open connections to the mail server if not set the default is 10

    Parameters

    • maxPoolSize: number

    Returns MailConfig

setMetricsName

  • Parameters

    • metricsName: string

    Returns MailConfig

setMultiPartOnly

  • setMultiPartOnly(multiPartOnly: boolean): MailConfig
  • Sets to encode multipart only or not.

    When sets to 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.

    Parameters

    • multiPartOnly: boolean

    Returns MailConfig

setNonProxyHosts

  • setNonProxyHosts(nonProxyHosts: string[]): MailConfig
  • Parameters

    • nonProxyHosts: string[]

    Returns MailConfig

setNtDomain

  • Sets the domain used on NTLM authentication

    Parameters

    • ntDomain: string

    Returns MailConfig

setOpenSslEngineOptions

  • setOpenSslEngineOptions(openSslEngineOptions: OpenSSLEngineOptions): MailConfig
  • Parameters

    • openSslEngineOptions: OpenSSLEngineOptions

    Returns MailConfig

setOwnHostname

  • set the hostname to be used for HELO/EHLO and the Message-ID

    Parameters

    • ownHostname: string

    Returns MailConfig

setPassword

  • Set the password for the login.

    Parameters

    • password: string

    Returns MailConfig

setPemKeyCertOptions

  • setPemKeyCertOptions(pemKeyCertOptions: PemKeyCertOptions): MailConfig
  • Parameters

    • pemKeyCertOptions: PemKeyCertOptions

    Returns MailConfig

setPemTrustOptions

  • setPemTrustOptions(pemTrustOptions: PemTrustOptions): MailConfig
  • Parameters

    • pemTrustOptions: PemTrustOptions

    Returns MailConfig

setPfxKeyCertOptions

  • setPfxKeyCertOptions(pfxKeyCertOptions: PfxOptions): MailConfig
  • Parameters

    • pfxKeyCertOptions: PfxOptions

    Returns MailConfig

setPfxTrustOptions

  • setPfxTrustOptions(pfxTrustOptions: PfxOptions): MailConfig
  • Parameters

    • pfxTrustOptions: PfxOptions

    Returns MailConfig

setPipelining

  • Sets to enable/disable the pipelining capability if SMTP server supports it.

    Parameters

    • pipelining: boolean

    Returns MailConfig

setPoolCleanerPeriod

  • setPoolCleanerPeriod(poolCleanerPeriod: number): MailConfig
  • 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.

    Parameters

    • poolCleanerPeriod: number

    Returns MailConfig

setPoolCleanerPeriodUnit

  • setPoolCleanerPeriodUnit(poolCleanerPeriodUnit: any): MailConfig
  • Sets the TimeUnit of pool cleaning period.

    Parameters

    • poolCleanerPeriodUnit: any

    Returns MailConfig

setPort

  • Set the port of the smtp server.

    Parameters

    • port: number

    Returns MailConfig

setProxyOptions

  • setProxyOptions(proxyOptions: ProxyOptions): MailConfig
  • Parameters

    • proxyOptions: ProxyOptions

    Returns MailConfig

setReadIdleTimeout

  • setReadIdleTimeout(readIdleTimeout: number): MailConfig
  • Parameters

    • readIdleTimeout: number

    Returns MailConfig

setReceiveBufferSize

  • setReceiveBufferSize(receiveBufferSize: number): MailConfig
  • Parameters

    • receiveBufferSize: number

    Returns MailConfig

setReconnectAttempts

  • setReconnectAttempts(reconnectAttempts: number): MailConfig
  • Parameters

    • reconnectAttempts: number

    Returns MailConfig

setReconnectInterval

  • setReconnectInterval(reconnectInterval: number): MailConfig
  • Parameters

    • reconnectInterval: number

    Returns MailConfig

setRegisterWriteHandler

  • setRegisterWriteHandler(registerWriteHandler: boolean): MailConfig
  • Parameters

    • registerWriteHandler: boolean

    Returns MailConfig

setReuseAddress

  • setReuseAddress(reuseAddress: boolean): MailConfig
  • Parameters

    • reuseAddress: boolean

    Returns MailConfig

setReusePort

  • Parameters

    • reusePort: boolean

    Returns MailConfig

setSendBufferSize

  • setSendBufferSize(sendBufferSize: number): MailConfig
  • Parameters

    • sendBufferSize: number

    Returns MailConfig

setSoLinger

  • Parameters

    • soLinger: number

    Returns MailConfig

setSsl

  • Parameters

    • ssl: boolean

    Returns MailConfig

setSslEngineOptions

  • setSslEngineOptions(sslEngineOptions: any): MailConfig
  • Parameters

    • sslEngineOptions: any

    Returns MailConfig

setSslHandshakeTimeout

  • setSslHandshakeTimeout(sslHandshakeTimeout: number): MailConfig
  • Parameters

    • sslHandshakeTimeout: number

    Returns MailConfig

setSslHandshakeTimeoutUnit

  • setSslHandshakeTimeoutUnit(sslHandshakeTimeoutUnit: any): MailConfig
  • Parameters

    • sslHandshakeTimeoutUnit: any

    Returns MailConfig

setStarttls

  • Set the tls security mode for the connection.

    Either NONE, OPTIONAL or REQUIRED

    Parameters

    Returns MailConfig

setTcpCork

  • Parameters

    • tcpCork: boolean

    Returns MailConfig

setTcpFastOpen

  • setTcpFastOpen(tcpFastOpen: boolean): MailConfig
  • Parameters

    • tcpFastOpen: boolean

    Returns MailConfig

setTcpKeepAlive

  • setTcpKeepAlive(tcpKeepAlive: boolean): MailConfig
  • Parameters

    • tcpKeepAlive: boolean

    Returns MailConfig

setTcpNoDelay

  • Parameters

    • tcpNoDelay: boolean

    Returns MailConfig

setTcpQuickAck

  • setTcpQuickAck(tcpQuickAck: boolean): MailConfig
  • Parameters

    • tcpQuickAck: boolean

    Returns MailConfig

setTcpUserTimeout

  • setTcpUserTimeout(tcpUserTimeout: number): MailConfig
  • Parameters

    • tcpUserTimeout: number

    Returns MailConfig

setTrafficClass

  • setTrafficClass(trafficClass: number): MailConfig
  • Parameters

    • trafficClass: number

    Returns MailConfig

setTrustAll

  • Parameters

    • trustAll: boolean

    Returns MailConfig

setTrustOptions

  • Parameters

    • trustOptions: any

    Returns MailConfig

setTrustStoreOptions

  • setTrustStoreOptions(trustStoreOptions: JksOptions): MailConfig
  • Parameters

    • trustStoreOptions: JksOptions

    Returns MailConfig

setUseAlpn

  • Parameters

    • useAlpn: boolean

    Returns MailConfig

setUserAgent

  • Sets the Mail User Agent(MUA) name.

    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.

    Parameters

    • userAgent: string

    Returns MailConfig

setUsername

  • Set the username for the login.

    Parameters

    • username: string

    Returns MailConfig

setWorkstation

  • Sets the workstation used on NTLM authentication

    Parameters

    • workstation: string

    Returns MailConfig

setWriteIdleTimeout

  • setWriteIdleTimeout(writeIdleTimeout: number): MailConfig
  • Parameters

    • writeIdleTimeout: number

    Returns MailConfig

toJson

  • toJson(): {}
  • Returns {}

    • [key: string]: any

Generated using TypeDoc