skrzynka mailbox/remove

Delete the local mail of one mailbox Skarbiec no longer declares, only after explicit confirmation.

Invocation#

text
skrzynka mailbox remove <ID> [--confirm]

Purpose#

Delete the local mail of one mailbox Skarbiec no longer declares, only after explicit confirmation.

Inputs and options#

Input or optionRequiredMeaning
<ID>YesMailbox UUID in the local CLI organization namespace.
--confirmYes for removalExplicit destructive-action acknowledgement; syntactically optional so the application can return a normalized refusal.

Global options accepted on this path are --organization <ID> (required on every command except serve, version and onboarding; none is assumed), --skarbiec-bin <PATH> (default skarbiec) and --text (print results as path: value lines for people instead of JSON).

Output and state effect#

With confirmation, cascade-deletes the local mailbox, its imported messages, their reply attempts, and every outbound message that mailbox originated, then prints {"removed":"<ID>"}. Both messages and outbound_messages reference mailboxes(id) ON DELETE CASCADE, and reply_attempts cascade from messages. It never deletes the Skarbiec item or provider mailbox.

Refusals#

  • MAILBOX_STILL_DECLARED: Skarbiec item '<ID>' still carries skrzynka:mailbox; undeclare the mailbox before removing its local mail — a declared mailbox would be recreated by the next reconciliation.
  • CONFIRMATION_REQUIRED: mailbox removal requires --confirm.
  • Invalid UUID syntax is refused by Clap before dispatch with exit 2.
  • NOT_FOUND: mailbox was not found when no organization-scoped row has that UUID.