Repository navigation
jmapcli 1.8.1
This release carries both builds. macOS: Homebrew, or jmapcli-1.8.1.tar.gz below; it reports 1.8.1 (core 242258b3). Linux (x86_64 and aarch64): jmapcli-1.8.1-linux-<arch>.tar.gz below (check it against SHA256SUMS, unpack it, and follow README-linux.md inside), or the signed apt and dnf repositories at pkg.boogie.digital; it reports 1.8.1 (core 5ab03684). The program source is the same in both; the Linux build was made from a later commit that corrects the README packed with it.
Added
-
MCP: ten read tools.
jmapcli mcpgains ten tools that read, beside the six mail tools: nine that read what the CLI already reads, andvacation.get. Each takes the optionalaccountargument like the mail tools. A bad or missing argument is a JSON-RPC-32602. So is an argument name the tool does not have: a misspeltacountis refused and named, not ignored, and the input schemas sayadditionalProperties: false. A server without the capability, an unknown id or name, anaccountthat names no configured account, or a server failure is a tool result withisErrorand a readable message.mailboxes.list— id, name, role, parentId, totalEmails and unreadEmails, in the orderjmapcli mailboxesprints.identities.list— the sending identities stored on the server for the selected account: id, name, email, and replyTo when the identity sets one. It sendsIdentity/getand nothing else, so unlikejmapcli identity listit never creates an identity. When the session does not nameurn:ietf:params:jmap:submission, the result is anisErrorthat names it and noIdentity/getis sent.contacts.search(query,limit) — every word of the query must be found, ignoring case, in a contact's name, a nickname, an email address, a phone number or an organisation. Returns id, name, emails, phones, organization and isGroup for at mostlimitcontacts (default 20).contacts.get(contact_id) — the fuller card: nicknames, organizations, titles, every email and phone with its contexts, postal addresses, notes, birthday, address-book ids and a group's members. Photos are not returned. It looks in every address book of the login, ascontacts.searchdoes, and says "not found" only when every one of them was read: if no book has the card and one could not be read, the result is that failure.calendar.list— id, name, color and isVisible, in the orderjmapcli calendar listprints.calendar.events(after,before,calendar) — the events in a window, under the rules ofjmapcli calendar events:afterandbeforeare local date-times with no zone suffix (yyyy-MM-ddfor midnight, oryyyy-MM-ddTHH:mm:ss), read in the machine's time zone; at most 200 events; recurrences are not expanded.calendarlimits the list to one calendar by name or id. The result repeats the window and names the zone used. ItslimitReachedis true when the server returned the full 200: the list may then be cut short, so narrow the window.sieve.list— id, name and isActive.sieve.get(name: a script's name or id) — the same, plus the script text.sieve.validate(script: the text to check) —valid, anderrorwith the server's message when the script is not valid.vacation.get— isEnabled, fromDate, toDate, subject, textBody and htmlBody.
None of the ten changes a mailbox, an identity, a contact, a calendar, a script or the vacation reply. One does more than read:
sieve.validateuploads the text to the server as a blob for the check (it is not stored as a script). The server now reports version1.3ininitialize. -
MCP: six tools that write,
mail.sendbehind a switch, and activating a mail filter or replacing a stored script behind another.jmapcli mcpnow lists twenty-two tools: the six mail tools, the ten read tools and the six below. Each runs the code of the command it mirrors.mail.draft(to,cc,bcc,reply_to,subject,body,html,plain,from) creates a draft in Drafts, asjmapcli draftdoes. Every argument is optional.mail.reply_draft(message_id,body, and optionallyto,cc,bcc,reply_to,subject,reply_all,plain,from) creates a threaded reply that quotes the original, asjmapcli reply --draftdoes.mail.forward_draft(message_id,to, and optionallybody,cc,bcc,reply_to,subject,plain,from) creates a forward with the original's text and attachments, asjmapcli forward --draftdoes.- None of these three sends anything: each puts one message in Drafts and no
EmailSubmission/setis issued, with or without--allow-send. Their result isdraftId,sent(false),from,to,cc,bcc,subjectandattachments. mail.trash(message_ids) moves messages to the Trash mailbox, asjmapcli trashdoes: each leaves every other mailbox it is in. An account with no mailbox of the trash role is anisErrorand nothing moves.calendar.create_event(calendar,title,start, and optionallyendorduration,all_day,location,description,timezone) creates one event, asjmapcli calendar event adddoes. With neitherendnordurationthe event lasts one hour, or one day withall_day. Withouttimezoneit is in the current time zone of the machine that runs the server, which need not be the user's; the tool's description says so, and the result'stimeZonenames the zone used. Unlike the command, the tool checks the times first:startandendmust beyyyy-MM-ddTHH:mm:sswith no zone suffix (yyyy-MM-ddis enough forstartwithall_day),endmust be later thanstart, andendcannot be combined withdurationorall_day.sieve.push(name,script,activate) stores a Sieve script under a name through the same function asjmapcli sieve push. It asks the server to make the script the active filter only whenactivateis true; the default is false, as the command's is without--activate. Two things need the server to be started asjmapcli mcp --allow-sieve-activate:activatetrue, and replacing a script that is already stored. Without the switch the tool is still listed with the same arguments, and withactivatefalse or omitted it still stores a script under a name that no stored script has. A call withactivatetrue and otherwise valid arguments is anisErrorthat names the switch; no account is opened and nothing is uploaded or stored. A call with anamethat a stored script already has, active or not, is anisErrorthat names the switch too; the account's list of scripts is read, and nothing is uploaded or stored. Upper and lower case count as different in a name, as they do when the command chooses the script to replace. A script stored without the switch is not made active by the tool; a person can still make it active later. The tool's description intools/listsays which of the two the server does: replace and activate, or refuse both. The switch is separate from--allow-send: neither turns the other on. With the switch, the server writes a line to standard error when it starts saying thatsieve.pushwithactivatetrue is on, and that replacing a stored script is on too. The commandjmapcli sieve pushneeds no switch, with or without--activate. With the switch the tool replaces a stored script of the same name, as the command does, but it refuses anamethat is the active script's name unlessactivateis true, because replacing that script changes the filter that is running: the result is anisErrorthat says so, and nothing is uploaded or stored. With or without the switch, every call that reaches the account reads the account's scripts once, before anything is uploaded, withactivatetrue as well as without; when the scripts cannot be read the call is refused, and nothing is uploaded or stored. The check and the store go by that one reading: the tool does not read the scripts a second time to choose between a new script and a replacement, and theSieveScript/setit sends carries the state of that reading (ifInState) when the server gave one. When a server that honoursifInStatefinds that the account's scripts changed after the reading, it refuses the store, and the result is anisErrorthat says the scripts changed while the script was being stored, that nothing was stored, and to callsieve.listand try again. So a script that another client stores, renames or makes active between the tool's check and its store is not replaced or changed on such a server. On a server that ignoresifInState, or that gave no state with the reading, the store is sent as it was chosen from the reading, and what another client did in between is not seen: a stored script that the call was to replace is then still replaced when another client has made it the active one in between. Stalwart honoursifInStateonSieveScript/set, by one run on a Stalwart test account (23 Nov 2026): with nothing changed in between the script was stored, and when a second jmapcli replaced another script between the reading and the store, the store was refused and the stored script kept its text. The commandjmapcli sieve pushmakes no check first and sends noifInState. If the script was stored but the scripts cannot be read back afterwards, the result has noactiveScriptand awarningthat says so. Needs JMAPClient withgetSieveScriptsWithStateand thereadingargument ofsetSieveScript.mail.send(to,subject,body, and optionallycc,bcc,reply_to,html,plain,from) sends a message, asjmapcli senddoes. It exists only when the server is started asjmapcli mcp --allow-send. Without the switch it is not intools/list, and a call to it is anisErrorthat names the switch, sends nothing and opens no account. With the switch the server lists twenty-three tools, and when it starts it writes a line to standard error saying thatmail.sendis on.
In the composing tools, recipients are one comma-separated string per argument, each entry an address,
Name <address>, or the name of an alias or contact, as on the command line. The text is read as Markdown and an HTML part is rendered from it unlessplainis true.mail.draftandmail.sendalso takehtml, an HTML part that is used as given instead;htmltogether withplaintrue is refused with-32602before any account is opened.frommust be one of the selected account's sending identities, asidentities.listreports them; without it the account's first identity is used. No other account is searched, and the identities are read withIdentity/getonly. An identity the server returns in a form that cannot be read (one with no address, for example) is skipped by these tools and byidentities.list, as the commands skip it. Afromthe account does not have is anisErrorthat lists what the account can send as. A server that does not nameurn:ietf:params:jmap:submissionis anisErrorfor all four. These tools take no attachment path and no HTML file path, so they read no file the caller names; a recipient given as a name is still looked up in the local aliases file, as on the command line.vacation.setis not part of this release. -
jmapcli vacation: the server-side vacation auto-reply.jmapcli vacationshows the current state (--jsonfor the six VacationResponse properties).jmapcli vacation onturns it on, with--fromand--to,--subject,--textor--text-file, and--htmlor--html-file.jmapcli vacation offturns it off and leaves the dates and message on the server. Whenonoroffhas made its change, the first line it prints carries the user name the server reports for the account, so it is clear whose reply was changed.onsets the dates exactly as given: with no--fromand no--tothe reply runs until you turn it off, so an old end date cannot silence it, and a line says so when that removed stored dates. A--tothat has already passed is refused. A date such as2026-12-28means that whole day in this computer's time zone; a date and time (2026-12-20T09:00) or a full instant (2026-12-20T09:00:00Z) also work. Where the zone database is missing (Linux withouttzdata), dates are read and shown in GMT. The subject is kept from last time unless given. The message is kept when no body is given. A text body given alone replaces the whole message and clears a stored HTML body, an HTML body given alone clears a stored text body, and a line says so when something stored was cleared. An empty value ("") clears only the field it names. It needs a server that advertisesurn:ietf:params:jmap:vacationresponse(Stalwart does); any other server gets one line saying so. Needs JMAPClient withreplaceVacationResponse. -
vacation onandvacation offlook after the mail filter. Where the server offers Sieve, both commands read the Sieve script list before and after they change the reply, and go by what the server did. When a script that was active beforevacation onis no longer active after it, a line names that script as suspended, and jmapcli notes its id and name on this computer, per account (invacation-filter/in the jmapcli config folder; the note holds the server's API address, the account id and the script's id and name, nothing else). A suspended script without a name gets a warning instead, because jmapcli can only switch a named script back on.vacation offswitches a script on only from that note. When no script is active aftervacation off, the noted script, if it is still on the server, is sent back with its own text unchanged, under the same name, with activate (the callsieve push --activatemakes); once the server reports it active, a line names it as switched back on. When the note says no script was active beforevacation on, nothing is switched on. Without a note on this computer nothing is switched on either: when no script is active and the account has Sieve scripts, a warning says that jmapcli has no note and has switched nothing on, lists the scripts by name (marking one that was active until the command turned the reply off) and gives the commands that switch one on, and the exit status is 0. The commands arejmapcli sieve activate <name>and, for when that is refused,jmapcli sieve get <name> > filter.sievefollowed byjmapcli sieve push filter.sieve --name <name> --activate. The second way is given for a server that refuses the requestsieve activatesends; a Stalwart test account accepted that request (23 Nov 2026). When the noted script cannot be switched back on, the reply stays off, aWarning:line on standard error says why, andvacation offends with exit status 1: the script is no longer on the server, it has no name, its text could not be read or sent back, the server does not report it active afterwards, or the script list could not be read. The note is kept, so that a secondvacation offtries again, unless the script is gone or has no name. When a script other than the noted one is active aftervacation offand was already the active one before it, nothing is switched on, the note is kept and a warning says the noted script is not active; the exit status is 0. The note carries no date:vacation offgoes by it for as long as it exists. Avacation onthat finds the reply off and cannot read the script list removes an older note. A secondvacation on, with the reply already on and the server's own script still the active one afterwards, leaves the note as it is. Ifvacation oncannot read the script list or cannot write the note, the reply change still stands: aWarning:line on standard error says what happened, and the exit status stays 0; the same holds forvacation offwhen the list cannot be read and no note names a script. A server without Sieve gets no extra call; a server that leaves the active script alone gets the two list reads, and the commands print what they printed before. -
jmapcli sieve activate <name>: switch a stored script on. Makes the Sieve script that is stored under<name>the account's active filter without sending its text again. The command reads the scripts once, takes the script whose name is exactly<name>(upper and lower case count), and sends oneSieveScript/setthat carries only the account, that script's id (onSuccessActivateScript) and, when the server gave one, the state of the reading (ifInState); nothing is uploaded, created or updated. Then it reads the scripts back and printsActivated Sieve script '<name>'., theActive filter:line thatsieve pushprints, andActive before:with the script that was active in the reading, or(none). When no stored script has the name, it says so on standard error, lists the stored scripts by name with the active one marked (or says that none is stored), and ends with exit status 1. When several stored scripts have the name, it refuses, says how many, and ends with exit status 1. When the script is already the active one, it says so, sends nothing more, and ends with exit status 0. When a server that honoursifInStatefinds that the scripts changed after the reading, it refuses the change; the command says that the scripts changed and that nothing was changed, and ends with exit status 1. A read-back that fails is a warning on standard error, not a failure; the first line then says that the server accepted the request, not that the script is active. If the read-back shows that the script is not the active one although the server reported no error, the command prints the active filter, says that the script is not it, and ends with exit status 1. On a server that ignoresifInState, or that gave no state with the reading, the change is not tied to the reading: what another client did to the scripts in between is not seen, and the request names the script by its id, whatever its name is by then. The command takes--accountlike the othersievecommands. On a server that does not advertiseurn:ietf:params:jmap:sieveit prints the two lines the othersievecommands print and ends with exit status 1. Stalwart accepts aSieveScript/setthat only activates, by one run on a Stalwart test account (23 Nov 2026): a stored script was switched on, the script list showed it as the active one, and the script that had been active was switched back on the same way. The same run showed that Stalwart honoursifInStateon a store throughsieve.push(above);sieve activateagainst scripts that changed in between was not tried. There is nodeactivatecommand and no MCP tool for this. Needs JMAPClient withgetSieveScriptsWithStateandactivateSieveScript.
Fixed
-
send,draft,replyandforwardnow act as the account--accountnames. Before,--accountonly chose between accounts that both carried the--fromaddress. Without--from, or with a--fromthe default account also carried, the default account was used and nothing said so:draft --account work@example.comsaved the draft in the default account. Now the connection goes to the--accountaccount and--frommust be one of its identities (or the account's own name). A--fromit does not carry is refused with a message that lists what the account can send as. An--accountthat names no configured account is refused before anything is contacted.replyandforwardread the message they answer from that account, so its id must be one of that account's. Without--account, and withJMAPCLI_ACCOUNTunset, nothing changes. -
jmapcli mcp: a number too large for an integer no longer ends the server.mail.listormail.searchwith alimit, ormail.save_attachmentwith anindex, such as1e300stopped the server process. Such a number is now refused with-32602. So is one with a fractional part:"limit": 1.5was read as 1. A whole number written as2.0is still accepted. -
calendar eventshelp line. It said "(recurrences expanded)", but the query does not ask the server to expand them. It now says "(recurrences not expanded)".
Changed
-
send,draft,replyandforwardfollowJMAPCLI_ACCOUNT. With--accountomitted they now act as the account the variable names, under the same rules as--account:--frommust be one of that account's identities, and that refusal says the account came from the variable. A variable that names no configured account is refused before anything is contacted.--accounton the command line wins over the variable; with aJMAPCLI_TOKENorJMAPCLI_PASSWORDoverride set, a variable and an--accountthat name different accounts are refused, as before. Before, these four ignored the variable: they went by--from, else the default account. If you export the variable and used--fromto switch account for one message (send --from other@example.com), that is now refused: pass--accountwith that account's address for that message, and keep--fromwhen it is an alias on that account. With aJMAPCLI_TOKENorJMAPCLI_PASSWORDoverride set, an--accountthat differs from the variable is refused, so changeJMAPCLI_ACCOUNTinstead. -
movekeeps a message's other mailboxes.jmapcli moveand the MCPmail.moveused to replace a message's whole mailbox list with the target, so a message that was in several mailboxes ended up only in the target. Now each message leaves one mailbox and enters the target, and stays in every other mailbox it is in. A message that is in exactly one mailbox leaves that one. For a message in more than one, name the mailbox to take it out of:jmapcli move <id> <mailbox> --from <mailbox>, orfromonmail.move. Without it such a message is refused with a message that lists the mailboxes it is in, and nothing is sent for any message of that command or call. So is a--frommailbox a message is not in, and an id the account has no message for. A message whose source mailbox is the target is left as it is and counted, so repeating a move does no harm. If the server takes the change for some messages and not for others, the result says how many moved and which did not; the command exits with failure and the tool answersisError. A message counts as moved only when the server's reply lists it as updated: a reply that lists none and refuses none means nothing moved, and is that same failure. A move now reads each message's mailboxes with anEmail/getbefore it changes anything.mail.movereportssubmitted(the distinct ids given),moved,alreadyInMailboxandmailbox.jmapcli trashandmail.trashare unchanged: they still replace the whole list with Trash. -
sieve push: a read-back that fails is no longer a failed push. After the script is stored, the command reads the scripts back to printActive filter:. When that read failed, the command exited with the error although the script was stored (and active, with--activate). Now it prints theCreatedorUpdatedline, writes a warning to standard error that the script was stored and the active filter could not be read back, and exits with success. When the read succeeds the output is what it was. -
jmapcli mcp: which account a call acts on.- The server reads
JMAPCLI_ACCOUNTwhen it starts. A tool call withoutaccountacts on the account the variable names, and on the default account only when the variable is unset or empty. Anaccountargument wins over the variable. Before,mcpignored the variable. - An
accountargument that is an empty string, or not a string, is refused with-32602by every tool, before any account is opened. Before, an empty string meant the default account, and the six mail tools also read a non-string as the default account. argumentsthat is present and is not an object (a JSON string, an array, a number) is refused with-32602by every tool, before any account is opened. Before, it was read as no arguments, so the call lost itsaccountand acted on the variable's or the default account.argumentsleft out, or JSON null, is still no arguments.- The six mail tools now refuse an argument name they do not have with
-32602, as the other tools do, and their input schemas sayadditionalProperties: false. Before, they ignored it, so a misspeltaccountacted on the default account. - Every result of a call that reached an account, a failure included, names the account in a second text content block:
{"account":"<the account's configured name, in lower case>"}. The first content block is unchanged. A call refused before its account was resolved names none.
- The server reads