sync
syncRefresh a connection's local mail copy to include new messages, removals, moves, and read/flag states without altering the remote mailbox. Use when local mail is outdated or the user needs newer mail.
Instructions
Refresh one connection's local mail copy from the mail server, including new messages, removals, moves and read/flag states. The remote mailbox is not changed. Call when the user needs newer mail than the local copy. Runs in the background; the first sync can take a long time.
status=started means launched, not finished. For started or alreadyRunning, check syncStatus with the same connection while state is running; do not call sync again to check progress. lockedByOtherProcess means another process holds the local write lock and this call started no sync. That process may be an offline command; syncStatus reports sync runs only.
For refused, relay message to the user and do not retry: after a rejected sign-in, the user must fix the credentials and run mail-sync in a terminal.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| connection | Yes | Connection name from listConnections |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| status | Yes | started (launched, not completed); alreadyRunning (a sync is already running in this process); lockedByOtherProcess (another process holds the local write lock, possibly for an offline command; this call started no sync); refused (see message). Use syncStatus for started/alreadyRunning; it reports sync runs, not offline command progress. | |
| message | Yes | Explanation; relay it to the user when status is refused. | |
| connection | Yes | Connection name. |