sync_emails
Refresh your local email index by incrementally syncing metadata from IMAP. Use full sync to remove archived, trashed, or moved messages that would otherwise remain stale.
Instructions
Incrementally sync email metadata from IMAP into the local SQLite index, using stored checkpoints to avoid re-fetching already-indexed messages. Use before calling search_indexed_emails or get_threads when the index may be stale. The default incremental sync only ever adds/updates recent messages — it never notices a message that was archived, trashed, or moved out of the synced folder by any client, so search/thread/digest tools can keep showing a message as still present indefinitely. Set full:true (per folder — sync each folder you want cleaned up) to also detect and prune those, in addition to fetching a larger sample. Prefer run_background_sync to trigger the scheduled sync cycle (also incremental-only by default; see PROTONMAIL_AUTO_SYNC_FULL).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| full | No | Fetch a larger per-folder sample, and detect/prune messages no longer present in this folder (moved, archived, trashed, or deleted by any client) that the default incremental sync would otherwise leave stale in the index forever. | |
| folder | No | Folder to sync. Defaults to all folders. | |
| limitPerFolder | No | Override the per-folder fetch limit. | |
| includeAttachmentText | No | Extract searchable text from text-like attachments while syncing. |