mail_undo
Undo a recoverable Mail move by receipt ID: preview which messages will be restored, then confirm to move each back to its original mailbox.
Instructions
Undo one recoverable Mail operation by its receipt id (from move_mail's
result, or from audit). A move is undone by moving the messages back to the exact
mailbox each came from — recorded per message before the original ran.
dry_run DEFAULTS TO TRUE: preview which messages would be restored, then pass
dry_run=False. The undo is itself backed up, logged and verified, and returns its
own receipt — so an undo can be undone. A receipt for an operation with no
destination mailbox cannot be replayed; the error names the directory holding the
preserved message bytes for manual re-import.
Undoing a batch moved into a mailbox that already held pre-existing copies of the
same Message-ID moves those copies back too — the by-ID act moves every copy of a
Message-ID, and undo is an ordinary move. A receipt whose targets recorded
unknown (a timeout mid-act) is replayed the same as ok.
A move into a Gmail label folder or a unified mailbox name cannot be replayed; the
error names the source folder and how to restore by hand.
Destructive (it moves mail); needs Automation access for Mail and Full Disk Access.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dry_run | No | ||
| receipt | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||