You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
archiveFolder: 'Archive'//Note: This must match the server's localized folder name
223
+
archiveFolder: '\\Trash'//Resolves to the server's actual Trash path at runtime
224
224
});
225
225
226
226
// Apply custom IMAP flags
@@ -244,6 +244,26 @@ await client.clean({
244
244
awaitclient.clean();
245
245
```
246
246
247
+
#### Folder Resolution
248
+
249
+
Any `folder` or `archiveFolder` option accepts either a **literal path** (e.g. `'[Gmail]/Trash'`) or a **`specialUse` role** prefixed with `\`. The client resolves roles to the correct server path at runtime using IMAP LIST metadata, so your code works regardless of the mail server's language or naming conventions.
250
+
251
+
| Role | Description |
252
+
|---|---|
253
+
|`\All`| All Mail |
254
+
|`\Trash`| Trash / Deleted Items |
255
+
|`\Sent`| Sent Mail |
256
+
|`\Drafts`| Drafts |
257
+
|`\Junk`| Spam |
258
+
|`\Flagged`| Starred / Flagged |
259
+
|`\Inbox`| Inbox |
260
+
261
+
```ts
262
+
// These are equivalent on a Turkish Gmail account:
thrownewError(`Found ${accumulatedMatches.length}/${expectedCount} emails within ${waitTimeout}ms. Searched in "${folder}" for: ${this.formatFilterSummary(filters)}`);
307
+
thrownewError(`Found ${accumulatedMatches.length}/${expectedCount} emails within ${waitTimeout}ms. Searched in "${resolvedFolder}" for: ${this.formatFilterSummary(filters)}`);
/** Filters to identify which emails should be marked. If omitted, applies to all emails in the folder. */
162
162
filters?: EmailFilter[];
163
-
/** The target mailbox folder to perform the action in. Defaults to 'INBOX'. */
163
+
/** The target mailbox folder. Accepts a literal path or a specialUse role (e.g. '\\Trash', '\\Sent'). Defaults to 'INBOX'. */
164
164
folder?: string;
165
-
/** The destination folder used when the `ARCHIVED` action is triggered. Defaults to 'Archive'. */
165
+
/** The destination folder for the `ARCHIVED` action. Accepts a literal path or a specialUse role (e.g. '\\Flagged', '\\All'). Defaults to 'Archive'. */
0 commit comments