@yozz.app/imap 0.1.4 → 0.1.6
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 +6 -0
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +3 -2
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -36,3 +36,9 @@ Or for a specific host with authentication:
|
|
|
36
36
|
```bash
|
|
37
37
|
YOZZ_IMAP_HOST=imap.example.com YOZZ_IMAP_USER=me@example.com YOZZ_IMAP_PASSWORD=secret pnpm -F @yozz.app/imap live imap.example.com
|
|
38
38
|
```
|
|
39
|
+
|
|
40
|
+
A literal over 64 MiB (`DEFAULT_MAX_LITERAL_BYTES`, or `maxLiteralBytes` in the options) is a protocol failure.
|
|
41
|
+
|
|
42
|
+
`harness/relay-load.ts` pushes large messages through the hosted yozz.app relay, up over SMTP and
|
|
43
|
+
back down over IMAP, using a throwaway Forward Email alias and YOZZ account that it deletes. It is
|
|
44
|
+
for the maintainers; it needs `FORWARD_EMAIL_API_KEY` for the yozz.app domain.
|
package/dist/index.d.mts
CHANGED
|
@@ -217,7 +217,7 @@ type ImapSelected = {
|
|
|
217
217
|
};
|
|
218
218
|
type ImapClientOptions = {
|
|
219
219
|
readonly onUntagged?: (response: ImapUntagged) => void;
|
|
220
|
-
/** Default
|
|
220
|
+
/** Default 64 MiB; a larger literal is a protocol failure. */
|
|
221
221
|
readonly maxLiteralBytes?: number;
|
|
222
222
|
};
|
|
223
223
|
type ImapIdle = {
|
|
@@ -255,9 +255,9 @@ type ImapClient = {
|
|
|
255
255
|
readonly uidExpunge: (uidSet: string) => Promise<ImapResult<void>>;
|
|
256
256
|
readonly uidSearchHeader: (header: string, value: string) => Promise<ImapResult<readonly number[]>>;
|
|
257
257
|
/**
|
|
258
|
-
* The selected mailbox's uids whose subject, sender or body contains `text`, ascending.
|
|
259
|
-
* search per field and a union: `TEXT` alone is the body on Forward Email's server, and its
|
|
260
|
-
* answers a subset of what the operands do.
|
|
258
|
+
* The selected mailbox's uids whose subject, sender, `To` or body contains `text`, ascending.
|
|
259
|
+
* One search per field and a union: `TEXT` alone is the body on Forward Email's server, and its
|
|
260
|
+
* `OR` answers a subset of what the operands do.
|
|
261
261
|
*/
|
|
262
262
|
readonly uidSearchText: (text: string) => Promise<ImapResult<readonly number[]>>;
|
|
263
263
|
/** RFC 6851. Answers with the RFC 4315 `COPYUID`, or null when the server gave none. Refuses without MOVE. */
|
package/dist/index.mjs
CHANGED
|
@@ -1083,7 +1083,7 @@ const parseResponse = (tokens) => {
|
|
|
1083
1083
|
};
|
|
1084
1084
|
//#endregion
|
|
1085
1085
|
//#region src/tokenizer.ts
|
|
1086
|
-
const DEFAULT_MAX_LITERAL_BYTES =
|
|
1086
|
+
const DEFAULT_MAX_LITERAL_BYTES = 67108864;
|
|
1087
1087
|
const MAX_UINT32 = 4294967295;
|
|
1088
1088
|
const checkBareLf = (bytes, start, end) => {
|
|
1089
1089
|
for (let i = start; i < end; i++) if (bytes[i] === 10 && (i === 0 || bytes[i - 1] !== 13)) return {
|
|
@@ -1484,7 +1484,7 @@ const summariesFrom = (untagged) => untagged.flatMap((item) => {
|
|
|
1484
1484
|
}];
|
|
1485
1485
|
});
|
|
1486
1486
|
const createImapClient = (transport, options) => {
|
|
1487
|
-
const maxLiteralBytes = options?.maxLiteralBytes ??
|
|
1487
|
+
const maxLiteralBytes = options?.maxLiteralBytes ?? 67108864;
|
|
1488
1488
|
const onUntagged = options?.onUntagged;
|
|
1489
1489
|
let chunks = [];
|
|
1490
1490
|
let totalBufferedBytes = 0;
|
|
@@ -2047,6 +2047,7 @@ const createImapClient = (transport, options) => {
|
|
|
2047
2047
|
for (const key of [
|
|
2048
2048
|
"SUBJECT",
|
|
2049
2049
|
"FROM",
|
|
2050
|
+
"TO",
|
|
2050
2051
|
"TEXT"
|
|
2051
2052
|
]) {
|
|
2052
2053
|
const res = await executeCommand((tag) => buildUidSearchTextCommand(tag, key, text));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yozz.app/imap",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "Transport-agnostic IMAP4rev2/rev1 client core: literals, total parsing, RFC 2047, SASL PLAIN/LOGIN, IDLE, UID MOVE, APPEND with APPENDUID, UID EXPUNGE.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/fishballapp/yozz",
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@types/node": "^24.13.4",
|
|
33
|
-
"@yozz.app/smtp": "0.1.
|
|
34
|
-
"@yozz.app/tls": "0.1.
|
|
35
|
-
"@yozz.app/x509": "0.1.
|
|
33
|
+
"@yozz.app/smtp": "0.1.6",
|
|
34
|
+
"@yozz.app/tls": "0.1.6",
|
|
35
|
+
"@yozz.app/x509": "0.1.6",
|
|
36
36
|
"tsdown": "^0.23.0"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|