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

  • 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

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

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

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

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

getPort

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

    Returns number

getProxyOptions

  • getProxyOptions(): ProxyOptions
  • Returns ProxyOptions

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

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

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

isPipelining

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

    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

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

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

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

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

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

setPort

  • Set the port of the smtp server.

    Parameters

    • port: number

    Returns MailConfig

setProxyOptions

  • setProxyOptions(proxyOptions: ProxyOptions): MailConfig
  • Parameters

    • proxyOptions: ProxyOptions

    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

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

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

Generated using TypeDoc