@bumail/smtp 0.2.1 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -105,6 +105,11 @@ const server = createSmtpServer({
105
105
  await server.listen({ port: 465 });
106
106
  ```
107
107
 
108
+ A client has `handshakeTimeout` seconds (default 10) to complete its TLS
109
+ handshake, and holds a slot of `maxConnections` and
110
+ `maxConnectionsPerClient` meanwhile: a socket that never sends its
111
+ ClientHello is closed, without a word.
112
+
108
113
  ## Hooks for policy
109
114
 
110
115
  A hook returns nothing to accept, or a `reply(code, status, text)` with a
@@ -126,7 +131,9 @@ const server = createSmtpServer({
126
131
  onMailFrom: (path) =>
127
132
  path.domain === 'spam.example' ? reply(550, '5.7.1', 'Sender refused') : undefined,
128
133
  onRcptTo: (path) =>
129
- mailboxes.has(path.address.toLowerCase()) ? undefined : reply(550, '5.1.1', 'No such user here'),
134
+ path.postmaster || mailboxes.has(path.address.toLowerCase())
135
+ ? undefined
136
+ : reply(550, '5.1.1', 'No such user here'),
130
137
  async onData(message) {
131
138
  await Bun.write(`spool/${message.id}.eml`, await new Response(message.content).bytes());
132
139
  },
@@ -139,6 +146,33 @@ await server.listen({ port: 25 });
139
146
  The server's own checks run first: `onRcptTo` is never asked about a
140
147
  recipient the server already refused, relaying included.
141
148
 
149
+ `RCPT TO:<postmaster>`, with no domain and in any case, is taken as the
150
+ server's own postmaster (RFC 5321 §4.5.1): it is not relaying, so it needs
151
+ no AUTH, and `localDomains` is not asked. `onRcptTo` gets a `Path` whose
152
+ `postmaster` is `true`, `address` and `local` `'postmaster'` and `domain`
153
+ `''`, and the envelope lists the recipient as `'postmaster'`, with no `@`.
154
+ Route it to a mailbox of your own:
155
+
156
+ ```ts
157
+ import { createSmtpServer } from '@bumail/smtp';
158
+
159
+ const postmaster = 'postmaster@example.com';
160
+
161
+ const server = createSmtpServer({
162
+ hostname: 'mx.example.com',
163
+ localDomains: ['example.com'],
164
+ async onData(message) {
165
+ const recipients = message.envelope.to.map((to) => (to === 'postmaster' ? postmaster : to));
166
+ const bytes = await new Response(message.content).bytes();
167
+ for (const to of recipients) await Bun.write(`spool/${to}/${message.id}.eml`, bytes);
168
+ },
169
+ });
170
+ ```
171
+
172
+ `<postmaster@domain>` is an ordinary path, checked as any other. The
173
+ [guide](https://github.com/softistx/bumail/blob/develop/packages/smtp/docs/guide.md#rcpt-topostmaster)
174
+ has the details.
175
+
142
176
  ## Limits
143
177
 
144
178
  Every limit has a default; each must be a positive integer —
@@ -154,6 +188,8 @@ const server = createSmtpServer({
154
188
  maxMessageSize: 10 * 1024 * 1024, // bytes, announced as SIZE; default 25 MiB → 552 5.3.4
155
189
  maxRecipients: 50, // per message; default 100 → 452 4.5.3
156
190
  maxConnections: 200, // at once; default 1000 → 421 4.3.2
191
+ maxConnectionsPerClient: 5, // at once from one IPv4 address or IPv6 /64; default 10 → 421 4.7.0
192
+ handshakeTimeout: 10, // seconds to complete an implicit TLS handshake; default 10 → closed
157
193
  maxErrors: 5, // failed commands before hanging up; default 10 → 421 4.7.0
158
194
  timeout: 120, // idle seconds, from the client's last byte or the 220; default 300 → 421 4.4.2
159
195
  hookTimeout: 20, // seconds a hook has to settle; default 60 → 451 4.3.0
@@ -286,6 +322,28 @@ host; a 5xx stops. A null MX (RFC 7505) fails at once with `NULL_MX`.
286
322
  back for that many seconds once `onConnect` accepted, so a sender that
287
323
  does not wait gives itself away, as Postfix's postscreen does. A refusal
288
324
  from `onConnect` goes out at once, delay or not.
325
+ - **One client cannot take every slot.** `maxConnectionsPerClient`
326
+ (default 10) bounds the connections one client holds at once, so a
327
+ single host cannot fill `maxConnections`. A client is an IPv4 address,
328
+ or an IPv6 address by its /64; an IPv4-mapped or NAT64 address counts as
329
+ the IPv4 address inside it, so a dual-stack listener counts an IPv4
330
+ client once. One more gets `421 4.7.0 <hostname> Too many connections
331
+ from your address, try later` and is closed, before `onConnect`. Every
332
+ close frees the slot: QUIT, a hang-up, an error, the idle time,
333
+ `stop(true)`. Group addresses the same way in your own policy with
334
+ `clientKey`:
335
+
336
+ ```ts
337
+ import { clientKey } from '@bumail/smtp';
338
+
339
+ clientKey('::ffff:192.0.2.1'); // '192.0.2.1'
340
+ clientKey('2001:db8::1'); // '2001:db8:0:0::/64': four groups, zeros written out
341
+ ```
342
+ - **A TLS handshake is bounded.** On implicit TLS a socket is counted from
343
+ the TCP connection on, before its handshake, and closed past
344
+ `handshakeTimeout` (default 10 seconds) if the handshake has not
345
+ completed; `onConnect` and the greeting come once it has. A STARTTLS
346
+ handshake is bounded by `timeout`.
289
347
  - **Bounded memory.** The server holds 64 KiB of a client's input and of a
290
348
  message at most, and stops reading the client past that; replies to a
291
349
  client that reads slowly wait in the server, and none is lost while the
@@ -363,7 +421,7 @@ host; a 5xx stops. A null MX (RFC 7505) fails at once with `NULL_MX`.
363
421
  | --- | --- |
364
422
  | `createSmtpServer(options)` | the server; throws an `SmtpError` (`INVALID_OPTION`) on a bad option |
365
423
  | `SmtpServer` | `listen({ port, hostname? })` (once; again throws `ALREADY_LISTENING`), `stop(closeConnections?)` (`true` hangs up on every client, after STARTTLS too), `connections` |
366
- | `SmtpServerOptions` | `hostname`, `mode`, `localDomains`, `tls`, `implicitTls`, `authenticate`, the limits, `hookTimeout`, `greetingDelay`, `onError`, and the hooks |
424
+ | `SmtpServerOptions` | `hostname`, `mode`, `localDomains`, `tls`, `implicitTls`, `authenticate`, the limits (`maxConnectionsPerClient` among them), `hookTimeout`, `handshakeTimeout`, `greetingDelay`, `onError`, and the hooks |
367
425
  | `SmtpError`, `SmtpErrorCode` | `code`: `INVALID_OPTION`, `ALREADY_LISTENING`, and what a content stream or `onError` can get: `MESSAGE_TOO_BIG`, `BARE_LINE_BREAK`, `CONNECTION_LOST`, `HOOK_TIMEOUT`, `INVALID_HOOK_REPLY`, `MESSAGE_NOT_READ`; `sendMail`'s are listed below. `temporary`, `reply` and `rejected` are set for `sendMail`'s errors |
368
426
  | `SmtpHooks` | `onConnect`, `onMailFrom`, `onRcptTo`, `onData` |
369
427
  | `HookResult` | what a hook returns: `undefined` to accept, a `Reply` to refuse |
@@ -373,9 +431,10 @@ host; a 5xx stops. A null MX (RFC 7505) fails at once with `NULL_MX`.
373
431
  | `Credentials` | what `authenticate` receives: `mechanism`, `username`, `password`, `authorizationId?` |
374
432
  | `reply(code, status, text)`, `Reply` | a reply, for a hook to refuse with |
375
433
  | `formatReply(reply, enhanced?)` | a reply as sent on the wire, CRLF included |
376
- | `parsePath(text, allowNull, sourceRoute?)`, `Path`, `SourceRoute` | `<local@domain>` (RFC 5321 §4.1.2) to `{ address, local, domain }`; a source route `@a,@b:` is dropped (`'discard'`, the default) or refused (`'refuse'`); a control character, `>` or a lone surrogate anywhere, or an IPv4 literal octet above 255, refuses the path |
434
+ | `parsePath(text, allowNull, sourceRoute?)`, `Path`, `SourceRoute` | `<local@domain>` (RFC 5321 §4.1.2) to `{ address, local, domain }` (and `postmaster: true` for `RCPT TO:<postmaster>`, which `parsePathCommand` gives); a source route `@a,@b:` is dropped (`'discard'`, the default) or refused (`'refuse'`); a control character (C0, DEL or C1), `>`, U+2028 or U+2029, Unicode format character (`\p{Cf}`) or lone surrogate anywhere, or an IPv4 literal octet above 255, refuses the path |
377
435
  | `parseCommand(line)`, `Command` | a command line to `{ verb, argument }` |
378
- | `parsePathCommand(argument, 'FROM' \| 'TO')`, `PathCommand` | the argument of MAIL or RCPT to `{ path, parameters }` |
436
+ | `parsePathCommand(argument, 'FROM' \| 'TO')`, `PathCommand` | the argument of MAIL or RCPT to `{ path, parameters }`; `TO:` also takes `<postmaster>` with no domain, in any case (RFC 5321 §4.1.1.3) |
437
+ | `clientKey(address)` | which client a remote address counts as, for a limit per client: an IPv4 address as it is, an IPv4-mapped or NAT64 address as its IPv4 address, any other IPv6 address as its /64, its first four groups written out, zeros included (`'2001:db8:1:2::/64'`, `'2001:db8:0:0::/64'` for `2001:db8::1`); `undefined` for what is not an IP address |
379
438
  | `DataReader`, `DataChunk` | reads DATA: dot-unstuffing, the terminator, bare CR and LF counted |
380
439
  | `decodePlain(response)`, `decodeLoginStep(response)` | SASL PLAIN (RFC 4616) and LOGIN responses to `Credentials` or text |
381
440
 
@@ -392,6 +451,7 @@ host; a 5xx stops. A null MX (RFC 7505) fails at once with `NULL_MX`.
392
451
  | `TlsMode` | `'opportunistic'`, `'required'` or `'none'` |
393
452
  | `MessageSource` | `Uint8Array`, `string` or `ReadableStream<Uint8Array>` |
394
453
  | `MxResolver` | what MX delivery asks of the DNS, by shape: `mx`, `a` and `aaaa`, as `@bumail/dns`'s `Resolver` has them |
454
+ | `isMailbox(address)` | whether `address` is exactly one `sendMail` takes (it checks with the same predicate): an RFC 5321 Mailbox, `local@domain` (§4.1.2, no brackets), with no source route, no control character (C0, DEL or C1), no `>`, no U+2028 or U+2029, no Unicode format character (`\p{Cf}`), no lone surrogate and no IPv4 literal octet above 255; check addresses you keep for later when you take them |
395
455
  | `resolveMx(domain, resolver)`, `MailHost` | a domain's mail hosts in the order to try them: `{ host, priority, implicit }`; `NULL_MX` or `DNS_FAILED` otherwise |
396
456
  | `SmtpError`, `SmtpErrorCode`, `SmtpErrorDetails`, `RecipientReply`, `Reply` | as above; `sendMail` adds the codes `CONNECTION_FAILED`, `CONNECTION_LOST`, `TIMEOUT`, `BAD_REPLY`, `REFUSED`, `RECIPIENTS_REFUSED`, `TLS_UNAVAILABLE`, `TLS_FAILED`, `AUTH_UNAVAILABLE`, `EXTENSION_MISSING`, `MESSAGE_TOO_BIG`, `BARE_LINE_BREAK`, `NULL_MX`, `DNS_FAILED`, `INVALID_OPTION` |
397
457
 
@@ -26,6 +26,12 @@ class SmtpError2 extends Error {
26
26
  }
27
27
 
28
28
  // src/protocol/path.ts
29
+ var POSTMASTER = Object.freeze({
30
+ address: "postmaster",
31
+ local: "postmaster",
32
+ domain: "",
33
+ postmaster: true
34
+ });
29
35
  var ATOM = /^[A-Za-z0-9!#$%&'*+\-/=?^_`{|}~\u0080-\u{10ffff}]+$/u;
30
36
  var LABEL = /^(?:[A-Za-z0-9\u0080-\u{10ffff}](?:[A-Za-z0-9\-\u0080-\u{10ffff}]*[A-Za-z0-9\u0080-\u{10ffff}])?)$/u;
31
37
  var INVISIBLE = /[\u0080-\u009f\u2028\u2029\p{Cf}\p{Cs}]/u;
@@ -243,7 +249,7 @@ function concat(a, b) {
243
249
  return out;
244
250
  }
245
251
 
246
- export { SmtpError2, isHelloName, parsePath2, decodePlain2, decodeLoginStep2, encodePlain, encodeLoginStep, MAX_LINE, LineSplitter, Outgoing };
252
+ export { SmtpError2, POSTMASTER, isHelloName, parsePath2, decodePlain2, decodeLoginStep2, encodePlain, encodeLoginStep, MAX_LINE, LineSplitter, Outgoing };
247
253
 
248
- //# debugId=10D3BC4806ADB37C64756E2164756E21
249
- //# sourceMappingURL=index-3423jxf9.js.map
254
+ //# debugId=26FD99243A8649B964756E2164756E21
255
+ //# sourceMappingURL=index-753q702a.js.map
@@ -0,0 +1,14 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/errors.ts", "../src/protocol/path.ts", "../src/protocol/sasl.ts", "../src/io/outgoing.ts", "../src/protocol/lines.ts"],
4
+ "sourcesContent": [
5
+ "import type { Reply } from './protocol/reply';\n\n/** Why the server refused an option, why a message stream ended in error, or why `sendMail` failed. */\nexport type SmtpErrorCode =\n\t| 'INVALID_OPTION'\n\t| 'ALREADY_LISTENING'\n\t| 'MESSAGE_TOO_BIG'\n\t| 'BARE_LINE_BREAK'\n\t| 'CONNECTION_LOST'\n\t| 'HOOK_TIMEOUT'\n\t| 'INVALID_HOOK_REPLY'\n\t| 'MESSAGE_NOT_READ'\n\t| 'CONNECTION_FAILED'\n\t| 'TIMEOUT'\n\t| 'BAD_REPLY'\n\t| 'REFUSED'\n\t| 'RECIPIENTS_REFUSED'\n\t| 'TLS_UNAVAILABLE'\n\t| 'TLS_FAILED'\n\t| 'AUTH_UNAVAILABLE'\n\t| 'EXTENSION_MISSING'\n\t| 'NULL_MX'\n\t| 'DNS_FAILED';\n\n/** One recipient and the server's reply to its `RCPT TO`. */\nexport interface RecipientReply {\n\treadonly recipient: string;\n\treadonly reply: Reply;\n}\n\n/** What `sendMail` adds to an error: whether to try again, and the reply behind it. */\nexport interface SmtpErrorDetails {\n\t/** Trying again later may succeed: a 4xx, the network, a timeout. */\n\treadonly temporary?: boolean;\n\t/** The server's reply that failed the delivery, enhanced status code included. */\n\treadonly reply?: Reply;\n\t/** With `RECIPIENTS_REFUSED`: each recipient, and why it was refused. */\n\treadonly rejected?: readonly RecipientReply[];\n}\n\n/** The codes that are temporary unless a reply or `details` says otherwise. */\nconst TEMPORARY = new Set<SmtpErrorCode>([\n\t'CONNECTION_LOST',\n\t'CONNECTION_FAILED',\n\t'TIMEOUT',\n\t'BAD_REPLY',\n\t'TLS_UNAVAILABLE',\n\t'TLS_FAILED',\n]);\n\n/**\n * Thrown by `createSmtpServer` and `listen` for a wrong option or call; the\n * error a message's `content` stream ends with when the message must not be\n * delivered; what `onError` is given for a hook that broke a rule; and what\n * `sendMail` rejects with. `temporary` tells a failure worth trying again\n * later (a 4xx, the network, a timeout) from a permanent one (a 5xx, a null\n * MX, a message the server can never take).\n */\nexport class SmtpError extends Error {\n\toverride readonly name = 'SmtpError';\n\treadonly code: SmtpErrorCode;\n\t/** Trying again later may succeed. Meaningful for `sendMail`'s errors. */\n\treadonly temporary: boolean;\n\t/** The server reply behind a `sendMail` failure, enhanced status code included. */\n\treadonly reply?: Reply;\n\t/** With `RECIPIENTS_REFUSED`: each recipient, and the reply that refused it. */\n\treadonly rejected?: readonly RecipientReply[];\n\n\tconstructor(\n\t\tcode: SmtpErrorCode,\n\t\tmessage: string,\n\t\tdetails: SmtpErrorDetails = {},\n\t) {\n\t\tsuper(message);\n\t\tthis.code = code;\n\t\tthis.temporary =\n\t\t\tdetails.temporary ??\n\t\t\t(details.reply ? details.reply.code < 500 : TEMPORARY.has(code));\n\t\tif (details.reply) this.reply = details.reply;\n\t\tif (details.rejected) this.rejected = details.rejected;\n\t}\n}\n",
6
+ "/** An envelope address, as `MAIL FROM` and `RCPT TO` give it. */\nexport interface Path {\n\t/**\n\t * `local@domain`; `''` for the null reverse-path `<>`; `'postmaster'`\n\t * for `RCPT TO:<postmaster>`, which has no domain.\n\t */\n\treadonly address: string;\n\treadonly local: string;\n\t/** Lower case; `''` for `<>` and for `<postmaster>`. */\n\treadonly domain: string;\n\t/**\n\t * `true` for `RCPT TO:<postmaster>`, in any case, with no domain (RFC\n\t * 5321 §4.5.1): the postmaster of this server, whatever domains it\n\t * hosts. Absent for every other path, `<postmaster@domain>` included.\n\t */\n\treadonly postmaster?: true;\n}\n\n/** The bare `<postmaster>` path `RCPT TO` takes (RFC 5321 §4.1.1.3, §4.5.1). */\nexport const POSTMASTER: Path = Object.freeze({\n\taddress: 'postmaster',\n\tlocal: 'postmaster',\n\tdomain: '',\n\tpostmaster: true,\n});\n\nconst ATOM = /^[A-Za-z0-9!#$%&'*+\\-/=?^_`{|}~\\u0080-\\u{10ffff}]+$/u;\nconst LABEL =\n\t/^(?:[A-Za-z0-9\\u0080-\\u{10ffff}](?:[A-Za-z0-9\\-\\u0080-\\u{10ffff}]*[A-Za-z0-9\\u0080-\\u{10ffff}])?)$/u;\n\n/**\n * C1 controls, Unicode format characters (zero-width, bidi, BOM), the\n * line and paragraph separators, and lone surrogates: none has a place in\n * an address, and each would land as it is in the Received field and the\n * app's records — a lone surrogate as U+FFFD, once encoded for the wire.\n */\nconst INVISIBLE = /[\\u0080-\\u009f\\u2028\\u2029\\p{Cf}\\p{Cs}]/u;\n\n/**\n * C0 controls (CR, LF and NUL among them), DEL and `>`, anywhere in the\n * path, quoted or not: a CR or an LF would end the command line and start\n * another, and a `>` would end the path where a reader of the line stops.\n */\nfunction hasControl(text: string): boolean {\n\tfor (let i = 0; i < text.length; i++) {\n\t\tconst code = text.charCodeAt(i);\n\t\tif (code < 0x20 || code === 0x7f || code === 0x3e) return true;\n\t}\n\treturn false;\n}\n\n/** One hop of a source route, `@domain`, and what follows it: `,` or `:`. */\nconst HOP = /^@(\\[[^\\]]*\\]|[^,:@[\\]]*)([,:])/;\n\nfunction isDotString(text: string): boolean {\n\treturn text.split('.').every((atom) => ATOM.test(atom));\n}\n\nfunction isQuotedString(text: string): boolean {\n\treturn /^\"(?:[\\x20\\x21\\x23-\\x5b\\x5d-\\x7e\\u0080-\\u{10ffff}]|\\\\[\\x20-\\x7e])*\"$/u.test(\n\t\ttext,\n\t);\n}\n\n/**\n * An address literal (§4.1.3): `[IPv6:…]`, its tag in any case (a quoted\n * string in RFC 5234 is), or `[a.b.c.d]` with each octet at most 255.\n */\nexport function isAddressLiteral(text: string): boolean {\n\tif (/^\\[IPv6:[0-9a-f:.]+\\]$/i.test(text)) return true;\n\tconst ipv4 = /^\\[(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\]$/.exec(text);\n\treturn ipv4?.slice(1).every((octet) => Number(octet) <= 255) === true;\n}\n\n/**\n * The argument of EHLO or HELO (RFC 5321 §4.1.1.1): a host name of\n * letters, digits and hyphens, or an address literal.\n */\nexport function isHelloName(text: string): boolean {\n\treturn (\n\t\t/^[A-Za-z0-9-]+(?:\\.[A-Za-z0-9-]+)*$/.test(text) || isAddressLiteral(text)\n\t);\n}\n\nfunction isDomain(domain: string): boolean {\n\tif (isAddressLiteral(domain)) return true;\n\treturn (\n\t\tdomain.length <= 255 &&\n\t\tdomain.split('.').every((label) => label.length <= 63 && LABEL.test(label))\n\t);\n}\n\n/**\n * What `parsePath` does with a source route (`<@a,@b:local@domain>`, RFC 5321\n * Appendix C): a server accepts and discards it (`'discard'`), a client\n * refuses it, as §4.1.1.3 says clients should not send one (`'refuse'`).\n */\nexport type SourceRoute = 'discard' | 'refuse';\n\n/**\n * The mailbox after a source route, each of whose hops must be\n * `@domain` with a valid domain; `undefined` for any other route.\n */\nfunction afterRoute(inner: string): string | undefined {\n\tlet rest = inner;\n\tfor (;;) {\n\t\tconst hop = HOP.exec(rest);\n\t\tif (!hop || !isDomain(hop[1] as string)) return undefined;\n\t\trest = rest.slice(hop[0].length);\n\t\tif (hop[2] === ':') return rest;\n\t}\n}\n\n/**\n * Parses the `<path>` of RFC 5321 §4.1.2: `<local@domain>`, or `<>` when\n * `allowNull`. A source route (`<@a,@b:local@domain>`, §C) is dropped when\n * `sourceRoute` is `'discard'`, the default, provided each hop is\n * `@domain`; with `'refuse'` the path is not one. A C0 control (CR, LF,\n * NUL…), DEL or `>` anywhere refuses the path, as do C1 controls,\n * U+2028 and U+2029, Unicode format characters and lone surrogates. An IPv4 address literal\n * takes octets up to 255.\n * Non-ASCII is allowed: whether the session may use it is SMTPUTF8's\n * question (RFC 6531), not the grammar's. `undefined` when it is not a path.\n *\n * The local part is kept as written, quotes included: `\"v@x.example\"` and\n * `v%x.example` are local parts of the domain after the last `@`, not\n * addresses elsewhere. Code that delivers must not split on the first `@`.\n */\nexport function parsePath(\n\ttext: string,\n\tallowNull: boolean,\n\tsourceRoute: SourceRoute = 'discard',\n): Path | undefined {\n\tif (!text.startsWith('<') || !text.endsWith('>')) return undefined;\n\tlet inner: string | undefined = text.slice(1, -1);\n\tif (hasControl(inner) || INVISIBLE.test(inner)) return undefined;\n\tif (inner === '')\n\t\treturn allowNull ? { address: '', local: '', domain: '' } : undefined;\n\tif (inner.startsWith('@')) {\n\t\tif (sourceRoute === 'refuse') return undefined;\n\t\tinner = afterRoute(inner);\n\t\tif (inner === undefined) return undefined;\n\t}\n\tconst at = inner.lastIndexOf('@');\n\tif (at <= 0) return undefined;\n\tconst local = inner.slice(0, at);\n\tconst domain = inner.slice(at + 1);\n\tif (local.length > 64 || !(isDotString(local) || isQuotedString(local)))\n\t\treturn undefined;\n\tif (!isDomain(domain)) return undefined;\n\treturn {\n\t\taddress: `${local}@${domain.toLowerCase()}`,\n\t\tlocal,\n\t\tdomain: domain.toLowerCase(),\n\t};\n}\n",
7
+ "/** Credentials a client gave with `AUTH`. */\nexport interface Credentials {\n\treadonly mechanism: 'PLAIN' | 'LOGIN';\n\treadonly username: string;\n\treadonly password: string;\n\t/**\n\t * PLAIN's authorization identity, when it differs from the username.\n\t * The server refuses such credentials before `authenticate` is asked.\n\t */\n\treadonly authorizationId?: string;\n}\n\nfunction base64ToText(text: string): string | undefined {\n\tif (!/^[A-Za-z0-9+/]*={0,2}$/.test(text) || text.length % 4 !== 0)\n\t\treturn undefined;\n\ttry {\n\t\treturn new TextDecoder('utf-8', { fatal: true }).decode(\n\t\t\tUint8Array.fromBase64(text),\n\t\t);\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n\n/** PLAIN (RFC 4616): `authzid NUL authcid NUL passwd`, in base64. */\nexport function decodePlain(response: string): Credentials | undefined {\n\tconst text = base64ToText(response);\n\tif (text === undefined) return undefined;\n\tconst parts = text.split('\\0');\n\tif (parts.length !== 3) return undefined;\n\tconst [authorizationId = '', username = '', password = ''] = parts;\n\tif (username === '' || password === '') return undefined;\n\treturn {\n\t\tmechanism: 'PLAIN',\n\t\tusername,\n\t\tpassword,\n\t\t...(authorizationId === '' || authorizationId === username\n\t\t\t? {}\n\t\t\t: { authorizationId }),\n\t};\n}\n\n/** One step of LOGIN: a base64 line to its text. */\nexport function decodeLoginStep(response: string): string | undefined {\n\treturn base64ToText(response);\n}\n\nconst base64 = (text: string) => new TextEncoder().encode(text).toBase64();\n\n/** A client's PLAIN response (RFC 4616): `NUL username NUL password`, in base64, no authorization identity. */\nexport function encodePlain(username: string, password: string): string {\n\treturn base64(`\\0${username}\\0${password}`);\n}\n\n/** One step of LOGIN, the username or the password, in base64. */\nexport function encodeLoginStep(text: string): string {\n\treturn base64(text);\n}\n",
8
+ "/**\n * What waits to leave a Bun socket. Bun's sockets do not buffer: `write`\n * takes what the kernel takes and says how much. The rest waits here for\n * the socket's `drain` event, so nothing written is lost to a peer that\n * reads slowly. The server's transport and the client's socket share it.\n */\nexport class Outgoing {\n\treadonly #write: (bytes: Uint8Array) => number;\n\t#queue: Uint8Array[] = [];\n\t#waiters: (() => void)[] = [];\n\n\tconstructor(write: (bytes: Uint8Array) => number) {\n\t\tthis.#write = write;\n\t}\n\n\t/** Nothing waits to leave. */\n\tget empty(): boolean {\n\t\treturn this.#queue.length === 0;\n\t}\n\n\t/** Writes what the socket takes now, and keeps the rest for `drain`. */\n\twrite(bytes: Uint8Array): void {\n\t\tif (this.#queue.length > 0) {\n\t\t\tthis.#queue.push(bytes);\n\t\t\treturn;\n\t\t}\n\t\tconst written = this.#write(bytes);\n\t\tif (written < bytes.length) {\n\t\t\tthis.#queue.push(bytes.subarray(Math.max(written, 0)));\n\t\t}\n\t}\n\n\t/** The socket's `drain`: it can take more. True once everything has left. */\n\tdrain(): boolean {\n\t\twhile (this.#queue.length > 0) {\n\t\t\tconst bytes = this.#queue[0] as Uint8Array;\n\t\t\tconst written = this.#write(bytes);\n\t\t\tif (written < bytes.length) {\n\t\t\t\tthis.#queue[0] = bytes.subarray(Math.max(written, 0));\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tthis.#queue.shift();\n\t\t}\n\t\tfor (const wake of this.#waiters.splice(0)) wake();\n\t\treturn true;\n\t}\n\n\t/** Resolves once everything written has left, or the socket closed. */\n\tdrained(): Promise<void> {\n\t\tif (this.#queue.length === 0) return Promise.resolve();\n\t\treturn new Promise((wake) => this.#waiters.push(wake));\n\t}\n\n\t/** The socket closed: nothing more will leave. */\n\tclear(): void {\n\t\tthis.#queue = [];\n\t\tfor (const wake of this.#waiters.splice(0)) wake();\n\t}\n}\n",
9
+ "/**\n * The longest line taken, CRLF included: a command (RFC 5321 §4.5.3.1.4\n * asks for 512 at least) or a reply line (§4.5.3.1.5, 512 too).\n */\nexport const MAX_LINE = 2048;\n\n/** One line from the peer, or a line that was too long and was skipped. */\nexport type LineEvent = { line: string } | { tooLong: true };\n\n/**\n * Cuts a peer's bytes into lines — a client's commands, a server's\n * replies — ending at LF with or without CR. It holds one partial line at most: past `MAX_LINE`, the line is\n * skipped to its end and reported once.\n */\nexport class LineSplitter {\n\t#held: Uint8Array = new Uint8Array(0);\n\t#skipping = false;\n\t#rest: Uint8Array = new Uint8Array(0);\n\n\t/** Starts on a chunk; read its lines with `next`. */\n\tpush(chunk: Uint8Array): void {\n\t\tthis.#rest = this.#held.length > 0 ? concat(this.#held, chunk) : chunk;\n\t\tthis.#held = new Uint8Array(0);\n\t}\n\n\t/** The next line of the current chunk, or `undefined` when it has no more. */\n\tnext(): LineEvent | undefined {\n\t\tfor (;;) {\n\t\t\tconst data = this.#rest;\n\t\t\tconst lf = data.indexOf(0x0a);\n\t\t\tif (lf < 0) {\n\t\t\t\tthis.#rest = new Uint8Array(0);\n\t\t\t\tif (this.#skipping) return undefined;\n\t\t\t\tif (data.length > MAX_LINE) {\n\t\t\t\t\tthis.#skipping = true;\n\t\t\t\t\treturn { tooLong: true };\n\t\t\t\t}\n\t\t\t\tthis.#held = data.slice();\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\tconst end = lf > 0 && data[lf - 1] === 0x0d ? lf - 1 : lf;\n\t\t\tthis.#rest = data.subarray(lf + 1);\n\t\t\tif (this.#skipping) {\n\t\t\t\tthis.#skipping = false;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (end > MAX_LINE) return { tooLong: true };\n\t\t\treturn { line: new TextDecoder().decode(data.subarray(0, end)) };\n\t\t}\n\t}\n\n\t/** Bytes are held or left: a line begun, or lines not yet read. */\n\tget holding(): boolean {\n\t\treturn this.#held.length > 0 || this.#rest.length > 0;\n\t}\n\n\t/** What is left of the current chunk: message content pipelined after DATA. */\n\ttakeRest(): Uint8Array {\n\t\tconst rest = this.#rest;\n\t\tthis.#rest = new Uint8Array(0);\n\t\treturn rest;\n\t}\n\n\t/** Forgets everything held: after STARTTLS, or after a refused DATA. */\n\tclear(): void {\n\t\tthis.#held = new Uint8Array(0);\n\t\tthis.#rest = new Uint8Array(0);\n\t\tthis.#skipping = false;\n\t}\n}\n\nfunction concat(a: Uint8Array, b: Uint8Array): Uint8Array {\n\tcon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A,MACD;AAAA,MACA,IAAI,MAAM;AAAA,QAAU,OAAO,EAAE,SAAS,KAAK;AAAA,MAC3C,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,OAAO,KAAK,SAAS,GAAG,GAAG,CAAC,EAAE;AAAA,IAChE;AAAA;AAAA,MAIG,OAAO,GAAY;AAAA,IACtB,OAAO,KAAK,MAAM,SAAS,KAAK,KAAK,MAAM,SAAS;AAAA;AAAA,EAIrD,QAAQ,GAAe;AAAA,IACtB,MAAM,OAAO,KAAK;AAAA,IAClB,KAAK,QAAQ,IAAI,WAAW,CAAC;AAAA,IAC7B,OAAO;AAAA;AAAA,EAIR,KAAK,GAAS;AAAA,IACb,KAAK,QAAQ,IAAI,WAAW,CAAC;AAAA,IAC7B,KAAK,QAAQ,IAAI,WAAW,CAAC;AAAA,IAC7B,KAAK,YAAY;AAAA;AAEnB;AAEA,SAAS,MAAM,CAAC,GAAe,GAA2B;AAAA,EACzD,MAAM,MAAM,IAAI,WAAW,EAAE,SAAS,EAAE,MAAM;AAAA,EAC9C,IAAI,IAAI,GAAG,CAAC;AAAA,EACZ,IAAI,IAAI,GAAG,EAAE,MAAM;AAAA,EACnB,OAAO;AAAA;",
12
+ "debugId": "26FD99243A8649B964756E2164756E21",
13
+ "names": []
14
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Whether `address` is one `sendMail` takes as a recipient, or as a sender
3
+ * other than the null one: exactly those, since `sendMail` checks its
4
+ * addresses with this same predicate. That is an RFC 5321 Mailbox
5
+ * (§4.1.2), `local@domain` with no brackets — a dot-string or quoted local
6
+ * part of 64 characters at most, and a domain of valid labels or an
7
+ * address literal — with no source route, no control character (C0, DEL
8
+ * or C1), no `>`, no U+2028 or U+2029, no Unicode format character
9
+ * (`\p{Cf}`), no lone surrogate and no IPv4 literal octet above 255. A caller that keeps addresses for
10
+ * later, such as a queue, checks them with this when it takes them, so
11
+ * `sendMail` never refuses them with `INVALID_OPTION` afterwards.
12
+ */
13
+ export declare function isMailbox(address: unknown): address is string;
14
+ //# sourceMappingURL=address.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../src/client/address.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,IAAI,MAAM,CAK7D"}
@@ -1,5 +1,6 @@
1
1
  export { type RecipientReply, SmtpError, type SmtpErrorCode, type SmtpErrorDetails, } from '../errors';
2
2
  export type { Reply } from '../protocol/reply';
3
+ export { isMailbox } from './address';
3
4
  export { type MailHost, resolveMx } from './mx';
4
5
  export type { HostDestination, MessageSource, MxDestination, MxResolver, SendMailAuth, SendMailEnvelope, SendMailOptions, SendMailResult, SendMailTimeouts, TlsMode, } from './options';
5
6
  export { sendMail } from './send';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,cAAc,EACnB,SAAS,EACT,KAAK,aAAa,EAClB,KAAK,gBAAgB,GACrB,MAAM,WAAW,CAAC;AACnB,YAAY,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,KAAK,QAAQ,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAChD,YAAY,EACX,eAAe,EACf,aAAa,EACb,aAAa,EACb,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,OAAO,GACP,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,cAAc,EACnB,SAAS,EACT,KAAK,aAAa,EAClB,KAAK,gBAAgB,GACrB,MAAM,WAAW,CAAC;AACnB,YAAY,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,KAAK,QAAQ,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAChD,YAAY,EACX,eAAe,EACf,aAAa,EACb,aAAa,EACb,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,OAAO,GACP,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC"}
@@ -7,7 +7,11 @@ import {
7
7
  MAX_LINE,
8
8
  LineSplitter,
9
9
  Outgoing
10
- } from "../chunks/index-3423jxf9.js";
10
+ } from "../chunks/index-753q702a.js";
11
+ // src/client/address.ts
12
+ function isMailbox(address) {
13
+ return typeof address === "string" && parsePath2(`<${address}>`, false, "refuse") !== undefined;
14
+ }
11
15
  // src/client/mx.ts
12
16
  function dnsCode(error) {
13
17
  return error instanceof Error && error.name === "DnsError" ? error.code : undefined;
@@ -421,9 +425,11 @@ function timeoutsOf(given = {}) {
421
425
  return out;
422
426
  }
423
427
  function address(value, allowNull) {
428
+ if (allowNull && value === "")
429
+ return "";
430
+ if (isMailbox(value))
431
+ return value;
424
432
  const text = typeof value === "string" ? value : "";
425
- if (typeof value === "string" && parsePath2(`<${text}>`, allowNull, "refuse"))
426
- return text;
427
433
  const routed = typeof value === "string" && parsePath2(`<${text}>`, false);
428
434
  if (routed) {
429
435
  throw invalid(`${JSON.stringify(value)} holds a source route (@host:), which RFC 5321 says a client should not send: pass ${JSON.stringify(`${routed.local}@${text.slice(text.lastIndexOf("@") + 1)}`)} alone`);
@@ -940,9 +946,10 @@ async function sendMail(message, options) {
940
946
  }
941
947
  export {
942
948
  SmtpError2 as SmtpError,
949
+ isMailbox,
943
950
  resolveMx,
944
951
  sendMail
945
952
  };
946
953
 
947
- //# debugId=A7806B344FA2670664756E2164756E21
954
+ //# debugId=6054CCD3D7858E7364756E2164756E21
948
955
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../src/client/mx.ts", "../src/protocol/data-writer.ts", "../src/client/content.ts", "../src/protocol/reply-reader.ts", "../src/client/refusal.ts", "../src/protocol/ehlo.ts", "../src/client/session.ts", "../src/client/settings.ts", "../src/client/inbox.ts", "../src/client/target.ts", "../src/client/socket.ts", "../src/client/transaction.ts", "../src/client/send.ts"],
3
+ "sources": ["../src/client/address.ts", "../src/client/mx.ts", "../src/protocol/data-writer.ts", "../src/client/content.ts", "../src/protocol/reply-reader.ts", "../src/client/refusal.ts", "../src/protocol/ehlo.ts", "../src/client/session.ts", "../src/client/settings.ts", "../src/client/inbox.ts", "../src/client/target.ts", "../src/client/socket.ts", "../src/client/transaction.ts", "../src/client/send.ts"],
4
4
  "sourcesContent": [
5
+ "import { parsePath } from '../protocol/path';\n\n/**\n * Whether `address` is one `sendMail` takes as a recipient, or as a sender\n * other than the null one: exactly those, since `sendMail` checks its\n * addresses with this same predicate. That is an RFC 5321 Mailbox\n * (§4.1.2), `local@domain` with no brackets — a dot-string or quoted local\n * part of 64 characters at most, and a domain of valid labels or an\n * address literal — with no source route, no control character (C0, DEL\n * or C1), no `>`, no U+2028 or U+2029, no Unicode format character\n * (`\\p{Cf}`), no lone surrogate and no IPv4 literal octet above 255. A caller that keeps addresses for\n * later, such as a queue, checks them with this when it takes them, so\n * `sendMail` never refuses them with `INVALID_OPTION` afterwards.\n */\nexport function isMailbox(address: unknown): address is string {\n\treturn (\n\t\ttypeof address === 'string' &&\n\t\tparsePath(`<${address}>`, false, 'refuse') !== undefined\n\t);\n}\n",
5
6
  "import { SmtpError } from '../errors';\nimport type { MxResolver } from './options';\n\n/** A host that takes mail for a domain, by preference: the lowest first. */\nexport interface MailHost {\n\treadonly host: string;\n\treadonly priority: number;\n\t/** No MX record: the domain itself, by its A or AAAA (RFC 5321 §5.1). */\n\treadonly implicit: boolean;\n}\n\n/** A `DnsError`'s code, read by shape: the client imports nothing of `@bumail/dns` at runtime. */\nfunction dnsCode(error: unknown): string | undefined {\n\treturn error instanceof Error && error.name === 'DnsError'\n\t\t? (error as Error & { code?: string }).code\n\t\t: undefined;\n}\n\n/**\n * `@bumail/dns`'s `isTemporary` (`packages/dns/src/errors.ts`), copied so\n * the client imports nothing of it: anything but a `DnsError`, a\n * `TEMPORARY` and a `TIMEOUT` are. Change both together.\n */\nfunction temporary(error: unknown): boolean {\n\tconst code = dnsCode(error);\n\treturn code === undefined || code === 'TEMPORARY' || code === 'TIMEOUT';\n}\n\nconst messageOf = (error: unknown) =>\n\terror instanceof Error ? error.message : String(error);\n\n/**\n * By preference, equal ones in a random order, as RFC 5321 §5.1 asks, to\n * spread the load. `random` is `Math.random` but in a spec.\n */\nexport function byPreference(\n\thosts: readonly MailHost[],\n\trandom: () => number = Math.random,\n): MailHost[] {\n\treturn hosts\n\t\t.map((host) => ({ host, key: random() }))\n\t\t.sort((x, y) => x.host.priority - y.host.priority || x.key - y.key)\n\t\t.map(({ host }) => host);\n}\n\n/**\n * The hosts to deliver a domain's mail to, in the order to try them (RFC\n * 5321 §5.1): its MX records by preference, or the domain itself when it\n * has none. A null MX (RFC 7505) is a permanent `NULL_MX`; a lookup that\n * failed is `DNS_FAILED`, temporary unless the DNS said there is no such\n * domain.\n */\nexport async function resolveMx(\n\tdomain: string,\n\tresolver: Pick<MxResolver, 'mx'>,\n): Promise<MailHost[]> {\n\tconst implicit = [\n\t\t{ host: domain.toLowerCase(), priority: 0, implicit: true },\n\t];\n\tlet records: Awaited<ReturnType<MxResolver['mx']>>;\n\ttry {\n\t\trecords = await resolver.mx(domain);\n\t} catch (error) {\n\t\tif (dnsCode(error) === 'NOT_FOUND') return implicit;\n\t\tthrow new SmtpError(\n\t\t\t'DNS_FAILED',\n\t\t\t`Could not look up the MX records of ${domain}: ${messageOf(error)}`,\n\t\t\t{ temporary: temporary(error) },\n\t\t);\n\t}\n\tconst hosts = records\n\t\t.filter((record) => record.exchange !== '')\n\t\t.map((record) => ({\n\t\t\thost: record.exchange,\n\t\t\tpriority: record.priority,\n\t\t\timplicit: false,\n\t\t}));\n\t// A resolver of your own may answer \"none\" with no record at all.\n\tif (records.length === 0) return implicit;\n\tif (hosts.length === 0) {\n\t\tthrow new SmtpError(\n\t\t\t'NULL_MX',\n\t\t\t`${domain} accepts no mail: its MX record is the null MX (RFC 7505)`,\n\t\t\t{ temporary: false },\n\t\t);\n\t}\n\treturn byPreference(hosts);\n}\n\n/** A host's addresses, IPv4 first; an error when it has none. */\nexport async function addressesOf(\n\thost: string,\n\tresolver: Pick<MxResolver, 'a' | 'aaaa'>,\n): Promise<string[] | { readonly error: unknown }> {\n\tconst found: string[] = [];\n\tlet failure: unknown;\n\tfor (const lookup of [resolver.a, resolver.aaaa]) {\n\t\ttry {\n\t\t\tfor (const record of await lookup.call(resolver, host)) {\n\t\t\t\tfound.push(record.address);\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tif (failure === undefined || temporary(error)) failure = error;\n\t\t}\n\t}\n\treturn found.length > 0 ? found : { error: failure };\n}\n\n/** `DNS_FAILED` for a domain none of whose hosts had an address. */\nexport function noAddress(domain: string, error: unknown): SmtpError {\n\tconst why = error === undefined ? 'no A or AAAA record' : messageOf(error);\n\treturn new SmtpError(\n\t\t'DNS_FAILED',\n\t\t`No mail host of ${domain} has an address: ${why}`,\n\t\t{ temporary: error !== undefined && temporary(error) },\n\t);\n}\n",
6
7
  "const CR = 0x0d;\nconst LF = 0x0a;\nconst DOT = 0x2e;\n\n/**\n * Writes the content of `DATA` (RFC 5321 §4.1.1.4), the other half of\n * `DataReader`: a dot is added before every line that starts with one\n * (§4.5.2), and `end` closes the message with `<CRLF>.<CRLF>`. One pass,\n * one byte at a time, whatever the chunks.\n *\n * A bare CR or LF is counted in `bareLineBreaks`, as `DataReader` counts\n * it, for the caller to refuse the message: a server that reads one as a\n * line end is the SMTP smuggling a server refuses. With `normalize`, each\n * becomes CRLF instead. `eightBit` says whether a byte above 127 was seen.\n */\nexport class DataWriter {\n\treadonly #normalize: boolean;\n\t#lineStart = true;\n\t#heldCr = false;\n\tbareLineBreaks = 0;\n\teightBit = false;\n\n\tconstructor(normalize = false) {\n\t\tthis.#normalize = normalize;\n\t}\n\n\t/** A bare CR or LF: CRLF when normalising, else counted and kept as it is. */\n\t#bare(out: Uint8Array, n: number, byte: number): number {\n\t\tif (this.#normalize) {\n\t\t\tout[n++] = CR;\n\t\t\tout[n++] = LF;\n\t\t\tthis.#lineStart = true;\n\t\t\treturn n;\n\t\t}\n\t\tthis.bareLineBreaks++;\n\t\tout[n++] = byte;\n\t\tthis.#lineStart = false;\n\t\treturn n;\n\t}\n\n\t/** The next bytes of the message, stuffed. */\n\twrite(chunk: Uint8Array): Uint8Array {\n\t\t// At worst every byte doubles: a dot or a bare line break each.\n\t\tconst out = new Uint8Array(chunk.length * 2 + 2);\n\t\tlet n = 0;\n\t\tfor (let i = 0; i < chunk.length; i++) {\n\t\t\tconst byte = chunk[i] as number;\n\t\t\tif (this.#heldCr) {\n\t\t\t\tthis.#heldCr = false;\n\t\t\t\tif (byte === LF) {\n\t\t\t\t\tout[n++] = CR;\n\t\t\t\t\tout[n++] = LF;\n\t\t\t\t\tthis.#lineStart = true;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tn = this.#bare(out, n, CR);\n\t\t\t}\n\t\t\tif (byte === CR) {\n\t\t\t\tthis.#heldCr = true;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (byte === LF) {\n\t\t\t\tn = this.#bare(out, n, LF);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (byte === DOT && this.#lineStart) out[n++] = DOT;\n\t\t\tif (byte > 0x7f) this.eightBit = true;\n\t\t\tout[n++] = byte;\n\t\t\tthis.#lineStart = false;\n\t\t}\n\t\treturn out.subarray(0, n);\n\t}\n\n\t/** The end of the message: a CRLF if its last line has none, then `.` CRLF. */\n\tend(): Uint8Array {\n\t\tconst out = new Uint8Array(7);\n\t\tlet n = 0;\n\t\tif (this.#heldCr) {\n\t\t\tthis.#heldCr = false;\n\t\t\tn = this.#bare(out, n, CR);\n\t\t}\n\t\tif (!this.#lineStart) {\n\t\t\tout[n++] = CR;\n\t\t\tout[n++] = LF;\n\t\t}\n\t\tout[n++] = DOT;\n\t\tout[n++] = CR;\n\t\tout[n++] = LF;\n\t\treturn out.subarray(0, n);\n\t}\n}\n",
7
8
  "import { SmtpError } from '../errors';\nimport { DataWriter } from '../protocol/data-writer';\nimport type { MessageSource } from './options';\n\n/** The slice of a message in memory sent at once. */\nconst SLICE = 64 * 1024;\n\n/** The message's bytes, one slice at a time; `undefined` once they end. */\nexport interface Chunks {\n\tnext(): Promise<Uint8Array | undefined>;\n\t/** Stops reading: a delivery that failed half-way. */\n\tcancel(): void;\n}\n\n/** A message ready to send: what is known of it before the first byte, and its bytes. */\nexport interface Content {\n\t/** Bytes, when known before sending: SIZE declares it. */\n\treadonly size?: number;\n\t/** A byte above 127, when known before sending: it needs 8BITMIME. */\n\treadonly eightBit: boolean;\n\tchunks(): Chunks;\n}\n\n/** The error for a bare CR or LF in the message: a server must refuse it, and this client does first. */\nexport const bareLineBreak = () =>\n\tnew SmtpError(\n\t\t'BARE_LINE_BREAK',\n\t\t'sendMail(): the message holds a bare CR or LF, which a server must refuse (SMTP smuggling); end every line with CRLF, or pass normalizeLineEnds: true',\n\t);\n\n/** Bytes in `SLICE`s, so no chunk sent at once is larger. */\nfunction sliced(next: () => Promise<Uint8Array | undefined>) {\n\tlet held: Uint8Array | undefined;\n\treturn async (): Promise<Uint8Array | undefined> => {\n\t\tif (!held || held.length === 0) held = await next();\n\t\tif (!held) return undefined;\n\t\tconst slice = held.subarray(0, SLICE);\n\t\theld = held.subarray(SLICE);\n\t\treturn slice;\n\t};\n}\n\nfunction fromBytes(bytes: Uint8Array): Chunks {\n\tlet given = false;\n\tconst next = sliced(async () => {\n\t\tif (given) return undefined;\n\t\tgiven = true;\n\t\treturn bytes;\n\t});\n\treturn { next, cancel() {} };\n}\n\nfunction fromStream(stream: ReadableStream<Uint8Array>): Chunks {\n\tconst reader = stream.getReader();\n\tconst next = sliced(async () => {\n\t\tconst { done, value } = await reader.read();\n\t\tif (done) return undefined;\n\t\tif (!(value instanceof Uint8Array)) {\n\t\t\tthrow new SmtpError(\n\t\t\t\t'INVALID_OPTION',\n\t\t\t\t'sendMail(): a message stream must give Uint8Array chunks',\n\t\t\t);\n\t\t}\n\t\treturn value;\n\t});\n\treturn {\n\t\tnext,\n\t\tcancel: () => void reader.cancel().catch(() => {}),\n\t};\n}\n\n/**\n * The message, checked before any connection when it is in memory: a bare\n * CR or LF is refused here (unless normalised), and its size and 8-bit\n * bytes are known for MAIL FROM. A stream is checked as it is sent.\n */\nexport function contentOf(\n\tmessage: MessageSource,\n\tnormalize: boolean,\n\tsize: number | undefined,\n): Content {\n\tif (message instanceof ReadableStream) {\n\t\tlet read = false;\n\t\treturn {\n\t\t\t...(size === undefined ? {} : { size }),\n\t\t\teightBit: false,\n\t\t\tchunks() {\n\t\t\t\tif (read) {\n\t\t\t\t\tthrow new SmtpError(\n\t\t\t\t\t\t'INVALID_OPTION',\n\t\t\t\t\t\t'sendMail(): a message stream can be sent once only',\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tread = true;\n\t\t\t\treturn fromStream(message);\n\t\t\t},\n\t\t};\n\t}\n\tlet bytes: Uint8Array;\n\tif (typeof message === 'string') bytes = new TextEncoder().encode(message);\n\telse if (message instanceof Uint8Array) bytes = message;\n\telse {\n\t\tthrow new SmtpError(\n\t\t\t'INVALID_OPTION',\n\t\t\t'sendMail(): the message must be a Uint8Array, a string or a ReadableStream',\n\t\t);\n\t}\n\t// One dry run: what the server will be sent, its size as normalised.\n\tconst writer = new DataWriter(normalize);\n\tlet sent = 0;\n\tfor (let at = 0; at < bytes.length; at += SLICE) {\n\t\tsent += writer.write(bytes.subarray(at, at + SLICE)).length;\n\t}\n\twriter.end();\n\tif (writer.bareLineBreaks > 0) throw bareLineBreak();\n\treturn {\n\t\tsize: sent,\n\t\teightBit: writer.eightBit,\n\t\tchunks: () => fromBytes(bytes),\n\t};\n}\n",
@@ -9,14 +10,14 @@
9
10
  "import { SmtpError } from '../errors';\nimport type { Reply } from '../protocol/reply';\nimport { replyText } from '../protocol/reply-reader';\n\n/** A reply as an error message shows it: code, status, text, cut at 200 characters. */\nexport function shown(reply: Reply): string {\n\tconst text = replyText(reply);\n\tconst line = `${reply.code}${reply.status ? ` ${reply.status}` : ''} ${text}`;\n\treturn line.length > 200 ? `${line.slice(0, 200)}…` : line;\n}\n\n/** `REFUSED`, temporary for a 4xx: the server said no to `what`. */\nexport function refused(host: string, what: string, reply: Reply): SmtpError {\n\treturn new SmtpError('REFUSED', `${host} refused ${what}: ${shown(reply)}`, {\n\t\treply,\n\t});\n}\n\n/** `BAD_REPLY`: what the server sent is not a reply, or too much of one. */\nexport const badReply = (host: string, what: string) =>\n\tnew SmtpError('BAD_REPLY', `${host} sent ${what}`);\n\n/** `CONNECTION_LOST` while waiting for `what`, or while the message was sent. */\nexport const lost = (host: string, what?: string) =>\n\tnew SmtpError(\n\t\t'CONNECTION_LOST',\n\t\twhat === undefined\n\t\t\t? `The connection to ${host} closed while the message was sent`\n\t\t\t: `The connection to ${host} closed before ${what}`,\n\t);\n\n/** `TIMEOUT`: a step's own, or the whole delivery's deadline when `deadline` is given. */\nexport const timedOut = (\n\thost: string,\n\twhat: string,\n\tseconds: number,\n\tdeadline?: number,\n) =>\n\tnew SmtpError(\n\t\t'TIMEOUT',\n\t\tdeadline === undefined\n\t\t\t? `Timed out after ${seconds} s waiting for ${what} (${host})`\n\t\t\t: `The deadline of ${deadline} s passed waiting for ${what} (${host})`,\n\t);\n\n/** `TLS_FAILED`: the handshake, or the certificate's check. */\nexport const tlsFailed = (host: string, why: string) =>\n\tnew SmtpError('TLS_FAILED', `TLS with ${host} failed: ${why}`);\n",
10
11
  "/**\n * The extensions an EHLO reply names (RFC 5321 §4.1.1.1): every line after\n * the first is a keyword, then its parameters. Keywords in upper case,\n * parameters as written, spaces around them dropped.\n */\nexport function parseEhlo(\n\tlines: readonly string[],\n): ReadonlyMap<string, string> {\n\tconst extensions = new Map<string, string>();\n\tfor (const line of lines.slice(1)) {\n\t\tconst text = line.trim();\n\t\tconst space = text.indexOf(' ');\n\t\tconst keyword = (space < 0 ? text : text.slice(0, space)).toUpperCase();\n\t\tif (keyword === '') continue;\n\t\textensions.set(keyword, space < 0 ? '' : text.slice(space + 1).trim());\n\t}\n\treturn extensions;\n}\n",
11
12
  "import { SmtpError } from '../errors';\nimport { parseEhlo } from '../protocol/ehlo';\nimport { encodeLoginStep, encodePlain } from '../protocol/sasl';\nimport { refused, shown } from './refusal';\nimport type { ClientSettings } from './settings';\nimport type { ClientSocket } from './socket';\nimport type { TlsTarget } from './target';\n\n/** A session past its greeting, EHLO, STARTTLS and AUTH: what the server offers. */\nexport interface Ready {\n\treadonly extensions: ReadonlyMap<string, string>;\n\treadonly authenticated: boolean;\n}\n\n/** EHLO, or HELO when the server refuses EHLO with a 5xx (RFC 5321 §4.1.4). */\nasync function hello(\n\tsocket: ClientSocket,\n\tsettings: ClientSettings,\n\tallowHelo: boolean,\n): Promise<ReadonlyMap<string, string>> {\n\tconst seconds = settings.timeouts.command;\n\tsocket.write(`EHLO ${settings.helo}\\r\\n`);\n\tconst ehlo = await socket.reply('the reply to EHLO', seconds);\n\tif (ehlo.code === 250) {\n\t\treturn parseEhlo(typeof ehlo.text === 'string' ? [ehlo.text] : ehlo.text);\n\t}\n\tif (ehlo.code < 500 || !allowHelo) throw refused(socket.host, 'EHLO', ehlo);\n\tsocket.write(`HELO ${settings.helo}\\r\\n`);\n\tconst helo = await socket.reply('the reply to HELO', seconds);\n\tif (helo.code !== 250) throw refused(socket.host, 'HELO', helo);\n\treturn new Map();\n}\n\n/** STARTTLS when offered (RFC 3207); `required` fails without it, `opportunistic` goes on in clear. */\nasync function startTls(\n\tsocket: ClientSocket,\n\tsettings: ClientSettings,\n\ttls: TlsTarget,\n\textensions: ReadonlyMap<string, string>,\n): Promise<ReadonlyMap<string, string>> {\n\tconst required = settings.tls === 'required';\n\tif (!extensions.has('STARTTLS')) {\n\t\tif (!required) return extensions;\n\t\tthrow new SmtpError(\n\t\t\t'TLS_UNAVAILABLE',\n\t\t\t`${socket.host} does not offer STARTTLS, and tls is 'required'`,\n\t\t);\n\t}\n\tsocket.write('STARTTLS\\r\\n');\n\tconst answer = await socket.reply(\n\t\t'the reply to STARTTLS',\n\t\tsettings.timeouts.command,\n\t);\n\tif (answer.code !== 220) {\n\t\tif (!required) return extensions;\n\t\tthrow new SmtpError(\n\t\t\t'TLS_UNAVAILABLE',\n\t\t\t`${socket.host} refused STARTTLS, and tls is 'required': ${shown(answer)}`,\n\t\t\t{ reply: answer, temporary: true },\n\t\t);\n\t}\n\tawait socket.startTls(tls, settings.timeouts.connect);\n\t// RFC 3207 §4.2: what was learnt in clear is forgotten; EHLO again.\n\treturn hello(socket, settings, false);\n}\n\n/** AUTH PLAIN or LOGIN (RFC 4954), over TLS unless `allowPlaintextAuth`. */\nasync function authenticate(\n\tsocket: ClientSocket,\n\tsettings: ClientSettings,\n\textensions: ReadonlyMap<string, string>,\n): Promise<void> {\n\tconst { auth } = settings;\n\tif (!auth) return;\n\tconst { host } = socket;\n\tif (!socket.secure && !settings.allowPlaintextAuth) {\n\t\tthrow new SmtpError(\n\t\t\t'AUTH_UNAVAILABLE',\n\t\t\t`Refusing to send credentials to ${host} in clear: it did not start TLS (allowPlaintextAuth is for a local test server only)`,\n\t\t);\n\t}\n\tconst offered = (extensions.get('AUTH') ?? '').toUpperCase().split(' ');\n\tconst mechanism =\n\t\tauth.mechanism ??\n\t\t(offered.includes('PLAIN')\n\t\t\t? 'PLAIN'\n\t\t\t: offered.includes('LOGIN')\n\t\t\t\t? 'LOGIN'\n\t\t\t\t: undefined);\n\tif (!mechanism || !offered.includes(mechanism)) {\n\t\tthrow new SmtpError(\n\t\t\t'AUTH_UNAVAILABLE',\n\t\t\t`${host} offers no AUTH mechanism this client speaks (${auth.mechanism ?? 'PLAIN, LOGIN'}): AUTH ${extensions.get('AUTH') ?? 'is not offered'}`,\n\t\t);\n\t}\n\tconst seconds = settings.timeouts.command;\n\tconst steps =\n\t\tmechanism === 'PLAIN'\n\t\t\t? [`AUTH PLAIN ${encodePlain(auth.username, auth.password)}`]\n\t\t\t: [\n\t\t\t\t\t'AUTH LOGIN',\n\t\t\t\t\tencodeLoginStep(auth.username),\n\t\t\t\t\tencodeLoginStep(auth.password),\n\t\t\t\t];\n\tfor (const [i, step] of steps.entries()) {\n\t\tsocket.write(`${step}\\r\\n`);\n\t\tconst answer = await socket.reply('the reply to AUTH', seconds);\n\t\tconst last = i === steps.length - 1;\n\t\tif (answer.code === (last ? 235 : 334)) continue;\n\t\tthrow refused(host, `AUTH ${mechanism}`, answer);\n\t}\n}\n\n/** The greeting, EHLO, STARTTLS and AUTH: a session ready for MAIL FROM. */\nexport async function open(\n\tsocket: ClientSocket,\n\tsettings: ClientSettings,\n\ttls: TlsTarget,\n): Promise<Ready> {\n\tconst greeting = await socket.reply(\n\t\t'the greeting',\n\t\tsettings.timeouts.greeting,\n\t);\n\tif (greeting.code !== 220) {\n\t\tthrow refused(socket.host, 'the connection', greeting);\n\t}\n\tlet extensions = await hello(socket, settings, true);\n\tif (!socket.secure && settings.tls !== 'none') {\n\t\textensions = await startTls(socket, settings, tls, extensions);\n\t}\n\tawait authenticate(socket, settings, extensions);\n\treturn { extensions, authenticated: settings.auth !== undefined };\n}\n",
12
- "import { hostname as machineName } from 'node:os';\nimport { SmtpError } from '../errors';\nimport { isHelloName, parsePath } from '../protocol/path';\nimport type {\n\tMxDestination,\n\tSendMailAuth,\n\tSendMailEnvelope,\n\tSendMailOptions,\n\tSendMailTimeouts,\n\tTlsMode,\n} from './options';\n\n/** The longest delay `setTimeout` takes, in seconds: past 2^31 − 1 ms it fires after 1 ms. */\nexport const MAX_SECONDS = Math.floor(2_147_483_647 / 1000);\n\n/** RFC 5321 §4.5.3.2's timeouts; `connect` is this client's own. */\nconst TIMEOUTS: Required<SendMailTimeouts> = {\n\tconnect: 30,\n\tgreeting: 300,\n\tcommand: 300,\n\tmail: 300,\n\trcpt: 300,\n\tdataStart: 120,\n\tdataBlock: 180,\n\tdataEnd: 600,\n};\n\n/** The options, checked, with their defaults; timeouts in seconds. */\nexport interface ClientSettings {\n\treadonly from: string;\n\treadonly to: readonly string[];\n\treadonly helo: string;\n\treadonly tls: TlsMode;\n\treadonly secure: boolean;\n\treadonly ca?: readonly string[];\n\treadonly auth?: SendMailAuth;\n\treadonly allowPlaintextAuth: boolean;\n\treadonly size?: number;\n\t/** An address is not ASCII, or `smtputf8` asked for it. */\n\treadonly smtputf8: boolean;\n\treadonly normalizeLineEnds: boolean;\n\treadonly timeouts: Required<SendMailTimeouts>;\n\treadonly deadline: number;\n}\n\n/** `INVALID_OPTION`, for an option `sendMail` cannot take. */\nexport const invalid = (message: string) =>\n\tnew SmtpError('INVALID_OPTION', `sendMail(): ${message}`);\n\nfunction seconds(name: string, value: unknown, fallback: number): number {\n\tif (value === undefined) return fallback;\n\tif (\n\t\ttypeof value !== 'number' ||\n\t\t!Number.isFinite(value) ||\n\t\tvalue <= 0 ||\n\t\tvalue > MAX_SECONDS\n\t) {\n\t\tthrow invalid(\n\t\t\t`${name} must be a number of seconds above 0 and at most ${MAX_SECONDS}, not ${String(value)}`,\n\t\t);\n\t}\n\treturn value;\n}\n\nfunction timeoutsOf(given: SendMailTimeouts = {}): Required<SendMailTimeouts> {\n\tconst out: Record<string, number> = {};\n\tfor (const [name, fallback] of Object.entries(TIMEOUTS)) {\n\t\tout[name] = seconds(\n\t\t\t`timeouts.${name}`,\n\t\t\tgiven[name as keyof SendMailTimeouts],\n\t\t\tfallback,\n\t\t);\n\t}\n\treturn out as Required<SendMailTimeouts>;\n}\n\n/**\n * `from` or a recipient, checked as an RFC 5321 path, since it is written\n * into `MAIL FROM:<…>` or `RCPT TO:<…>` as it is. A source route is refused\n * (§4.1.1.3: clients should not send one), with a message of its own when\n * the route is otherwise valid.\n */\nfunction address(value: unknown, allowNull: boolean): string {\n\tconst text = typeof value === 'string' ? value : '';\n\tif (typeof value === 'string' && parsePath(`<${text}>`, allowNull, 'refuse'))\n\t\treturn text;\n\tconst routed = typeof value === 'string' && parsePath(`<${text}>`, false);\n\tif (routed) {\n\t\tthrow invalid(\n\t\t\t`${JSON.stringify(value)} holds a source route (@host:), which RFC 5321 says a client should not send: pass ${JSON.stringify(`${routed.local}@${text.slice(text.lastIndexOf('@') + 1)}`)} alone`,\n\t\t);\n\t}\n\tthrow invalid(\n\t\t`${JSON.stringify(value)} is not an address (local@domain${allowNull ? \", or '' for a bounce\" : ''})`,\n\t);\n}\n\n/**\n * `helo`, checked. By MX it is required: the machine's name (such as\n * `laptop.local`) is rarely a name that resolves back to the sender, which\n * receiving hosts penalise, and it would tell them the machine's name.\n */\nfunction heloOf(value: string | undefined, byMx: boolean): string {\n\tif (value !== undefined) {\n\t\tif (!isHelloName(value))\n\t\t\tthrow invalid(`helo \"${value}\" is not a host name`);\n\t\treturn value;\n\t}\n\tif (byMx)\n\t\tthrow invalid(\n\t\t\t\"helo is required for delivery by MX: pass your server's public name, such as helo: 'mail.example.com'\",\n\t\t);\n\tconst name = machineName();\n\treturn isHelloName(name) ? name : 'localhost';\n}\n\nfunction authOf(auth: SendMailAuth | undefined): SendMailAuth | undefined {\n\tif (auth === undefined) return undefined;\n\tconst { username, password, mechanism } = auth;\n\tif (typeof username !== 'string' || username === '')\n\t\tthrow invalid('auth.username must be a non-empty string');\n\tif (typeof password !== 'string' || password === '')\n\t\tthrow invalid('auth.password must be a non-empty string');\n\tif (mechanism !== undefined && mechanism !== 'PLAIN' && mechanism !== 'LOGIN')\n\t\tthrow invalid(\n\t\t\t`auth.mechanism must be 'PLAIN' or 'LOGIN', not ${mechanism}`,\n\t\t);\n\treturn auth;\n}\n\nfunction tlsOf(options: SendMailOptions, plaintextAuth: boolean): TlsMode {\n\tconst secure = options.secure === true;\n\tconst tls =\n\t\toptions.tls ??\n\t\t(secure || (options.auth && !plaintextAuth) ? 'required' : 'opportunistic');\n\tif (tls !== 'opportunistic' && tls !== 'required' && tls !== 'none')\n\t\tthrow invalid(\n\t\t\t`tls must be 'opportunistic', 'required' or 'none', not ${tls}`,\n\t\t);\n\tif (tls === 'none' && secure)\n\t\tthrow invalid(\n\t\t\t\"secure is TLS from the first byte: it cannot go with tls: 'none'\",\n\t\t);\n\tif (tls === 'none' && options.auth && !plaintextAuth)\n\t\tthrow invalid(\n\t\t\t\"auth with tls: 'none' would send the password in clear; pass allowPlaintextAuth: true for a local test server\",\n\t\t);\n\tif (tls === 'opportunistic' && options.auth && !plaintextAuth)\n\t\tthrow invalid(\n\t\t\t\"auth with tls: 'opportunistic' would send the password to a server whose certificate is not checked; leave tls out to check it, or pass allowPlaintextAuth: true for a local test server\",\n\t\t);\n\treturn tls;\n}\n\n/** Checks every option; throws an `SmtpError` (`INVALID_OPTION`) on the first wrong one. */\nexport function settingsOf(options: SendMailOptions): ClientSettings {\n\tif (typeof options !== 'object' || options === null)\n\t\tthrow invalid('options must be an object');\n\tconst from = address(options.from, true);\n\tconst list = typeof options.to === 'string' ? [options.to] : options.to;\n\tif (!Array.isArray(list) || list.length === 0)\n\t\tthrow invalid('to must name one recipient or more');\n\tconst to = list.map((recipient) => address(recipient, false));\n\tconst allowPlaintextAuth = options.allowPlaintextAuth === true;\n\tconst { size } = options;\n\tif (size !== undefined && (!Number.isSafeInteger(size) || size < 0))\n\t\tthrow invalid(`size must be a number of bytes, not ${size}`);\n\tconst ca = options.ca === undefined ? undefined : [options.ca].flat();\n\tconst auth = authOf(options.auth);\n\treturn {\n\t\tfrom,\n\t\tto,\n\t\thelo: heloOf(options.helo, byMx(options)),\n\t\ttls: tlsOf(options, allowPlaintextAuth),\n\t\tsecure: options.secure === true,\n\t\t...(ca ? { ca } : {}),\n\t\t...(auth ? { auth } : {}),\n\t\tallowPlaintextAuth,\n\t\t...(size === undefined ? {} : { size }),\n\t\tsmtputf8:\n\t\t\toptions.smtputf8 === true ||\n\t\t\t[from, ...to].some((text) => /[^ -~]/.test(text)),\n\t\tnormalizeLineEnds: options.normalizeLineEnds === true,\n\t\ttimeouts: timeoutsOf(options.timeouts),\n\t\tdeadline: seconds('deadline', options.deadline, 1800),\n\t};\n}\n\n/** Whether the options name a domain to deliver to by MX, not a host. */\nexport const byMx = (\n\toptions: SendMailOptions,\n): options is SendMailEnvelope & MxDestination =>\n\t!('host' in options && options.host !== undefined);\n\n/** A port: an integer from 1 to 65535. */\nexport function portOf(port: number | undefined, fallback: number): number {\n\tif (port === undefined) return fallback;\n\tif (!Number.isInteger(port) || port < 1 || port > 65535)\n\t\tthrow invalid(`port must be an integer from 1 to 65535, not ${port}`);\n\treturn port;\n}\n",
13
+ "import { hostname as machineName } from 'node:os';\nimport { SmtpError } from '../errors';\nimport { isHelloName, parsePath } from '../protocol/path';\nimport { isMailbox } from './address';\nimport type {\n\tMxDestination,\n\tSendMailAuth,\n\tSendMailEnvelope,\n\tSendMailOptions,\n\tSendMailTimeouts,\n\tTlsMode,\n} from './options';\n\n/** The longest delay `setTimeout` takes, in seconds: past 2^31 − 1 ms it fires after 1 ms. */\nexport const MAX_SECONDS = Math.floor(2_147_483_647 / 1000);\n\n/** RFC 5321 §4.5.3.2's timeouts; `connect` is this client's own. */\nconst TIMEOUTS: Required<SendMailTimeouts> = {\n\tconnect: 30,\n\tgreeting: 300,\n\tcommand: 300,\n\tmail: 300,\n\trcpt: 300,\n\tdataStart: 120,\n\tdataBlock: 180,\n\tdataEnd: 600,\n};\n\n/** The options, checked, with their defaults; timeouts in seconds. */\nexport interface ClientSettings {\n\treadonly from: string;\n\treadonly to: readonly string[];\n\treadonly helo: string;\n\treadonly tls: TlsMode;\n\treadonly secure: boolean;\n\treadonly ca?: readonly string[];\n\treadonly auth?: SendMailAuth;\n\treadonly allowPlaintextAuth: boolean;\n\treadonly size?: number;\n\t/** An address is not ASCII, or `smtputf8` asked for it. */\n\treadonly smtputf8: boolean;\n\treadonly normalizeLineEnds: boolean;\n\treadonly timeouts: Required<SendMailTimeouts>;\n\treadonly deadline: number;\n}\n\n/** `INVALID_OPTION`, for an option `sendMail` cannot take. */\nexport const invalid = (message: string) =>\n\tnew SmtpError('INVALID_OPTION', `sendMail(): ${message}`);\n\nfunction seconds(name: string, value: unknown, fallback: number): number {\n\tif (value === undefined) return fallback;\n\tif (\n\t\ttypeof value !== 'number' ||\n\t\t!Number.isFinite(value) ||\n\t\tvalue <= 0 ||\n\t\tvalue > MAX_SECONDS\n\t) {\n\t\tthrow invalid(\n\t\t\t`${name} must be a number of seconds above 0 and at most ${MAX_SECONDS}, not ${String(value)}`,\n\t\t);\n\t}\n\treturn value;\n}\n\nfunction timeoutsOf(given: SendMailTimeouts = {}): Required<SendMailTimeouts> {\n\tconst out: Record<string, number> = {};\n\tfor (const [name, fallback] of Object.entries(TIMEOUTS)) {\n\t\tout[name] = seconds(\n\t\t\t`timeouts.${name}`,\n\t\t\tgiven[name as keyof SendMailTimeouts],\n\t\t\tfallback,\n\t\t);\n\t}\n\treturn out as Required<SendMailTimeouts>;\n}\n\n/**\n * `from` or a recipient, checked as an RFC 5321 path, since it is written\n * into `MAIL FROM:<…>` or `RCPT TO:<…>` as it is. A source route is refused\n * (§4.1.1.3: clients should not send one), with a message of its own when\n * the route is otherwise valid. What it takes, past the null sender, is\n * exactly what `isMailbox` says yes to: the two share one predicate.\n */\nfunction address(value: unknown, allowNull: boolean): string {\n\tif (allowNull && value === '') return '';\n\tif (isMailbox(value)) return value;\n\tconst text = typeof value === 'string' ? value : '';\n\tconst routed = typeof value === 'string' && parsePath(`<${text}>`, false);\n\tif (routed) {\n\t\tthrow invalid(\n\t\t\t`${JSON.stringify(value)} holds a source route (@host:), which RFC 5321 says a client should not send: pass ${JSON.stringify(`${routed.local}@${text.slice(text.lastIndexOf('@') + 1)}`)} alone`,\n\t\t);\n\t}\n\tthrow invalid(\n\t\t`${JSON.stringify(value)} is not an address (local@domain${allowNull ? \", or '' for a bounce\" : ''})`,\n\t);\n}\n\n/**\n * `helo`, checked. By MX it is required: the machine's name (such as\n * `laptop.local`) is rarely a name that resolves back to the sender, which\n * receiving hosts penalise, and it would tell them the machine's name.\n */\nfunction heloOf(value: string | undefined, byMx: boolean): string {\n\tif (value !== undefined) {\n\t\tif (!isHelloName(value))\n\t\t\tthrow invalid(`helo \"${value}\" is not a host name`);\n\t\treturn value;\n\t}\n\tif (byMx)\n\t\tthrow invalid(\n\t\t\t\"helo is required for delivery by MX: pass your server's public name, such as helo: 'mail.example.com'\",\n\t\t);\n\tconst name = machineName();\n\treturn isHelloName(name) ? name : 'localhost';\n}\n\nfunction authOf(auth: SendMailAuth | undefined): SendMailAuth | undefined {\n\tif (auth === undefined) return undefined;\n\tconst { username, password, mechanism } = auth;\n\tif (typeof username !== 'string' || username === '')\n\t\tthrow invalid('auth.username must be a non-empty string');\n\tif (typeof password !== 'string' || password === '')\n\t\tthrow invalid('auth.password must be a non-empty string');\n\tif (mechanism !== undefined && mechanism !== 'PLAIN' && mechanism !== 'LOGIN')\n\t\tthrow invalid(\n\t\t\t`auth.mechanism must be 'PLAIN' or 'LOGIN', not ${mechanism}`,\n\t\t);\n\treturn auth;\n}\n\nfunction tlsOf(options: SendMailOptions, plaintextAuth: boolean): TlsMode {\n\tconst secure = options.secure === true;\n\tconst tls =\n\t\toptions.tls ??\n\t\t(secure || (options.auth && !plaintextAuth) ? 'required' : 'opportunistic');\n\tif (tls !== 'opportunistic' && tls !== 'required' && tls !== 'none')\n\t\tthrow invalid(\n\t\t\t`tls must be 'opportunistic', 'required' or 'none', not ${tls}`,\n\t\t);\n\tif (tls === 'none' && secure)\n\t\tthrow invalid(\n\t\t\t\"secure is TLS from the first byte: it cannot go with tls: 'none'\",\n\t\t);\n\tif (tls === 'none' && options.auth && !plaintextAuth)\n\t\tthrow invalid(\n\t\t\t\"auth with tls: 'none' would send the password in clear; pass allowPlaintextAuth: true for a local test server\",\n\t\t);\n\tif (tls === 'opportunistic' && options.auth && !plaintextAuth)\n\t\tthrow invalid(\n\t\t\t\"auth with tls: 'opportunistic' would send the password to a server whose certificate is not checked; leave tls out to check it, or pass allowPlaintextAuth: true for a local test server\",\n\t\t);\n\treturn tls;\n}\n\n/** Checks every option; throws an `SmtpError` (`INVALID_OPTION`) on the first wrong one. */\nexport function settingsOf(options: SendMailOptions): ClientSettings {\n\tif (typeof options !== 'object' || options === null)\n\t\tthrow invalid('options must be an object');\n\tconst from = address(options.from, true);\n\tconst list = typeof options.to === 'string' ? [options.to] : options.to;\n\tif (!Array.isArray(list) || list.length === 0)\n\t\tthrow invalid('to must name one recipient or more');\n\tconst to = list.map((recipient) => address(recipient, false));\n\tconst allowPlaintextAuth = options.allowPlaintextAuth === true;\n\tconst { size } = options;\n\tif (size !== undefined && (!Number.isSafeInteger(size) || size < 0))\n\t\tthrow invalid(`size must be a number of bytes, not ${size}`);\n\tconst ca = options.ca === undefined ? undefined : [options.ca].flat();\n\tconst auth = authOf(options.auth);\n\treturn {\n\t\tfrom,\n\t\tto,\n\t\thelo: heloOf(options.helo, byMx(options)),\n\t\ttls: tlsOf(options, allowPlaintextAuth),\n\t\tsecure: options.secure === true,\n\t\t...(ca ? { ca } : {}),\n\t\t...(auth ? { auth } : {}),\n\t\tallowPlaintextAuth,\n\t\t...(size === undefined ? {} : { size }),\n\t\tsmtputf8:\n\t\t\toptions.smtputf8 === true ||\n\t\t\t[from, ...to].some((text) => /[^ -~]/.test(text)),\n\t\tnormalizeLineEnds: options.normalizeLineEnds === true,\n\t\ttimeouts: timeoutsOf(options.timeouts),\n\t\tdeadline: seconds('deadline', options.deadline, 1800),\n\t};\n}\n\n/** Whether the options name a domain to deliver to by MX, not a host. */\nexport const byMx = (\n\toptions: SendMailOptions,\n): options is SendMailEnvelope & MxDestination =>\n\t!('host' in options && options.host !== undefined);\n\n/** A port: an integer from 1 to 65535. */\nexport function portOf(port: number | undefined, fallback: number): number {\n\tif (port === undefined) return fallback;\n\tif (!Number.isInteger(port) || port < 1 || port > 65535)\n\t\tthrow invalid(`port must be an integer from 1 to 65535, not ${port}`);\n\treturn port;\n}\n",
13
14
  "import { LineSplitter, MAX_LINE } from '../protocol/lines';\nimport type { Reply } from '../protocol/reply';\nimport { ReplyReader } from '../protocol/reply-reader';\n\n/** The most bytes a server may send in one session, every reply together. */\nexport const MAX_REPLY_BYTES = 1024 * 1024;\n\n/**\n * What a server sent, put together into replies, each bounded: `MAX_LINE`\n * a line, `MAX_REPLY_LINES` a reply, `MAX_REPLY_BYTES` in all. One pass\n * over the bytes, whatever the chunks.\n */\nexport class Inbox {\n\treadonly #lines = new LineSplitter();\n\treadonly #reader = new ReplyReader();\n\treadonly #replies: Reply[] = [];\n\t#received = 0;\n\n\t/** Takes the next bytes; says what is wrong with them, if they are not replies. */\n\tpush(chunk: Uint8Array): string | undefined {\n\t\tthis.#received += chunk.length;\n\t\tif (this.#received > MAX_REPLY_BYTES) {\n\t\t\treturn `more than ${MAX_REPLY_BYTES} bytes of replies`;\n\t\t}\n\t\tthis.#lines.push(chunk);\n\t\tfor (let event = this.#lines.next(); event; event = this.#lines.next()) {\n\t\t\tif ('tooLong' in event)\n\t\t\t\treturn `a reply line longer than ${MAX_LINE} bytes`;\n\t\t\tconst result = this.#reader.line(event.line);\n\t\t\tif (result === undefined) continue;\n\t\t\tif ('error' in result) return result.error;\n\t\t\tthis.#replies.push(result);\n\t\t}\n\t\treturn undefined;\n\t}\n\n\t/** The next complete reply. */\n\tshift(): Reply | undefined {\n\t\treturn this.#replies.shift();\n\t}\n\n\t/** Bytes or replies not yet read. */\n\tget holding(): boolean {\n\t\treturn this.#lines.holding || this.#replies.length > 0;\n\t}\n}\n",
14
15
  "import type { TLSOptions } from 'bun';\n\n/** Where to connect: `host` names the server in errors, and is what TLS checks. */\nexport interface Endpoint {\n\treadonly host: string;\n\treadonly address: string;\n\treadonly port: number;\n}\n\n/** How to start TLS: check the certificate against `servername`, or not. */\nexport interface TlsTarget {\n\treadonly servername: string;\n\treadonly verify: boolean;\n\treadonly ca?: readonly string[];\n}\n\n/** Bun's TLS options for a target: `rejectUnauthorized` only when checking (RFC 7435 otherwise). */\nexport const tlsOptions = (tls: TlsTarget): TLSOptions => ({\n\tserverName: tls.servername,\n\trejectUnauthorized: tls.verify,\n\t...(tls.ca ? { ca: [...tls.ca] } : {}),\n});\n\n/** Why a connection or a handshake failed, from what Bun gave: its code, else its message. */\nexport const reason = (error: unknown): string =>\n\t(error as { code?: string } | null)?.code ??\n\t(error as Error | null)?.message ??\n\t'the handshake failed';\n\n/** The whole delivery's deadline. */\nexport class Clock {\n\treadonly seconds: number;\n\treadonly #end: number;\n\n\tconstructor(seconds: number) {\n\t\tthis.seconds = seconds;\n\t\tthis.#end = performance.now() + seconds * 1000;\n\t}\n\n\t/**\n\t * `promise`, or what `expire` gives, thrown once `ms` passed or the\n\t * deadline did, whichever comes first; `deadline` says which it was.\n\t */\n\tasync race<T>(\n\t\tpromise: Promise<T>,\n\t\tms: number,\n\t\texpire: (deadline: boolean) => Error,\n\t): Promise<T> {\n\t\tconst left = this.#end - performance.now();\n\t\tconst deadline = left < ms;\n\t\tms = Math.min(ms, left);\n\t\tif (ms <= 0) throw expire(deadline);\n\t\tlet timer: Timer | undefined;\n\t\tconst expired = new Promise<never>((_, reject) => {\n\t\t\ttimer = setTimeout(() => reject(expire(deadline)), ms);\n\t\t});\n\t\ttry {\n\t\t\treturn await Promise.race([promise, expired]);\n\t\t} finally {\n\t\t\tclearTimeout(timer);\n\t\t}\n\t}\n}\n",
15
16
  "import type { Socket, SocketHandler } from 'bun';\nimport { SmtpError } from '../errors';\nimport { Outgoing } from '../io/outgoing';\nimport type { Reply } from '../protocol/reply';\nimport { Inbox } from './inbox';\nimport { badReply, lost, refused, timedOut, tlsFailed } from './refusal';\nimport {\n\ttype Clock,\n\ttype Endpoint,\n\treason,\n\ttype TlsTarget,\n\ttlsOptions,\n} from './target';\n\n/**\n * A connection to an SMTP server: replies read as they come into an\n * `Inbox`, which bounds them; every wait bounded by its timeout and the\n * deadline. Whatever the server does ends in a reply or an `SmtpError`,\n * never in an exception of Bun's.\n */\nexport class ClientSocket {\n\treadonly host: string;\n\treadonly #clock: Clock;\n\t#socket: Socket<undefined> | undefined;\n\t#outgoing = new Outgoing(() => 0);\n\t/** Which socket's events count: the TLS one's after STARTTLS. */\n\t#tls = false;\n\treadonly #inbox = new Inbox();\n\t#failure: SmtpError | undefined;\n\t#closed = false;\n\t#wake: (() => void) | undefined;\n\t#handshaking: ((ok: boolean, error: unknown) => void) | undefined;\n\t/** Resolves when the connection is gone. */\n\treadonly #gone = Promise.withResolvers<void>();\n\tsecure = false;\n\t/** The certificate checked out against the host name. */\n\tverified = false;\n\n\tprivate constructor(host: string, clock: Clock) {\n\t\tthis.host = host;\n\t\tthis.#clock = clock;\n\t}\n\n\t/** Connects, with TLS from the first byte when `tls` is given. */\n\tstatic async open(\n\t\tendpoint: Endpoint,\n\t\ttls: TlsTarget | undefined,\n\t\tseconds: number,\n\t\tclock: Clock,\n\t): Promise<ClientSocket> {\n\t\tconst client = new ClientSocket(endpoint.host, clock);\n\t\tclient.#tls = tls !== undefined;\n\t\tconst handshake = tls ? client.#expectHandshake(tls) : undefined;\n\t\thandshake?.catch(() => {});\n\t\tconst { address, port } = endpoint;\n\t\tconst connecting = Bun.connect({\n\t\t\thostname: address,\n\t\t\tport,\n\t\t\t...(tls ? { tls: tlsOptions(tls) } : {}),\n\t\t\tsocket: client.#handlers(tls !== undefined),\n\t\t});\n\t\ttry {\n\t\t\tclient.#use(await client.#race(connecting, seconds, 'the connection'));\n\t\t} catch (error) {\n\t\t\tconnecting.then(\n\t\t\t\t(socket) => socket.terminate(),\n\t\t\t\t() => {},\n\t\t\t);\n\t\t\tif (error instanceof SmtpError) throw error;\n\t\t\tthrow new SmtpError(\n\t\t\t\t'CONNECTION_FAILED',\n\t\t\t\t`Could not connect to ${endpoint.host} (${address}:${port}): ${reason(error)}`,\n\t\t\t);\n\t\t}\n\t\tif (handshake) {\n\t\t\t// A handshake that failed before the connection resolved left it open.\n\t\t\tawait client.#race(handshake, seconds, 'the TLS handshake').catch((e) => {\n\t\t\t\tclient.close(true);\n\t\t\t\tthrow e;\n\t\t\t});\n\t\t}\n\t\treturn client;\n\t}\n\n\t#use(socket: Socket<undefined>): void {\n\t\tthis.#socket = socket;\n\t\tthis.#outgoing = new Outgoing((bytes) => socket.write(bytes));\n\t}\n\n\t/** Bun's events for one socket: only the live one's count, the clear one's or, after STARTTLS, the TLS one's. */\n\t#handlers(tls: boolean): SocketHandler<undefined> {\n\t\tconst live =\n\t\t\t<A extends unknown[]>(run: (...args: A) => void) =>\n\t\t\t(...args: A) => {\n\t\t\t\tif (this.#tls === tls) run(...args);\n\t\t\t};\n\t\treturn {\n\t\t\tdata: live((_, chunk: Uint8Array) => this.#receive(chunk)),\n\t\t\tdrain: live(() => this.#outgoing.drain()),\n\t\t\tclose: live(() => this.#lost()),\n\t\t\terror: live(() => this.#lost()),\n\t\t\thandshake: live((_, ok: boolean, error: Error | null) =>\n\t\t\t\tthis.#handshaking?.(ok, error),\n\t\t\t),\n\t\t};\n\t}\n\n\t#expectHandshake(tls: TlsTarget): Promise<void> {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthis.#handshaking = (ok, error) => {\n\t\t\t\tthis.#handshaking = undefined;\n\t\t\t\tif (this.#closed || (tls.verify && !ok)) {\n\t\t\t\t\tconst why = this.#closed ? 'the connection closed' : reason(error);\n\t\t\t\t\treturn reject(this.#fail(tlsFailed(this.host, why)));\n\t\t\t\t}\n\t\t\t\tthis.secure = true;\n\t\t\t\tthis.verified = ok && error === null;\n\t\t\t\tresolve();\n\t\t\t};\n\t\t});\n\t}\n\n\t#receive(chunk: Uint8Array): void {\n\t\tif (this.#failure || this.#closed) return;\n\t\tconst wrong = this.#inbox.push(chunk);\n\t\tif (wrong) this.#fail(badReply(this.host, wrong));\n\t\telse this.#wakeUp();\n\t}\n\n\t#wakeUp(): void {\n\t\tconst wake = this.#wake;\n\t\tthis.#wake = undefined;\n\t\twake?.();\n\t}\n\n\t#lost(): void {\n\t\tthis.#closed = true;\n\t\tthis.#gone.resolve();\n\t\tthis.#outgoing.clear();\n\t\tthis.#handshaking?.(false, null);\n\t\tthis.#wakeUp();\n\t}\n\n\t/** Records the first failure, hangs up, and returns it to throw. */\n\t#fail(error: SmtpError): SmtpError {\n\t\tthis.#failure ??= error;\n\t\tthis.#socket?.terminate();\n\t\tthis.#lost();\n\t\treturn this.#failure;\n\t}\n\n\t/**\n\t * `promise`, or a `TIMEOUT` once `seconds` passed since `start` (now by\n\t * default), or the deadline did, whichever comes first.\n\t */\n\t#race<T>(\n\t\tpromise: Promise<T>,\n\t\tseconds: number,\n\t\twhat: string,\n\t\tstart = performance.now(),\n\t): Promise<T> {\n\t\tconst ms = start + seconds * 1000 - performance.now();\n\t\tconst { host } = this;\n\t\tconst deadline = this.#clock.seconds;\n\t\treturn this.#clock.race(promise, ms, (passed) =>\n\t\t\tthis.#fail(timedOut(host, what, seconds, passed ? deadline : undefined)),\n\t\t);\n\t}\n\n\t/** The next reply, within `seconds` all told; `what` names it in errors: `the greeting`, `the reply to MAIL FROM`. */\n\tasync reply(what: string, seconds: number): Promise<Reply> {\n\t\tconst start = performance.now();\n\t\tfor (;;) {\n\t\t\tconst next = this.#inbox.shift();\n\t\t\tif (next) return next;\n\t\t\tif (this.#failure) throw this.#failure;\n\t\t\tif (this.#closed) throw this.#fail(lost(this.host, what));\n\t\t\tawait this.#race(\n\t\t\t\tnew Promise<void>((wake) => {\n\t\t\t\t\tthis.#wake = wake;\n\t\t\t\t}),\n\t\t\t\tseconds,\n\t\t\t\twhat,\n\t\t\t\tstart,\n\t\t\t);\n\t\t}\n\t}\n\n\t/** One of the caller's promises — the message stream's next part — bounded as a reply is, and cut short if the connection goes. */\n\twithin<T>(promise: Promise<T>, seconds: number, what: string): Promise<T> {\n\t\tconst gone = this.#gone.promise.then((): never => {\n\t\t\tthrow this.#hungUp(lost(this.host, what));\n\t\t});\n\t\treturn this.#race(Promise.race([promise, gone]), seconds, what);\n\t}\n\n\t/** Queues bytes for the server; nothing once the connection failed. */\n\twrite(data: Uint8Array | string): void {\n\t\tif (this.#failure || this.#closed) return;\n\t\tthis.#outgoing.write(\n\t\t\ttypeof data === 'string' ? new TextEncoder().encode(data) : data,\n\t\t);\n\t}\n\n\t/** Waits until the server took everything written. */\n\tasync drained(seconds: number): Promise<void> {\n\t\tawait this.#race(\n\t\t\tthis.#outgoing.drained(),\n\t\t\tseconds,\n\t\t\t'the server to take the message',\n\t\t);\n\t\tif (this.#failure || this.#closed) throw this.#hungUp(lost(this.host));\n\t}\n\n\t/** Why the connection is gone during DATA: its failure, the refusal a server sent before hanging up, or `lost`. */\n\t#hungUp(otherwise: SmtpError): SmtpError {\n\t\tif (this.#failure) return this.#failure;\n\t\tconst said = this.#inbox.shift();\n\t\treturn this.#fail(\n\t\t\tsaid ? refused(this.host, 'the message', said) : otherwise,\n\t\t);\n\t}\n\n\t/** After the 220 to STARTTLS: TLS on this connection. Anything the server sent past the 220 is an attack. */\n\tasync startTls(tls: TlsTarget, seconds: number): Promise<void> {\n\t\tconst socket = this.#socket;\n\t\tif (this.#inbox.holding || !socket) {\n\t\t\tthrow this.#fail(badReply(this.host, 'more after its 220 to STARTTLS'));\n\t\t}\n\t\tconst handshake = this.#expectHandshake(tls);\n\t\thandshake.catch(() => {});\n\t\tthis.#tls = true;\n\t\tconst [, encrypted] = socket.upgradeTLS<undefined>({\n\t\t\ttls: tlsOptions(tls),\n\t\t\tsocket: this.#handlers(true),\n\t\t});\n\t\tthis.#use(encrypted);\n\t\tawait this.#race(handshake, seconds, 'the TLS handshake');\n\t}\n\n\t/** Hangs up; `now` at once, so a message cut short is not delivered. */\n\tclose(now = false): void {\n\t\tthis.#closed = true;\n\t\tif (now) this.#socket?.terminate();\n\t\telse this.#socket?.end();\n\t}\n}\n",
16
17
  "import { type RecipientReply, SmtpError } from '../errors';\nimport { DataWriter } from '../protocol/data-writer';\nimport type { Reply } from '../protocol/reply';\nimport { bareLineBreak, type Content } from './content';\nimport { refused, shown } from './refusal';\nimport type { Ready } from './session';\nimport type { ClientSettings } from './settings';\nimport type { ClientSocket } from './socket';\n\n/** What the server said to the envelope and the message. */\nexport interface Delivered {\n\treadonly accepted: readonly RecipientReply[];\n\treadonly rejected: readonly RecipientReply[];\n\treadonly reply: Reply;\n}\n\nconst missing = (host: string, extension: string, why: string) =>\n\tnew SmtpError(\n\t\t'EXTENSION_MISSING',\n\t\t`${host} does not offer ${extension}, which ${why}`,\n\t);\n\n/** MAIL FROM's parameters: SIZE (RFC 1870), BODY (RFC 6152), SMTPUTF8 (RFC 6531). */\nfunction mailParameters(\n\thost: string,\n\tsettings: ClientSettings,\n\tcontent: Content,\n\textensions: ReadonlyMap<string, string>,\n): string {\n\tlet parameters = '';\n\tconst size = extensions.get('SIZE');\n\tif (size !== undefined && content.size !== undefined) {\n\t\tconst max = Number(size);\n\t\tif (Number.isSafeInteger(max) && max > 0 && content.size > max) {\n\t\t\tthrow new SmtpError(\n\t\t\t\t'MESSAGE_TOO_BIG',\n\t\t\t\t`The message (${content.size} bytes) is larger than the ${max} bytes ${host} takes (SIZE)`,\n\t\t\t\t{ temporary: false },\n\t\t\t);\n\t\t}\n\t\tparameters += ` SIZE=${content.size}`;\n\t}\n\tif (extensions.has('8BITMIME')) parameters += ' BODY=8BITMIME';\n\telse if (content.eightBit) {\n\t\tthrow missing(host, '8BITMIME', 'the message needs: it has 8-bit bytes');\n\t}\n\tif (settings.smtputf8) {\n\t\tif (!extensions.has('SMTPUTF8')) {\n\t\t\tthrow missing(\n\t\t\t\thost,\n\t\t\t\t'SMTPUTF8',\n\t\t\t\t'an address that is not ASCII needs (or smtputf8 asked for)',\n\t\t\t);\n\t\t}\n\t\tparameters += ' SMTPUTF8';\n\t}\n\treturn parameters;\n}\n\n/** MAIL FROM and every RCPT TO: in one write with PIPELINING (RFC 2920), else one by one. */\nasync function envelope(\n\tsocket: ClientSocket,\n\tsettings: ClientSettings,\n\tcontent: Content,\n\tready: Ready,\n): Promise<{ accepted: RecipientReply[]; rejected: RecipientReply[] }> {\n\tconst { host } = socket;\n\tconst { timeouts } = settings;\n\tconst mail = `MAIL FROM:<${settings.from}>${mailParameters(host, settings, content, ready.extensions)}\\r\\n`;\n\tconst rcpts = settings.to.map((to) => `RCPT TO:<${to}>\\r\\n`);\n\tconst pipelining = ready.extensions.has('PIPELINING');\n\tsocket.write(pipelining ? mail + rcpts.join('') : mail);\n\tconst from = await socket.reply('the reply to MAIL FROM', timeouts.mail);\n\tif (from.code !== 250) throw refused(host, 'the sender', from);\n\tconst accepted: RecipientReply[] = [];\n\tconst rejected: RecipientReply[] = [];\n\tfor (const [i, recipient] of settings.to.entries()) {\n\t\tif (!pipelining) socket.write(rcpts[i] as string);\n\t\tconst reply = await socket.reply('the reply to RCPT TO', timeouts.rcpt);\n\t\tconst into = reply.code === 250 || reply.code === 251 ? accepted : rejected;\n\t\tinto.push({ recipient, reply });\n\t}\n\tif (accepted.length === 0) {\n\t\tconst first = rejected[0] as RecipientReply;\n\t\tthrow new SmtpError(\n\t\t\t'RECIPIENTS_REFUSED',\n\t\t\t`${host} refused every recipient, ${first.recipient} with ${shown(first.reply)}`,\n\t\t\t{\n\t\t\t\treply: first.reply,\n\t\t\t\trejected,\n\t\t\t\ttemporary: rejected.some(({ reply }) => reply.code < 500),\n\t\t\t},\n\t\t);\n\t}\n\treturn { accepted, rejected };\n}\n\n/** The message, stuffed, block by block as the server takes it; a bad stream hangs up before the dot. */\nasync function data(\n\tsocket: ClientSocket,\n\tsettings: ClientSettings,\n\tcontent: Content,\n\tready: Ready,\n): Promise<Reply> {\n\tconst { host } = socket;\n\tconst { timeouts } = settings;\n\tsocket.write('DATA\\r\\n');\n\tconst start = await socket.reply('the reply to DATA', timeouts.dataStart);\n\tif (start.code !== 354) throw refused(host, 'DATA', start);\n\tconst writer = new DataWriter(settings.normalizeLineEnds);\n\tconst eightBitOk = ready.extensions.has('8BITMIME');\n\tconst chunks = content.chunks();\n\tlet tail: Uint8Array;\n\ttry {\n\t\tfor (;;) {\n\t\t\t// The caller's stream is bounded as the server is: a stalled one times out.\n\t\t\tconst chunk = await socket.within(\n\t\t\t\tchunks.next(),\n\t\t\t\ttimeouts.dataBlock,\n\t\t\t\t'the next part of the message',\n\t\t\t);\n\t\t\tif (!chunk) break;\n\t\t\tconst bytes = writer.write(chunk);\n\t\t\tif (writer.bareLineBreaks > 0) throw bareLineBreak();\n\t\t\tif (writer.eightBit && !eightBitOk) {\n\t\t\t\tthrow missing(\n\t\t\t\t\thost,\n\t\t\t\t\t'8BITMIME',\n\t\t\t\t\t'the message needs: it has 8-bit bytes',\n\t\t\t\t);\n\t\t\t}\n\t\t\tsocket.write(bytes);\n\t\t\tawait socket.drained(timeouts.dataBlock);\n\t\t}\n\t\t// A CR held at the very end is bare only now: still no dot for it.\n\t\ttail = writer.end();\n\t\tif (writer.bareLineBreaks > 0) throw bareLineBreak();\n\t} catch (error) {\n\t\t// No final dot: the server drops what it has of the message.\n\t\tchunks.cancel();\n\t\tsocket.close(true);\n\t\tthrow error;\n\t}\n\tsocket.write(tail);\n\tconst end = await socket.reply(\n\t\t'the reply to the final dot',\n\t\ttimeouts.dataEnd,\n\t);\n\tif (end.code !== 250) throw refused(host, 'the message', end);\n\treturn end;\n}\n\n/** One message: the envelope, then the content. */\nexport async function transact(\n\tsocket: ClientSocket,\n\tsettings: ClientSettings,\n\tcontent: Content,\n\tready: Ready,\n): Promise<Delivered> {\n\tconst { accepted, rejected } = await envelope(\n\t\tsocket,\n\t\tsettings,\n\t\tcontent,\n\t\tready,\n\t);\n\tconst reply = await data(socket, settings, content, ready);\n\treturn { accepted, rejected, reply };\n}\n",
17
18
  "import { SmtpError } from '../errors';\nimport { type Content, contentOf } from './content';\nimport { addressesOf, noAddress, resolveMx } from './mx';\nimport type {\n\tMessageSource,\n\tMxDestination,\n\tSendMailOptions,\n\tSendMailResult,\n} from './options';\nimport { timedOut } from './refusal';\nimport { open } from './session';\nimport {\n\tbyMx,\n\ttype ClientSettings,\n\tinvalid,\n\tportOf,\n\tsettingsOf,\n} from './settings';\nimport { ClientSocket } from './socket';\nimport { Clock, type Endpoint, type TlsTarget } from './target';\nimport { transact } from './transaction';\n\n/** The most addresses one delivery tries, every MX host together; and the most MX hosts it looks up. */\nexport const MAX_ADDRESSES = 10;\n\n/** Seconds to wait for the 221 to QUIT once the message was taken. */\nconst QUIT_WAIT = 5;\n\n/** Errors from before MAIL FROM: another MX host may do better. */\nconst early = new WeakSet<object>();\n\n/** One session with one server, from the connection to QUIT. */\nasync function attempt(\n\tendpoint: Endpoint,\n\tsettings: ClientSettings,\n\tcontent: Content,\n\tclock: Clock,\n): Promise<SendMailResult> {\n\tconst tls: TlsTarget = {\n\t\tservername: endpoint.host,\n\t\tverify: settings.tls === 'required',\n\t\t...(settings.ca ? { ca: settings.ca } : {}),\n\t};\n\tlet socket: ClientSocket;\n\ttry {\n\t\tsocket = await ClientSocket.open(\n\t\t\tendpoint,\n\t\t\tsettings.secure ? tls : undefined,\n\t\t\tsettings.timeouts.connect,\n\t\t\tclock,\n\t\t);\n\t} catch (error) {\n\t\tearly.add(error as object);\n\t\tthrow error;\n\t}\n\tlet quit = false;\n\ttry {\n\t\tconst ready = await open(socket, settings, tls).catch((error) => {\n\t\t\tearly.add(error as object);\n\t\t\tthrow error;\n\t\t});\n\t\tconst delivered = await transact(socket, settings, content, ready);\n\t\tsocket.write('QUIT\\r\\n');\n\t\tquit = true;\n\t\tawait socket\n\t\t\t.reply(\n\t\t\t\t'the reply to QUIT',\n\t\t\t\tMath.min(QUIT_WAIT, settings.timeouts.command),\n\t\t\t)\n\t\t\t.catch(() => {});\n\t\treturn {\n\t\t\t...delivered,\n\t\t\thost: endpoint.host,\n\t\t\tport: endpoint.port,\n\t\t\ttls: socket.secure ? { verified: socket.verified } : false,\n\t\t\tauthenticated: ready.authenticated,\n\t\t};\n\t} finally {\n\t\t// After a refusal the session is still in step: say goodbye.\n\t\tif (!quit) socket.write('QUIT\\r\\n');\n\t\tsocket.close();\n\t}\n}\n\n/** A DNS lookup, bounded by the delivery's deadline (the resolver has its own timeout too). */\nconst withinDeadline = <T>(\n\tlookup: Promise<T>,\n\tclock: Clock,\n\tname: string,\n\twhat: string,\n): Promise<T> =>\n\tclock.race(lookup, Number.POSITIVE_INFINITY, () =>\n\t\ttimedOut(name, what, clock.seconds, clock.seconds),\n\t);\n\n/** Direct delivery: each MX host's addresses in turn, while the failures are temporary and before MAIL FROM. */\nasync function viaMx(\n\toptions: MxDestination,\n\tsettings: ClientSettings,\n\tcontent: Content,\n\tclock: Clock,\n): Promise<SendMailResult> {\n\tconst { domain, resolver } = options;\n\tif (typeof domain !== 'string' || domain === '')\n\t\tthrow invalid('domain must be a domain name');\n\tif (typeof resolver?.mx !== 'function')\n\t\tthrow invalid('resolver must be a Resolver, such as @bumail/dns gives');\n\tconst port = portOf(options.port, 25);\n\tlet last: unknown;\n\tlet dnsError: unknown;\n\tlet tried = 0;\n\tlet looked = 0;\n\tconst mailHosts = await withinDeadline(\n\t\tresolveMx(domain, resolver),\n\t\tclock,\n\t\tdomain,\n\t\t'the MX lookup',\n\t);\n\thosts: for (const mx of mailHosts) {\n\t\t// A host looked up counts, with an address or not: no endless lookups.\n\t\tif (tried >= MAX_ADDRESSES || looked++ >= MAX_ADDRESSES) break;\n\t\tconst addresses = await withinDeadline(\n\t\t\taddressesOf(mx.host, resolver),\n\t\t\tclock,\n\t\t\tmx.host,\n\t\t\t'the address lookup',\n\t\t);\n\t\tif (!Array.isArray(addresses)) {\n\t\t\tdnsError = addresses.error;\n\t\t\tcontinue;\n\t\t}\n\t\tfor (const address of addresses) {\n\t\t\tif (tried++ >= MAX_ADDRESSES) break hosts;\n\t\t\ttry {\n\t\t\t\treturn await attempt(\n\t\t\t\t\t{ host: mx.host, address, port },\n\t\t\t\t\tsettings,\n\t\t\t\t\tcontent,\n\t\t\t\t\tclock,\n\t\t\t\t);\n\t\t\t} catch (error) {\n\t\t\t\tconst next =\n\t\t\t\t\terror instanceof SmtpError && error.temporary && early.has(error);\n\t\t\t\tif (!next) throw error;\n\t\t\t\tlast = error;\n\t\t\t}\n\t\t}\n\t}\n\tthrow last ?? noAddress(domain, dnsError);\n}\n\n/**\n * Delivers one message to one destination: a host (`{ host, port }`, a\n * smarthost or a submission server) or a domain's mail hosts (`{ domain,\n * resolver }`, by MX). Resolves once the server took the message for one\n * recipient at least; rejects with an `SmtpError` otherwise, `temporary`\n * telling whether to try again later. It is not a queue: retries are the\n * caller's.\n */\nexport async function sendMail(\n\tmessage: MessageSource,\n\toptions: SendMailOptions,\n): Promise<SendMailResult> {\n\tconst settings = settingsOf(options);\n\tconst content = contentOf(message, settings.normalizeLineEnds, settings.size);\n\tconst clock = new Clock(settings.deadline);\n\tif (!byMx(options)) {\n\t\tconst { host } = options;\n\t\tif (typeof host !== 'string' || !/^[^\\s/]+$/.test(host))\n\t\t\tthrow invalid(`host must be a host name or an address, not ${host}`);\n\t\tconst port = portOf(options.port, settings.secure ? 465 : 25);\n\t\treturn attempt({ host, address: host, port }, settings, content, clock);\n\t}\n\treturn viaMx(options, settings, content, clock);\n}\n"
18
19
  ],
19
- "mappings": ";;;;;;;;;;;AAYA,SAAS,OAAO,CAAC,OAAoC;AAAA,EACpD,OAAO,iBAAiB,SAAS,MAAM,SAAS,aAC5C,MAAoC,OACrC;AAAA;AAQJ,SAAS,SAAS,CAAC,OAAyB;AAAA,EAC3C,MAAM,OAAO,QAAQ,KAAK;AAAA,EAC1B,OAAO,SAAS,aAAa,SAAS,eAAe,SAAS;AAAA;AAG/D,IAAM,YAAY,CAAC,UAClB,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AAM/C,SAAS,YAAY,CAC3B,OACA,SAAuB,KAAK,QACf;AAAA,EACb,OAAO,MACL,IAAI,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,E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UACA,SACA,KACD;AAAA,UACC,OAAO,OAAO;AAAA,UACf,MAAM,OACL,iBAAiB,cAAa,MAAM,aAAa,MAAM,IAAI,KAAK;AAAA,UACjE,IAAI,CAAC;AAAA,YAAM,MAAM;AAAA,UACjB,OAAO;AAAA;AAAA,MAET;AAAA,IACD;AAAA,EACA,MAAM,QAAQ,UAAU,QAAQ,QAAQ;AAAA;AAWzC,eAAsB,QAAQ,CAC7B,SACA,SAC0B;AAAA,EAC1B,MAAM,WAAW,WAAW,OAAO;AAAA,EACnC,MAAM,UAAU,UAAU,SAAS,SAAS,mBAAmB,SAAS,IAAI;AAAA,EAC5E,MAAM,QAAQ,IAAI,MAAM,SAAS,QAAQ;AAAA,EACzC,IAAI,CAAC,KAAK,OAAO,GAAG;AAAA,IACnB,QAAQ,SAAS;AAAA,IACjB,IAAI,OAAO,SAAS,YAAY,CAAC,YAAY,KAAK,IAAI;AAAA,MACrD,MAAM,QAAQ,+CAA+C,MAAM;AAAA,IACpE,MAAM,OAAO,OAAO,QAAQ,MAAM,SAAS,SAAS,MAAM,EAAE;AAAA,IAC5D,OAAO,QAAQ,EAAE,MAAM,SAAS,MAAM,KAAK,GAAG,UAAU,SAAS,KAAK;AAAA,EACvE;AAAA,EACA,OAAO,MAAM,SAAS,UAAU,SAAS,KAAK;AAAA;",
21
+ "debugId": "6054CCD3D7858E7364756E2164756E21",
21
22
  "names": []
22
23
  }
@@ -1 +1 @@
1
- {"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/client/settings.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,KAAK,EACX,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,OAAO,EACP,MAAM,WAAW,CAAC;AAEnB,8FAA8F;AAC9F,eAAO,MAAM,WAAW,QAAmC,CAAC;AAc5D,sEAAsE;AACtE,MAAM,WAAW,cAAc;IAC9B,QAAQ,CA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sePath, type SourceRoute } from './protocol/path';
5
5
  export { formatReply, type Reply, reply } from './protocol/reply';
6
6
  export { type Credentials, decodeLoginStep, decodePlain, } from './protocol/sasl';
7
+ export { clientKey } from './server/client-key';
7
8
  export type { Envelope, HookResult, ReceivedMessage, Session, SmtpHooks, SmtpServerOptions, TlsOptions, } from './server/options';
8
9
  export { createSmtpServer, type SmtpServer } from './server/server';
9
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AACzD,OAAO,EACN,KAAK,OAAO,EACZ,KAAK,WAAW,EAChB,YAAY,EACZ,gBAAgB,GAChB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,KAAK,SAAS,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,KAAK,IAAI,EAAE,SAAS,EAAE,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,KAAK,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EACN,KAAK,WAAW,EAChB,eAAe,EACf,WAAW,GACX,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACX,QAAQ,EACR,UAAU,EACV,eAAe,EACf,OAAO,EACP,SAAS,EACT,iBAAiB,EACjB,UAAU,GACV,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AACzD,OAAO,EACN,KAAK,OAAO,EACZ,KAAK,WAAW,EAChB,YAAY,EACZ,gBAAgB,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