@bumail/smtp 0.10.0 → 0.11.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.
@@ -1157,7 +1157,8 @@ a token`; `orcpt.address of <address> must be a non-empty string`; `orcpt of
1157
1157
  <address> is over 500 characters once encoded`.
1158
1158
 
1159
1159
  **Why**: RFC 3461 §4.4 and §4.2 cap the parameters as sent, so a character that
1160
- xtext writes as `+XX` counts three.
1160
+ xtext writes as `+XX` counts three (for a `utf-8` `orcpt`, the unitext form:
1161
+ raw UTF-8 octets, `\x{HH}` = 6; for another type, the type, the `;` and the xtext form).
1161
1162
 
1162
1163
  **Fix**: shorten the value, or give the type as letters, digits and hyphens.
1163
1164
 
@@ -1171,18 +1172,24 @@ await sendMail(message, { host, from, to, envid: 'q-1042' }); // not 'q 1042 …
1171
1172
  than `FULL` or `HDRS`; `ENVID` empty, longer than 100 characters as sent,
1172
1173
  not printable ASCII or not xtext; `NOTIFY` mixing `NEVER` with another
1173
1174
  event, naming an event twice or an unknown one; `ORCPT` with no
1174
- `addr-type;` prefix, an address that is not xtext, or more than 500
1175
- characters as sent (RFC 3461 §4.2).
1175
+ `addr-type;` prefix, an address that does not decode (not xtext for
1176
+ `rfc822`; for `utf-8`, RFC 6533's `\x{HEX}` form, with raw UTF-8 only when
1177
+ the transaction used `SMTPUTF8`), or more than 500 characters as sent (RFC
1178
+ 3461 §4.2).
1176
1179
 
1177
1180
  **Why**: RFC 3461 §4. The server refuses the command rather than hand a
1178
1181
  wrong value to `onData`.
1179
1182
 
1180
1183
  **Fix**, as a client: encode the value as xtext (`+` and `=`, spaces and
1181
- non-ASCII bytes as `+XX`), and send `NOTIFY=NEVER` alone.
1184
+ non-ASCII bytes as `+XX`), and send `NOTIFY=NEVER` alone. For
1185
+ `ORCPT=utf-8;` use RFC 6533 instead: `\x{E9}` for `é`, and `\x{2B}` for `+`
1186
+ (not `+2B`), or raw UTF-8 after `MAIL FROM … SMTPUTF8`.
1182
1187
 
1183
1188
  ```text
1184
1189
  C: RCPT TO:<bob@example.com> NOTIFY=SUCCESS,FAILURE ORCPT=rfc822;bob+2Btag@example.com
1185
1190
  S: 250 2.1.5 OK
1191
+ C: RCPT TO:<bob@example.com> ORCPT=utf-8;\x{E9}l\x{E8}ve@example.com
1192
+ S: 250 2.1.5 OK
1186
1193
  ```
1187
1194
 
1188
1195
  ### `501 5.5.4 … given twice`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bumail/smtp",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "description": "An SMTP server on Bun.listen — RFC 5321 with PIPELINING, SIZE, 8BITMIME, SMTPUTF8, STARTTLS and AUTH after TLS, policy hooks, and no open relay — and a client that delivers a message to a smarthost or by MX",
5
5
  "license": "MIT",
6
6
  "type": "module",