mail_delete_messages
Move specific iCloud Mail messages to Trash by UID, keeping them recoverable; permanently delete from Trash only when permanent deletion is enabled.
Instructions
Move specific messages, by uid, to Trash, where they stay recoverable; deleting permanently from Trash only works if the operator allowed it.
Use when: the owner asks to delete particular messages you found. Not for all messages matching a filter (use mail_run_bulk_action with action trash, which previews and can be undone), for filing elsewhere or into Junk (use mail_move_messages), 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 folder. folder is an exact name from mail_list_folders or an alias (INBOX, Sent, Drafts, Trash, Junk, Archive). Behavior:
Confirm with the owner first.
From any folder but Trash, each message is copied to Trash and removed from its folder by its own uid; nothing else is touched, and it can be restored with mail_move_messages.
When folder is Trash, the messages are deleted for good only if ALLOW_PERMANENT_DELETE is on (off by default); otherwise the call is refused and nothing changes.
A renumbered folder is refused before anything moves. Returns: {moved_to_trash, from, trash}, or {permanently_deleted, folder}, each listing the uids. Errors: 'Messages in Trash are not permanently deleted' (they are already in Trash; leave them), out-of-date uids (search again), or a partial stop saying how many already moved.
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. | |
| uidvalidity | Yes | The 'uidvalidity' from the result the uids came from (required: a renumbered folder is refused, not misread). |