Skip to content

CLI reference: mail

Read and manage Thunderbird mail. Reads work on any plan; sends/edits are ordinary commands (no separate opt-in on the CLI). Part of the CLI reference.

CommandWhat it does
mail foldersList indexed folders with message counts
mail search [query]Full-text search (subject + body) with --from --to --subject --folder --account --since --until --limit --snippet
mail listRecent messages in a folder (--folder INBOX --limit 20)
mail show <id>One message body by gloda id or Message-ID (--text --html --raw --include-headers)
mail fetchTrigger Thunderbird’s Get Messages (new-mail check) now — all accounts, or one via --account-key
mail thread <id>The full conversation for a message
mail sendCompose + send (--to --subject --text/--html, or --draft / --template / --later)
mail draftAlias for mail send --draft
mail edit-draft <id>Edit an existing draft — only the fields you pass change (--subject --to --cc --bcc --text/--html, or --text-file/--html-file)
mail reply <id> / mail reply-all <id>Reply to the sender / all recipients
mail forward <id>Forward a message (--to)
mail move <id> --to <folder>Move a message — or many via --ids a,b / a selector (--query --folder --account, --max)
mail mark <id>Update flags (--read --unread --star --unstar --tags); bulk via --ids / selector
mail delete <id>Trash a message (--hard to skip); bulk via --ids / selector
mail attachments <id>List a message’s attachments (index, filename, type, size)
mail attachment-save <id>Save attachments to disk (--index <n> or --all, --out <dir>)
mail folder-create --account --nameCreate a folder (nested Parent/Child supported)
mail folder-rename --account --path --nameRename a folder
mail folder-delete --account --pathDelete a folder (special-use folders protected)
mail empty-trash --accountPermanently delete everything in an account’s Trash
Terminal window
# Find the newest message from a sender, gist included, no follow-up fetch
atbridge mail search --from "newsletter@example.com" --limit 1 --snippet --pretty

Was this page helpful?