MessageReadCommand (message/read.rs)

himalaya · src/shared/message/read.rs · rust · Apache-2.0
email, tag:knn-classified

MessageReadCommand reads and formats email messages, outputting headers, text, HTML, and MIME parts in text or JSON.

// Source: https://github.com/pimalaya/himalaya | License: Apache-2.0 | Copyright 2022-2026 soywod <pimalaya.org@posteo.net>
// Provided via justclaw.it.com; keep this notice with the code.
//! # Message read
//!
//! The `message read` command, rendering a fetched message as a header
//! block and a walk of its MIME parts, or under `--json` as a designed
//! view of its headers, bodies and parts.

use std::{
    fmt,
    io::{Write, stdout},
};

use anyhow::Result;
use chrono::{FixedOffset, NaiveDate, TimeZone};
use clap::Parser;
use humansize::{BINARY, format_size};
use mail_parser::{Addr, Address, ContentType, HeaderValue, Message, MessagePart, MimeHeaders};
use pimalaya_cli::{
    printer::{Message as PrinterMessage, Printer},
    table::sanitize,
};
use schemars::JsonSchema;
use serde:

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key