Skip to content

Pop3Client

Defined in: packages/net-pop3/src/pop3/pop3-client.ts:74

POP3 client over any transport.

Handles CRLF framing, single-line and dot-terminated multi-line replies, and dot-unstuffing. Each method maps to one command per RFC 1939.

Replies are strictly ordered, so the default FIFO correlation applies.

The connection is not established here — pass an already-connected stream or transport.

new Pop3Client(source, options?): Pop3Client

Defined in: packages/net-pop3/src/pop3/pop3-client.ts:83

Transport

Any Transport. For a Node.js Duplex/net.Socket, wrap it first: new DuplexTransport(socket) from @ac-kit/net-transport-node.

Pop3ClientOptions

Buffer, line-length and timeout tuning.

Pop3Client

Session<string, string, Pop3ClientEvents>.constructor

get buffered(): number

Defined in: packages/net-core/src/session.ts:243

Bytes received but not yet decoded.

number

Session.buffered


get pendingExchanges(): number

Defined in: packages/net-core/src/session.ts:248

Number of outstanding exchanges, including abort tombstones.

number

Session.pendingExchanges

[asyncDispose](): Promise<void>

Defined in: packages/net-core/src/session.ts:277

Destroys the session, so it can be used with await using.

Promise<void>

Session.[asyncDispose]


capa(options?): Promise<Pop3MultilineResponse>

Defined in: packages/net-pop3/src/pop3/pop3-client.ts:253

Send CAPA and read the capability list.

ExchangeOptions<string>

Abort, timeout and abort-policy overrides.

Promise<Pop3MultilineResponse>


command(command, options?): Promise<Pop3Response>

Defined in: packages/net-pop3/src/pop3/pop3-client.ts:101

Send a command and read its single-line reply.

string

The command line, without a terminator.

ExchangeOptions<string>

Abort, timeout and abort-policy overrides.

Promise<Pop3Response>

The parsed reply.


commandMultiline(command, options?): Promise<Pop3MultilineResponse>

Defined in: packages/net-pop3/src/pop3/pop3-client.ts:120

Send a command and read its status line plus dot-terminated body.

string

The command line, without a terminator.

ExchangeOptions<string>

Abort, timeout and abort-policy overrides.

Promise<Pop3MultilineResponse>

The parsed reply with its body lines, dot-unstuffed.


dele(msg, options?): Promise<Pop3Response>

Defined in: packages/net-pop3/src/pop3/pop3-client.ts:226

Send DELE msg.

number

The message number.

ExchangeOptions<string>

Abort, timeout and abort-policy overrides.

Promise<Pop3Response>


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.

unknown

Optional cause reported to outstanding exchanges.

void

Session.destroy


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.

Promise<void>

Session.end


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.

K extends "push" | keyof BaseSessionEvents

K

The event name.

Callable<Pop3ClientEvents[K]>

The callback to check.

boolean

Session.isSubscribed


list(options?): Promise<Pop3MultilineResponse>

Defined in: packages/net-pop3/src/pop3/pop3-client.ts:190

Send LIST and read every scan listing.

ExchangeOptions<string>

Abort, timeout and abort-policy overrides.

Promise<Pop3MultilineResponse>


listOne(msg, options?): Promise<Pop3Response>

Defined in: packages/net-pop3/src/pop3/pop3-client.ts:200

Send LIST msg for a single message.

number

The message number.

ExchangeOptions<string>

Abort, timeout and abort-policy overrides.

Promise<Pop3Response>


noop(options?): Promise<Pop3Response>

Defined in: packages/net-pop3/src/pop3/pop3-client.ts:235

Send NOOP.

ExchangeOptions<string>

Abort, timeout and abort-policy overrides.

Promise<Pop3Response>


pass(password, options?): Promise<Pop3Response>

Defined in: packages/net-pop3/src/pop3/pop3-client.ts:168

Send PASS password.

string

The mailbox password.

ExchangeOptions<string>

Abort, timeout and abort-policy overrides.

Promise<Pop3Response>


quit(options?): Promise<Pop3Response>

Defined in: packages/net-pop3/src/pop3/pop3-client.ts:244

Send QUIT.

ExchangeOptions<string>

Abort, timeout and abort-policy overrides.

Promise<Pop3Response>


retr(msg, options?): Promise<Pop3MultilineResponse>

Defined in: packages/net-pop3/src/pop3/pop3-client.ts:213

Send RETR msg and read the full message.

number

The message number.

ExchangeOptions<string>

Abort, timeout and abort-policy overrides.

Promise<Pop3MultilineResponse>


stat(options?): Promise<Pop3Response>

Defined in: packages/net-pop3/src/pop3/pop3-client.ts:181

Send STAT.

ExchangeOptions<string>

Abort, timeout and abort-policy overrides.

Promise<Pop3Response>

The +OK count size reply.


stls(options?): Promise<Pop3Response>

Defined in: packages/net-pop3/src/pop3/pop3-client.ts:285

Send STLS. The caller performs the TLS handshake and then calls upgradeTransport.

ExchangeOptions<string>

Abort, timeout and abort-policy overrides.

Promise<Pop3Response>


subscribe<K>(event, listener, options?): Callable | null

Defined in: packages/async/src/events/event-dispatcher-map-base.ts:23

K extends "push" | keyof BaseSessionEvents

K

Callable<Pop3ClientEvents[K]>

EventDispatcherSubscribeOptions

Callable | null

Session.subscribe


uidl(options?): Promise<Pop3MultilineResponse>

Defined in: packages/net-pop3/src/pop3/pop3-client.ts:262

Send UIDL and read every unique identifier.

ExchangeOptions<string>

Abort, timeout and abort-policy overrides.

Promise<Pop3MultilineResponse>


uidlOne(msg, options?): Promise<Pop3Response>

Defined in: packages/net-pop3/src/pop3/pop3-client.ts:272

Send UIDL msg for a single message.

number

The message number.

ExchangeOptions<string>

Abort, timeout and abort-policy overrides.

Promise<Pop3Response>


unsubscribe<K>(event, listener): void

Defined in: packages/async/src/events/event-dispatcher-map-base.ts:31

Unsubscribe a callback from a specific event.

K extends "push" | keyof BaseSessionEvents

K

The event name.

Callable<Pop3ClientEvents[K]>

The callback to remove.

void

Session.unsubscribe


upgradeTransport(transport): void

Defined in: packages/net-pop3/src/pop3/pop3-client.ts:298

Replace the transport after a successful STLS.

Buffered plaintext is discarded rather than carried across, since bytes sent before the handshake must never be read as part of the secured session.

Transport

The TLS transport wrapping the same connection.

void


user(username, options?): Promise<Pop3Response>

Defined in: packages/net-pop3/src/pop3/pop3-client.ts:155

Send USER username.

string

The mailbox name.

ExchangeOptions<string>

Abort, timeout and abort-policy overrides.

Promise<Pop3Response>


wait<K>(event, options?): Promise<Pop3ClientEvents[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.

K extends "push" | keyof BaseSessionEvents

K

The event name to wait for.

EventDispatcherWaitOptions<Pop3ClientEvents[K]>

Optional settings including predicate and abort signal.

Promise<Pop3ClientEvents[K]>

A promise that resolves with the event arguments as an array.

Session.wait