@miguelarios/email-mcp 0.13.0 → 0.15.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/CHANGELOG.md +69 -0
- package/README.md +98 -4
- package/dist/htmlToMarkdown.d.ts +8 -0
- package/dist/htmlToMarkdown.d.ts.map +1 -1
- package/dist/htmlToMarkdown.js +130 -56
- package/dist/htmlToMarkdown.js.map +1 -1
- package/dist/imapSort.d.ts +17 -0
- package/dist/imapSort.d.ts.map +1 -0
- package/dist/imapSort.js +112 -0
- package/dist/imapSort.js.map +1 -0
- package/dist/main.js +2 -2
- package/dist/main.js.map +1 -1
- package/dist/search.d.ts.map +1 -1
- package/dist/search.js +42 -10
- package/dist/search.js.map +1 -1
- package/dist/services/ImapService.d.ts +86 -0
- package/dist/services/ImapService.d.ts.map +1 -1
- package/dist/services/ImapService.js +303 -28
- package/dist/services/ImapService.js.map +1 -1
- package/dist/services/SmtpService.d.ts +9 -0
- package/dist/services/SmtpService.d.ts.map +1 -1
- package/dist/services/SmtpService.js +13 -0
- package/dist/services/SmtpService.js.map +1 -1
- package/dist/tools/emailSchemas.d.ts +63 -0
- package/dist/tools/emailSchemas.d.ts.map +1 -1
- package/dist/tools/emailSchemas.js +38 -0
- package/dist/tools/emailSchemas.js.map +1 -1
- package/dist/tools/emailTools.d.ts.map +1 -1
- package/dist/tools/emailTools.js +614 -55
- package/dist/tools/emailTools.js.map +1 -1
- package/package.json +6 -2
package/dist/imapSort.js
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Native IMAP SORT (RFC 5256).
|
|
3
|
+
*
|
|
4
|
+
* A server that advertises SORT will order a result set itself, which is both
|
|
5
|
+
* faster and more correct than fetching envelopes to sort them here: the whole
|
|
6
|
+
* mailbox is ordered, not just the page, so pagination is exact rather than
|
|
7
|
+
* approximate on a large folder.
|
|
8
|
+
*
|
|
9
|
+
* imapflow has no SORT command — its public surface stops at `search()` — so
|
|
10
|
+
* this drives `exec` and the search compiler directly. Both are internal to
|
|
11
|
+
* imapflow, which is why every entry point here fails soft: a server that
|
|
12
|
+
* rejects the command, a client version that moved the compiler, or anything
|
|
13
|
+
* else unexpected returns `null` and leaves the caller on its existing
|
|
14
|
+
* client-side path.
|
|
15
|
+
*/
|
|
16
|
+
import { createRequire } from "node:module";
|
|
17
|
+
const require = createRequire(import.meta.url);
|
|
18
|
+
/** RFC 5256 §3 sort keys, for the fields `search_emails` exposes. */
|
|
19
|
+
const SORT_KEYS = {
|
|
20
|
+
date: "DATE",
|
|
21
|
+
from: "FROM",
|
|
22
|
+
subject: "SUBJECT",
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* RFC 5256 makes the charset mandatory on SORT, so one is always sent. UTF-8
|
|
26
|
+
* is the only charset imapflow's compiler ever asks for, and a server that
|
|
27
|
+
* accepts only US-ASCII answers BADCHARSET — which lands in the catch below
|
|
28
|
+
* and sends the caller back to client-side sorting rather than failing.
|
|
29
|
+
*/
|
|
30
|
+
const DEFAULT_CHARSET = "UTF-8";
|
|
31
|
+
/**
|
|
32
|
+
* The compiled search key, plus the charset it has to be issued under.
|
|
33
|
+
*
|
|
34
|
+
* imapflow's compiler prepends a `CHARSET UTF-8` pair whenever a criteria
|
|
35
|
+
* value contains non-ASCII and the connection has not enabled `UTF8=ACCEPT`,
|
|
36
|
+
* because that is how RFC 3501 SEARCH takes a charset. SORT does not: RFC 5256
|
|
37
|
+
* gives the charset its own slot between the sort keys and the search key, so
|
|
38
|
+
* leaving the pair in place would emit
|
|
39
|
+
* `UID SORT (REVERSE DATE) UTF-8 CHARSET UTF-8 SUBJECT "café"` — a syntax
|
|
40
|
+
* error the server answers BAD. The pair is lifted out and its value used for
|
|
41
|
+
* the slot instead, which is what makes an accented filter reach SORT at all.
|
|
42
|
+
*/
|
|
43
|
+
function compileSearchKey(client, criteria) {
|
|
44
|
+
const { searchCompiler: compile } = require("imapflow/lib/search-compiler.js");
|
|
45
|
+
const keys = criteria && typeof criteria === "object" ? Object.keys(criteria) : [];
|
|
46
|
+
// Mirrors imapflow's own search(): an empty query is "everything", which in
|
|
47
|
+
// IMAP is the ALL key rather than an empty criteria list.
|
|
48
|
+
if (keys.length === 0 || (keys.length === 1 && keys[0] === "all")) {
|
|
49
|
+
return { charset: DEFAULT_CHARSET, attributes: [{ type: "ATOM", value: "ALL" }] };
|
|
50
|
+
}
|
|
51
|
+
const attributes = compile(client, criteria);
|
|
52
|
+
if (attributes[0]?.type === "ATOM" &&
|
|
53
|
+
String(attributes[0].value).toUpperCase() === "CHARSET" &&
|
|
54
|
+
attributes[1] !== undefined) {
|
|
55
|
+
return { charset: String(attributes[1].value), attributes: attributes.slice(2) };
|
|
56
|
+
}
|
|
57
|
+
return { charset: DEFAULT_CHARSET, attributes };
|
|
58
|
+
}
|
|
59
|
+
/** True when the connected server advertises RFC 5256 SORT. */
|
|
60
|
+
export function supportsSort(client) {
|
|
61
|
+
try {
|
|
62
|
+
return client.capabilities?.has("SORT") === true;
|
|
63
|
+
}
|
|
64
|
+
catch {
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Issues `UID SORT` for one search criteria object, returning UIDs in the
|
|
70
|
+
* server's order, or `null` when the command could not be used.
|
|
71
|
+
*/
|
|
72
|
+
export async function uidSort(client, criteria, sortBy, sortOrder) {
|
|
73
|
+
if (!supportsSort(client))
|
|
74
|
+
return null;
|
|
75
|
+
const key = SORT_KEYS[sortBy];
|
|
76
|
+
if (!key)
|
|
77
|
+
return null;
|
|
78
|
+
// RFC 5256: REVERSE prefixes an individual key, it is not a global flag.
|
|
79
|
+
const sortKeys = sortOrder === "desc"
|
|
80
|
+
? [
|
|
81
|
+
{ type: "ATOM", value: "REVERSE" },
|
|
82
|
+
{ type: "ATOM", value: key },
|
|
83
|
+
]
|
|
84
|
+
: [{ type: "ATOM", value: key }];
|
|
85
|
+
try {
|
|
86
|
+
const { charset, attributes: searchAttributes } = compileSearchKey(client, criteria);
|
|
87
|
+
const uids = [];
|
|
88
|
+
const response = await client.exec("UID SORT", [sortKeys, { type: "ATOM", value: charset }, ...searchAttributes], {
|
|
89
|
+
untagged: {
|
|
90
|
+
SORT: async (untagged) => {
|
|
91
|
+
for (const attribute of untagged?.attributes ?? []) {
|
|
92
|
+
// Only digit strings. CONDSTORE can append a (MODSEQ n) group, and
|
|
93
|
+
// `Number("")` is 0, so neither a keyword nor an empty attribute
|
|
94
|
+
// may be allowed to become a UID.
|
|
95
|
+
const raw = attribute?.value;
|
|
96
|
+
if (typeof raw !== "string" || !/^\d+$/.test(raw))
|
|
97
|
+
continue;
|
|
98
|
+
uids.push(Number(raw));
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
});
|
|
103
|
+
// imapflow's own commands call this to release the response; skipping it
|
|
104
|
+
// would leave the connection waiting on a reader that never runs.
|
|
105
|
+
response?.next?.();
|
|
106
|
+
return uids;
|
|
107
|
+
}
|
|
108
|
+
catch {
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=imapSort.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"imapSort.js","sourceRoot":"","sources":["../src/imapSort.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAG5C,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE/C,qEAAqE;AACrE,MAAM,SAAS,GAAG;IAChB,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;CACV,CAAC;AAMX;;;;;GAKG;AACH,MAAM,eAAe,GAAG,OAAO,CAAC;AAEhC;;;;;;;;;;;GAWG;AACH,SAAS,gBAAgB,CACvB,MAAgB,EAChB,QAAiB;IAEj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C,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC;4BAAE,SAAS;wBAC5D,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;oBACzB,CAAC;gBACH,CAAC;aACF;SACF,CAAC,CAAC;QACH,yEAAyE;QACzE,kEAAkE;QAClE,QAAQ,EAAE,IAAI,EAAE,EAAE,CAAC;QACnB,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
|
package/dist/main.js
CHANGED
|
@@ -3,7 +3,7 @@ import { loadEmailConfig } from "@miguelarios/pim-core";
|
|
|
3
3
|
import { TOOL_LIST_CACHE_HINT, registerTools } from "@miguelarios/pim-core/mcp";
|
|
4
4
|
import { McpServer } from "@modelcontextprotocol/server";
|
|
5
5
|
import { serveStdio } from "@modelcontextprotocol/server/stdio";
|
|
6
|
-
import { disposeUrlCleaner } from "./htmlToMarkdown.js";
|
|
6
|
+
import { disposeUrlCleaner, disposeUrlProxy } from "./htmlToMarkdown.js";
|
|
7
7
|
import { registerImapResources } from "./resources/imapResources.js";
|
|
8
8
|
import { ImapService } from "./services/ImapService.js";
|
|
9
9
|
import { SmtpService } from "./services/SmtpService.js";
|
|
@@ -29,7 +29,7 @@ export async function createServer() {
|
|
|
29
29
|
registerTools(server, EMAIL_TOOLS, services);
|
|
30
30
|
registerImapResources(server, services.imap);
|
|
31
31
|
const handleShutdown = async () => {
|
|
32
|
-
await disposeUrlCleaner();
|
|
32
|
+
await Promise.all([disposeUrlCleaner(), disposeUrlProxy()]);
|
|
33
33
|
process.exit(0);
|
|
34
34
|
};
|
|
35
35
|
process.on("SIGINT", handleShutdown);
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,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":"search.d.ts","sourceRoot":"","sources":["../src/search.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../src/search.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB;AAwBD;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,YAAY,GACnB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAuFrD"}
|
package/dist/search.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ValidationError } from "@miguelarios/pim-core";
|
|
1
2
|
function parseTokens(value) {
|
|
2
3
|
const tokens = [];
|
|
3
4
|
const regex = /-?"([^"]+)"|(\S+)/g;
|
|
@@ -29,17 +30,19 @@ export function buildSearchCriteria(params) {
|
|
|
29
30
|
// Address fields → base criteria (no tokenization)
|
|
30
31
|
const addressFields = ["from", "to", "cc", "bcc"];
|
|
31
32
|
for (const field of addressFields) {
|
|
32
|
-
const value = params[field];
|
|
33
|
+
const value = filled(params[field]);
|
|
33
34
|
if (value === undefined)
|
|
34
35
|
continue;
|
|
35
36
|
baseCriteria[field] = value;
|
|
36
37
|
}
|
|
37
38
|
// Date filters → base criteria
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
const since = filled(params.since);
|
|
40
|
+
if (since !== undefined) {
|
|
41
|
+
baseCriteria.since = parseDate(since, "since");
|
|
40
42
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
+
const before = filled(params.before);
|
|
44
|
+
if (before !== undefined) {
|
|
45
|
+
baseCriteria.before = parseDate(before, "before");
|
|
43
46
|
}
|
|
44
47
|
// Boolean flags → base criteria
|
|
45
48
|
if (params.unread !== undefined) {
|
|
@@ -53,12 +56,13 @@ export function buildSearchCriteria(params) {
|
|
|
53
56
|
baseCriteria.header = { "content-type": "multipart/mixed" };
|
|
54
57
|
}
|
|
55
58
|
// Tags → base criteria for single tag, tokenized for multiple (key collision)
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
+
const tags = params.tags?.map((tag) => tag.trim()).filter((tag) => tag.length > 0);
|
|
60
|
+
if (tags !== undefined) {
|
|
61
|
+
if (tags.length === 1) {
|
|
62
|
+
baseCriteria.keyword = tags[0];
|
|
59
63
|
}
|
|
60
64
|
else {
|
|
61
|
-
for (const tag of
|
|
65
|
+
for (const tag of tags) {
|
|
62
66
|
tokenizedCriteria.push({ keyword: tag });
|
|
63
67
|
}
|
|
64
68
|
}
|
|
@@ -70,7 +74,7 @@ export function buildSearchCriteria(params) {
|
|
|
70
74
|
{ param: "hasWords", imapKey: "text" },
|
|
71
75
|
];
|
|
72
76
|
for (const { param, imapKey } of tokenizedFields) {
|
|
73
|
-
const value = params[param];
|
|
77
|
+
const value = filled(params[param]);
|
|
74
78
|
if (value === undefined)
|
|
75
79
|
continue;
|
|
76
80
|
const tokens = parseTokens(value);
|
|
@@ -102,4 +106,32 @@ export function buildSearchCriteria(params) {
|
|
|
102
106
|
// Both base and tokenized → fold base into each tokenized criterion
|
|
103
107
|
return tokenizedCriteria.map((tc) => ({ ...baseCriteria, ...tc }));
|
|
104
108
|
}
|
|
109
|
+
/**
|
|
110
|
+
* Narrows a string filter to a meaningful one, trimmed.
|
|
111
|
+
*
|
|
112
|
+
* A blank value is not a filter under any reading: nobody searches for the
|
|
113
|
+
* empty sender. Discarding it keeps the server correct for clients that
|
|
114
|
+
* materialize every optional property rather than omitting the ones the model
|
|
115
|
+
* left unset — see the #101 regression tests. Booleans are deliberately not
|
|
116
|
+
* normalized this way, because `false` is a legitimate query.
|
|
117
|
+
*/
|
|
118
|
+
function filled(value) {
|
|
119
|
+
if (value === undefined)
|
|
120
|
+
return undefined;
|
|
121
|
+
const trimmed = value.trim();
|
|
122
|
+
return trimmed.length > 0 ? trimmed : undefined;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Parses a date filter, rejecting one that cannot be read.
|
|
126
|
+
*
|
|
127
|
+
* `new Date("nonsense")` yields an Invalid Date, which serializes to `null` and
|
|
128
|
+
* makes IMAP match nothing — a silent empty result rather than a usable error.
|
|
129
|
+
*/
|
|
130
|
+
function parseDate(value, field) {
|
|
131
|
+
const parsed = new Date(value);
|
|
132
|
+
if (Number.isNaN(parsed.getTime())) {
|
|
133
|
+
throw new ValidationError(`${field} is not a valid date: ${JSON.stringify(value)}. Use YYYY-MM-DD.`, field);
|
|
134
|
+
}
|
|
135
|
+
return parsed;
|
|
136
|
+
}
|
|
105
137
|
//# sourceMappingURL=search.js.map
|
package/dist/search.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.js","sourceRoot":"","sources":["../src/search.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"search.js","sourceRoot":"","sources":["../src/search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAuBxD,SAAS,WAAW,CAAC,KAAa;IAChC,MAAM,MAAM,GAAkB,EAAE,CAAC;IACjC,MAAM,KAAK,GAAG,oBAAoB,CAAC;IACnC,IAAI,KAAK,GAA2B,KAAK,CAAC,IAAI,CAAC,KA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;IACtB,CAAC;IAED,iDAAiD;IACjD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,IAAI,iBAAiB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACnC,OAAO,iBAAiB,CAAC,CAAC,CAAC,CAAC;QAC9B,CAAC;QACD,OAAO,iBAAiB,CAAC;IAC3B,CAAC;IAED,oEAAoE;IACpE,OAAO,iBAAiB,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,YAAY,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC;AACrE,CAAC;AAED;;;;;;;;GAQG;AACH,SAAS,MAAM,CAAC,KAAyB;IACvC,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC1C,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC7B,OAAO,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;AAClD,CAAC;AAED;;;;;GAKG;AACH,SAAS,SAAS,CAAC,KAAa,EAAE,KAAyB;IACzD,MAAM,MAAM,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;IAC/B,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC;QACnC,MAAM,IAAI,eAAe,CACvB,GAAG,KAAK,yBAAyB,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,mBAAmB,EACzE,KAAK,CACN,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -21,6 +21,20 @@ export interface EmailFull extends EmailSummary {
|
|
|
21
21
|
name?: string;
|
|
22
22
|
address: string;
|
|
23
23
|
}>;
|
|
24
|
+
/** Present only when the message carries a Reply-To header. */
|
|
25
|
+
replyTo?: Array<{
|
|
26
|
+
name?: string;
|
|
27
|
+
address: string;
|
|
28
|
+
}>;
|
|
29
|
+
/**
|
|
30
|
+
* Present only when the message carries a Bcc header — in practice only for
|
|
31
|
+
* a message this account sent, read back out of Sent or Drafts. A received
|
|
32
|
+
* message never names its blind recipients.
|
|
33
|
+
*/
|
|
34
|
+
bcc?: Array<{
|
|
35
|
+
name?: string;
|
|
36
|
+
address: string;
|
|
37
|
+
}>;
|
|
24
38
|
inReplyTo: string | null;
|
|
25
39
|
references: string[];
|
|
26
40
|
textBody?: string;
|
|
@@ -48,6 +62,20 @@ export interface CalendarPart {
|
|
|
48
62
|
/** True when `content` was withheld — fetch via `download_attachment`. */
|
|
49
63
|
truncated?: boolean;
|
|
50
64
|
}
|
|
65
|
+
/** One message in a thread, tagged with the folder it was found in. */
|
|
66
|
+
export interface ThreadMessage extends EmailSummary {
|
|
67
|
+
folder: string;
|
|
68
|
+
}
|
|
69
|
+
export interface ThreadResult {
|
|
70
|
+
/**
|
|
71
|
+
* The Message-ID the conversation hangs off: the first entry of the anchor's
|
|
72
|
+
* References chain, or the anchor's own id when it starts the thread. Null
|
|
73
|
+
* when the anchor carries neither.
|
|
74
|
+
*/
|
|
75
|
+
rootMessageId: string | null;
|
|
76
|
+
/** Oldest first — reading order for a conversation. */
|
|
77
|
+
messages: ThreadMessage[];
|
|
78
|
+
}
|
|
51
79
|
export interface FolderInfo {
|
|
52
80
|
path: string;
|
|
53
81
|
specialUse?: string;
|
|
@@ -101,14 +129,72 @@ export declare class ImapService {
|
|
|
101
129
|
private createClient;
|
|
102
130
|
listFolders(): Promise<FolderInfo[]>;
|
|
103
131
|
searchEmails(folder: string, params?: SearchParams, options?: SearchOptions): Promise<EmailSummary[]>;
|
|
132
|
+
/**
|
|
133
|
+
* The result set in the server's own order, or null when SORT is not
|
|
134
|
+
* available.
|
|
135
|
+
*
|
|
136
|
+
* A criteria array means the search had duplicate keys (several subject
|
|
137
|
+
* tokens, say) that IMAP cannot express in one command, so each is sorted
|
|
138
|
+
* separately and intersected. The first result's order is kept: every list
|
|
139
|
+
* is ordered the same way, so filtering one by membership in the others
|
|
140
|
+
* preserves it.
|
|
141
|
+
*/
|
|
142
|
+
private sortedUids;
|
|
104
143
|
private fetchSummaries;
|
|
144
|
+
/** Builds an {@link EmailSummary} from one FETCH response. */
|
|
145
|
+
private toSummary;
|
|
146
|
+
/**
|
|
147
|
+
* Assembles the conversation an anchor message belongs to.
|
|
148
|
+
*
|
|
149
|
+
* Two mechanisms, in order of preference. A server advertising OBJECTID or
|
|
150
|
+
* X-GM-EXT-1 assigns every message a thread id and will answer a SEARCH on
|
|
151
|
+
* it with the whole conversation — that is authoritative, and it catches
|
|
152
|
+
* replies whose References chain was mangled in transit. Otherwise the
|
|
153
|
+
* chain is walked: RFC 5322 §3.6.4 has every reply carry the root's
|
|
154
|
+
* Message-ID in its References, so one SEARCH for messages that either *are*
|
|
155
|
+
* the root or *cite* it returns the thread.
|
|
156
|
+
*
|
|
157
|
+
* RFC 5256's THREAD command would be the third option, but imapflow exposes
|
|
158
|
+
* no way to issue it.
|
|
159
|
+
*/
|
|
160
|
+
fetchThread(anchorFolder: string, uid: number, folders: string[]): Promise<ThreadResult>;
|
|
105
161
|
fetchEmail(folder: string, uid: number): Promise<EmailFull>;
|
|
106
162
|
fetchRawEmail(folder: string, uid: number): Promise<string>;
|
|
107
163
|
fetchRawEmail(folder: string, uid: number, maxBytes: number): Promise<RawEmailResult>;
|
|
164
|
+
/**
|
|
165
|
+
* Copies messages, leaving the originals in place.
|
|
166
|
+
*
|
|
167
|
+
* imapflow's `messageCopy` does not throw on a server refusal: its command
|
|
168
|
+
* catches the error, logs a warning, and resolves `false` (and resolves
|
|
169
|
+
* `undefined` when its own preconditions fail). So a missing destination —
|
|
170
|
+
* `NO [TRYCREATE]`, the most likely failure here — would otherwise be
|
|
171
|
+
* indistinguishable from a successful copy on a server without UIDPLUS.
|
|
172
|
+
* Both falsy results are turned back into a thrown error.
|
|
173
|
+
*
|
|
174
|
+
* The UID pairs come from the server's UIDPLUS `COPYUID` response. Without
|
|
175
|
+
* that extension there is no way to learn the new UIDs short of re-searching
|
|
176
|
+
* the destination, so the mapping is absent rather than guessed — the copy
|
|
177
|
+
* did happen.
|
|
178
|
+
*/
|
|
179
|
+
copyEmails(folder: string, uids: number[], destination: string): Promise<Array<{
|
|
180
|
+
uid: number;
|
|
181
|
+
destinationUid: number;
|
|
182
|
+
}> | undefined>;
|
|
108
183
|
moveEmails(folder: string, uids: number[], destination: string): Promise<void>;
|
|
109
184
|
markEmails(folder: string, uids: number[], flags: string[], action: "add" | "remove"): Promise<void>;
|
|
110
185
|
deleteEmails(folder: string, uids: number[], permanent?: boolean): Promise<void>;
|
|
111
186
|
createFolder(path: string): Promise<void>;
|
|
187
|
+
/**
|
|
188
|
+
* Renames a mailbox, returning the paths the server reports rather than the
|
|
189
|
+
* ones requested — a server is free to normalise the delimiter or to prefix
|
|
190
|
+
* the personal namespace, and the RENAME response is the authority on where
|
|
191
|
+
* the folder ended up.
|
|
192
|
+
*/
|
|
193
|
+
renameFolder(path: string, newPath: string): Promise<{
|
|
194
|
+
path: string;
|
|
195
|
+
newPath: string;
|
|
196
|
+
}>;
|
|
197
|
+
deleteFolder(path: string): Promise<void>;
|
|
112
198
|
downloadAttachment(folder: string, uid: number, partId: string): Promise<AttachmentBytes>;
|
|
113
199
|
downloadAttachment(folder: string, uid: number, partId: string, maxBytes: number): Promise<AttachmentDownload>;
|
|
114
200
|
private static FALLBACK_NAMES;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImapService.d.ts","sourceRoot":"","sources":["../../src/services/ImapService.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,WAAW,EAMjB,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"ImapService.d.ts","sourceRoot":"","sources":["../../src/services/ImapService.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,WAAW,EAMjB,MAAM,uBAAuB,CAAC;AAI/B,OAAO,EAAE,KAAK,YAAY,EAAuB,MAAM,cAAc,CAAC;AAE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