Skip to main content

agent_first_mail/cli/
message.rs

1use clap::Subcommand;
2
3#[derive(Subcommand, Debug)]
4pub enum MessageAction {
5    /// Show the full local message metadata, body text, and attachment metadata.
6    Show {
7        /// Message id, for example message_inbox_607146690_22.
8        message_id: String,
9    },
10    /// Mark junk/phishing/malware/suspicious mail locally, show it under spam/, and queue a Junk move.
11    Spam {
12        /// Message id, for example message_inbox_607146690_22.
13        message_id: String,
14        /// Why this disposition is correct; required by default.
15        #[arg(long)]
16        reason: Option<String>,
17    },
18    /// Explicitly discard this message locally, show it under trash/, and queue a Trash move.
19    Trash {
20        /// Message id, for example message_inbox_607146690_22.
21        message_id: String,
22        /// Why this disposition is correct; required by default.
23        #[arg(long)]
24        reason: Option<String>,
25    },
26    /// Restore a message from spam, trash, or direct archive back to triage.
27    Restore {
28        /// Message id, for example message_inbox_607146690_22.
29        message_id: String,
30        /// Why this restore is correct; required by default.
31        #[arg(long)]
32        reason: Option<String>,
33    },
34    /// Fetch an attachment for this message.
35    Attachment {
36        #[command(subcommand)]
37        action: MessageAttachmentAction,
38    },
39}
40
41#[derive(Subcommand, Debug)]
42pub enum MessageAttachmentAction {
43    /// Fetch one attachment by MIME part id, or all attachments when omitted.
44    Fetch {
45        /// Message id, for example message_inbox_607146690_22.
46        message_id: String,
47        part_id: Option<String>,
48    },
49}