LmtpClient
Defined in: packages/net-smtp/src/lmtp/lmtp-client.ts:24
LMTP client over any transport.
LMTP (RFC 2033) is SMTP with LHLO in place of EHLO and, critically, one
reply per recipient after the message body instead of a single reply.
It extends SmtpCore rather than SmtpClient precisely because of that
difference: inheriting SmtpClient.data() would expose a method that reads
only the first recipient’s reply and leaves the rest to be mis-attributed to
the next command.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new LmtpClient(
source,options?):LmtpClient
Defined in: packages/net-smtp/src/lmtp/lmtp-client.ts:31
Parameters
Section titled “Parameters”source
Section titled “source”Transport
Any Transport. Dovecot LMTP is commonly reached over
a Unix socket — for a Node.js Duplex/net.Socket, wrap it first: new DuplexTransport(socket) from @ac-kit/net-transport-node.
options?
Section titled “options?”Buffer, line-length and timeout tuning.
Returns
Section titled “Returns”LmtpClient
Overrides
Section titled “Overrides”Accessors
Section titled “Accessors”buffered
Section titled “buffered”Get Signature
Section titled “Get Signature”get buffered():
number
Defined in: packages/net-core/src/session.ts:243
Bytes received but not yet decoded.
Returns
Section titled “Returns”number
Inherited from
Section titled “Inherited from”pendingExchanges
Section titled “pendingExchanges”Get Signature
Section titled “Get Signature”get pendingExchanges():
number
Defined in: packages/net-core/src/session.ts:248
Number of outstanding exchanges, including abort tombstones.
Returns
Section titled “Returns”number
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”[asyncDispose]()
Section titled “[asyncDispose]()”[asyncDispose]():
Promise<void>
Defined in: packages/net-core/src/session.ts:277
Destroys the session, so it can be used with await using.
Returns
Section titled “Returns”Promise<void>
Inherited from
Section titled “Inherited from”command()
Section titled “command()”command(
command,options?):Promise<SmtpResponse>
Defined in: packages/net-smtp/src/smtp/smtp-client.ts:208
Send a raw command line and read its reply.
Parameters
Section titled “Parameters”command
Section titled “command”string
The command line, without a terminator.
options?
Section titled “options?”ExchangeOptions<string>
Abort, timeout and abort-policy overrides.
Returns
Section titled “Returns”Promise<SmtpResponse>
The parsed reply.
Inherited from
Section titled “Inherited from”dataMulti()
Section titled “dataMulti()”dataMulti(
message,recipientCount,options?):Promise<SmtpResponse[]>
Defined in: packages/net-smtp/src/lmtp/lmtp-client.ts:64
Run the DATA exchange and read one reply per accepted recipient.
Replies arrive in the order the corresponding RCPT TO commands were
issued (RFC 2033 §4.2).
Parameters
Section titled “Parameters”message
Section titled “message”string
The raw message body; dot-stuffing is applied automatically.
recipientCount
Section titled “recipientCount”number
Number of RCPT TO commands the server accepted.
options?
Section titled “options?”ExchangeOptions<string>
Abort, timeout and abort-policy overrides.
Returns
Section titled “Returns”Promise<SmtpResponse[]>
One reply per recipient, in RCPT TO order.
Throws
Section titled “Throws”If the server does not answer 354.
destroy()
Section titled “destroy()”destroy(
error?):void
Defined in: packages/net-core/src/session.ts:271
Tear the session down, rejecting every outstanding exchange.
Rejection happens here rather than relying on the transport emitting
close, so callers are never left with promises that hang against a
transport that closes silently.
Parameters
Section titled “Parameters”error?
Section titled “error?”unknown
Optional cause reported to outstanding exchanges.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”ehlo()
Section titled “ehlo()”ehlo(
domain,options?):Promise<SmtpResponse>
Defined in: packages/net-smtp/src/smtp/smtp-client.ts:112
Send EHLO domain and return the advertised extensions.
Parameters
Section titled “Parameters”domain
Section titled “domain”string
The client’s own domain name.
options?
Section titled “options?”ExchangeOptions<string>
Abort, timeout and abort-policy overrides.
Returns
Section titled “Returns”Promise<SmtpResponse>
The parsed reply, one entry per capability line.
Inherited from
Section titled “Inherited from”end():
Promise<void>
Defined in: packages/net-core/src/session.ts:258
Half-close the outbound direction and flush pending writes.
Prefer this over destroy for protocols with a farewell command, so the peer sees an orderly shutdown.
Returns
Section titled “Returns”Promise<void>
Inherited from
Section titled “Inherited from”isSubscribed()
Section titled “isSubscribed()”isSubscribed<
K>(event,listener):boolean
Defined in: packages/async/src/events/event-dispatcher-map-base.ts:38
Check if a callback is subscribed to a specific event.
Type Parameters
Section titled “Type Parameters”K extends "push" | keyof BaseSessionEvents
Parameters
Section titled “Parameters”K
The event name.
listener
Section titled “listener”Callable<SmtpClientEvents[K]>
The callback to check.
Returns
Section titled “Returns”boolean
Inherited from
Section titled “Inherited from”lhlo()
Section titled “lhlo()”lhlo(
domain,options?):Promise<SmtpResponse>
Defined in: packages/net-smtp/src/lmtp/lmtp-client.ts:45
Send LHLO domain, the LMTP greeting.
Parameters
Section titled “Parameters”domain
Section titled “domain”string
The client’s own domain name.
options?
Section titled “options?”ExchangeOptions<string>
Abort, timeout and abort-policy overrides.
Returns
Section titled “Returns”Promise<SmtpResponse>
The parsed reply, one entry per capability line.
mailFrom()
Section titled “mailFrom()”mailFrom(
address,params?,options?):Promise<SmtpResponse>
Defined in: packages/net-smtp/src/smtp/smtp-client.ts:127
Send MAIL FROM:<address>.
Parameters
Section titled “Parameters”address
Section titled “address”string
The reverse-path, without angle brackets.
params?
Section titled “params?”string
Optional ESMTP parameters, for example SIZE=1234.
options?
Section titled “options?”ExchangeOptions<string>
Abort, timeout and abort-policy overrides.
Returns
Section titled “Returns”Promise<SmtpResponse>
The parsed reply.
Inherited from
Section titled “Inherited from”quit()
Section titled “quit()”quit(
options?):Promise<SmtpResponse>
Defined in: packages/net-smtp/src/smtp/smtp-client.ts:197
Send QUIT and read the farewell reply.
Parameters
Section titled “Parameters”options?
Section titled “options?”ExchangeOptions<string>
Abort, timeout and abort-policy overrides.
Returns
Section titled “Returns”Promise<SmtpResponse>
The parsed reply, normally 221.
Inherited from
Section titled “Inherited from”rcptTo()
Section titled “rcptTo()”rcptTo(
address,options?):Promise<SmtpResponse>
Defined in: packages/net-smtp/src/smtp/smtp-client.ts:145
Send RCPT TO:<address>.
Parameters
Section titled “Parameters”address
Section titled “address”string
The forward-path, without angle brackets.
options?
Section titled “options?”ExchangeOptions<string>
Abort, timeout and abort-policy overrides.
Returns
Section titled “Returns”Promise<SmtpResponse>
The parsed reply.
Inherited from
Section titled “Inherited from”subscribe()
Section titled “subscribe()”subscribe<
K>(event,listener,options?):Callable|null
Defined in: packages/async/src/events/event-dispatcher-map-base.ts:23
Type Parameters
Section titled “Type Parameters”K extends "push" | keyof BaseSessionEvents
Parameters
Section titled “Parameters”K
listener
Section titled “listener”Callable<SmtpClientEvents[K]>
options?
Section titled “options?”EventDispatcherSubscribeOptions
Returns
Section titled “Returns”Callable | null
Inherited from
Section titled “Inherited from”unsubscribe()
Section titled “unsubscribe()”unsubscribe<
K>(event,listener):void
Defined in: packages/async/src/events/event-dispatcher-map-base.ts:31
Unsubscribe a callback from a specific event.
Type Parameters
Section titled “Type Parameters”K extends "push" | keyof BaseSessionEvents
Parameters
Section titled “Parameters”K
The event name.
listener
Section titled “listener”Callable<SmtpClientEvents[K]>
The callback to remove.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”upgradeTransport()
Section titled “upgradeTransport()”upgradeTransport(
transport):void
Defined in: packages/net-smtp/src/smtp/smtp-client.ts:229
Replace the transport after a successful STARTTLS.
Buffered plaintext is discarded rather than carried across: bytes a peer sent before the handshake must never be read as part of the secured session, which is the STARTTLS command-injection flaw.
Parameters
Section titled “Parameters”transport
Section titled “transport”Transport
The TLS transport wrapping the same connection.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”wait()
Section titled “wait()”wait<
K>(event,options?):Promise<SmtpClientEvents[K]>
Defined in: packages/async/src/events/event-dispatcher-map-base.ts:45
Wait for the next occurrence of a specific event, optionally matching a predicate.
This is a convenience method that subscribes to the dispatcher, waits for the next event that matches the predicate (if provided), and then unsubscribes automatically.
Type Parameters
Section titled “Type Parameters”K extends "push" | keyof BaseSessionEvents
Parameters
Section titled “Parameters”K
The event name to wait for.
options?
Section titled “options?”EventDispatcherWaitOptions<SmtpClientEvents[K]>
Optional settings including predicate and abort signal.
Returns
Section titled “Returns”Promise<SmtpClientEvents[K]>
A promise that resolves with the event arguments as an array.