Mark emails as junk
mark_junkMove messages into the junk folder, which is what "report spam" does in a mail client. The move is not just filing: mail servers learn from their own junk folder, so this is also what teaches the filter to catch the next one - on Microsoft 365, on Gmail, and on any IMAP host running spam training. The junk folder is resolved by the ROLE the server gives it rather than by name, because it is called "Junk Email" on Microsoft 365, "[Gmail]/Spam" on Gmail and "Junk" on most IMAP hosts. IF THIS MAILBOX HAS NO JUNK FOLDER, ONE IS CREATED, and subscribed so it shows up in Outlook and Roundcube; the reply says so. REFUSES messages that are already in the junk folder. All the messages must be in the SAME source folder. Flags and the original dates are preserved. Use not_junk to reverse this. Pass every UID in one call rather than calling it once per message.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uids | Yes | The UIDs to act on, from list_emails or search_emails. Pass EVERY message you want changed in ONE call - this tool acts on the whole set in a single operation, and doing it that way costs the user one call instead of one per message. Up to 500 at a time. A single message is simply a one-element array. | |
| mailbox | No | The folder the messages are in now. Defaults to INBOX. |