mail_move_messages
Move specific email messages by UID from one folder to another existing folder. Use to file or refile particular messages found in iCloud Mail.
Instructions
Move specific messages, by uid, from one folder to another folder that already exists.
Use when: the owner asks to file or refile particular messages you have found. Not for trashing (use mail_delete_messages), for moving everything that matches a filter (use mail_run_bulk_action, which previews and can be undone), or for flags (use mail_mark_messages). Parameters: uids and uidvalidity must come from the same mail_search_messages (or mail_get_messages) result for that folder; destination is an exact name from mail_list_folders or an alias (Archive, Junk, Trash, Sent, Drafts, INBOX). The destination is never created for you: create it first with mail_create_folder. Behavior: iCloud has no IMAP MOVE, so each message is copied, flagged deleted and expunged by its own uid only; nothing else in the folder is touched. A renumbered folder (uidvalidity changed) is refused before anything moves. A long list goes in chunks; if one fails, the error says how many already moved. Messages get new uids in the destination. Returns: {moved, from, to} with the uids moved and the resolved folder names. Errors: 'Could not open the folder' for an unknown source or destination (call mail_list_folders); a changed uidvalidity (search again for fresh uids); a partial move names how many already moved, so search before retrying.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uids | Yes | Message uids in that folder (from mail_search_messages). | |
| folder | Yes | Mail folder, e.g. INBOX, Sent, Archive or a custom name. | |
| destination | Yes | Destination folder: Archive, Junk, Trash or a custom folder name. | |
| uidvalidity | Yes | The 'uidvalidity' from the result the uids came from (required: a renumbered folder is refused, not misread). |