mirror of
https://github.com/pimalaya/himalaya.git
synced 2026-06-15 20:07:57 +08:00
chore: cargo fmt
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
|
||||
use std::{fmt, path::PathBuf};
|
||||
|
||||
use anyhow::{bail, Result};
|
||||
use anyhow::{Result, bail};
|
||||
use clap::Parser;
|
||||
use pimalaya_cli::printer::Printer;
|
||||
use pimalaya_config::toml::TomlConfig;
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
use std::{collections::HashMap, env::temp_dir, path::PathBuf};
|
||||
|
||||
use comfy_table::{presets, Color as TableColor, ContentArrangement};
|
||||
use comfy_table::{Color as TableColor, ContentArrangement, presets};
|
||||
use crossterm::style::Color;
|
||||
use dirs::download_dir;
|
||||
|
||||
|
||||
+2
-1
@@ -17,7 +17,7 @@
|
||||
|
||||
use std::{fmt, str::FromStr};
|
||||
|
||||
use anyhow::{bail, Error};
|
||||
use anyhow::{Error, bail};
|
||||
use clap::Parser;
|
||||
|
||||
/// Selects which backend a cross-protocol command should target.
|
||||
@@ -39,6 +39,7 @@ pub enum Backend {
|
||||
Smtp,
|
||||
}
|
||||
|
||||
#[allow(unused)]
|
||||
impl Backend {
|
||||
/// Whether the IMAP arm of a shared command is allowed to run.
|
||||
pub fn allows_imap(self) -> bool {
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@
|
||||
|
||||
use std::path::PathBuf;
|
||||
|
||||
use anyhow::{bail, Result};
|
||||
use anyhow::{Result, bail};
|
||||
use clap::{CommandFactory, Parser, Subcommand};
|
||||
use pimalaya_cli::{
|
||||
clap::{
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ use comfy_table::ContentArrangement;
|
||||
use crossterm::style::Color;
|
||||
use pimalaya_config::{
|
||||
secret::Secret,
|
||||
toml::{shell_expanded_string, TomlConfig},
|
||||
toml::{TomlConfig, shell_expanded_string},
|
||||
};
|
||||
use pimalaya_stream::{
|
||||
sasl::{
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ use std::{
|
||||
path::PathBuf,
|
||||
};
|
||||
|
||||
use anyhow::{anyhow, Result};
|
||||
use anyhow::{Result, anyhow};
|
||||
use io_imap::client::ImapClientStd as Inner;
|
||||
use pimalaya_config::toml::TomlConfig;
|
||||
use pimalaya_stream::{sasl::Sasl, std::stream::StreamStd, tls::Tls};
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
use std::fmt;
|
||||
|
||||
use anyhow::{bail, Result};
|
||||
use anyhow::{Result, bail};
|
||||
use clap::Parser;
|
||||
use comfy_table::{Cell, Row, Table};
|
||||
use io_imap::types::{
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
use std::{collections::BTreeMap, fmt, num::NonZeroU32};
|
||||
|
||||
use anyhow::{bail, Result};
|
||||
use anyhow::{Result, bail};
|
||||
use clap::Parser;
|
||||
use comfy_table::{Cell, Color, ContentArrangement, Row, Table};
|
||||
use io_imap::types::{
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
use std::fmt;
|
||||
|
||||
use anyhow::{anyhow, bail, Result};
|
||||
use anyhow::{Result, anyhow, bail};
|
||||
use clap::Parser;
|
||||
use comfy_table::{Cell, Color, ContentArrangement, Row, Table};
|
||||
use io_imap::types::{
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
|
||||
use std::fmt;
|
||||
|
||||
use anyhow::{bail, Result};
|
||||
use anyhow::{Result, bail};
|
||||
use clap::Parser;
|
||||
use comfy_table::{presets, Cell, Color, ContentArrangement, Row, Table};
|
||||
use comfy_table::{Cell, Color, ContentArrangement, Row, Table, presets};
|
||||
use io_imap::types::{
|
||||
core::Vec1,
|
||||
extensions::sort::{SortCriterion, SortKey},
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
use std::{collections::HashMap, fmt, num::NonZeroU32};
|
||||
|
||||
use anyhow::{bail, Result};
|
||||
use anyhow::{Result, bail};
|
||||
use clap::Parser;
|
||||
use io_imap::types::{
|
||||
extensions::thread::{Thread, ThreadingAlgorithm},
|
||||
@@ -25,7 +25,7 @@ use io_imap::types::{
|
||||
sequence::SequenceSet,
|
||||
};
|
||||
use pimalaya_cli::printer::Printer;
|
||||
use serde::{ser::SerializeStruct, Serialize, Serializer};
|
||||
use serde::{Serialize, Serializer, ser::SerializeStruct};
|
||||
|
||||
use crate::imap::{
|
||||
client::ImapClient,
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
use anyhow::Result;
|
||||
use clap::Parser;
|
||||
use io_imap::types::{
|
||||
flag::{Flag, StoreType},
|
||||
IntoStatic,
|
||||
flag::{Flag, StoreType},
|
||||
};
|
||||
use pimalaya_cli::printer::{Message, Printer};
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
use anyhow::Result;
|
||||
use clap::Parser;
|
||||
use io_imap::types::{
|
||||
flag::{Flag, StoreType},
|
||||
IntoStatic,
|
||||
flag::{Flag, StoreType},
|
||||
};
|
||||
use pimalaya_cli::printer::{Message, Printer};
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
use anyhow::Result;
|
||||
use clap::Parser;
|
||||
use io_imap::types::{
|
||||
flag::{Flag, StoreType},
|
||||
IntoStatic,
|
||||
flag::{Flag, StoreType},
|
||||
};
|
||||
use pimalaya_cli::printer::{Message, Printer};
|
||||
|
||||
|
||||
+1
-1
@@ -21,8 +21,8 @@ use anyhow::Result;
|
||||
use clap::Parser;
|
||||
use comfy_table::{Cell, Row, Table};
|
||||
use io_imap::types::{
|
||||
core::{IString, NString},
|
||||
IntoStatic,
|
||||
core::{IString, NString},
|
||||
};
|
||||
use pimalaya_cli::printer::Printer;
|
||||
use serde::Serialize;
|
||||
|
||||
@@ -21,7 +21,7 @@ use std::{
|
||||
path::PathBuf,
|
||||
};
|
||||
|
||||
use anyhow::{bail, Result};
|
||||
use anyhow::{Result, bail};
|
||||
use clap::Parser;
|
||||
use io_imap::types::fetch::{MacroOrMessageDataItemNames, MessageDataItem, MessageDataItemName};
|
||||
use mail_parser::{MessageParser, MimeHeaders};
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
|
||||
use std::fmt;
|
||||
|
||||
use anyhow::{bail, Result};
|
||||
use anyhow::{Result, bail};
|
||||
use clap::Parser;
|
||||
use comfy_table::{presets, Cell, ContentArrangement, Row, Table};
|
||||
use comfy_table::{Cell, ContentArrangement, Row, Table, presets};
|
||||
use io_imap::types::fetch::{MacroOrMessageDataItemNames, MessageDataItem, MessageDataItemName};
|
||||
use mail_parser::{Addr, Address, ContentType, Message, MessageParser, MimeHeaders};
|
||||
use pimalaya_cli::printer::Printer;
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
use std::fmt;
|
||||
|
||||
use anyhow::{bail, Result};
|
||||
use anyhow::{Result, bail};
|
||||
use clap::Parser;
|
||||
use io_imap::types::fetch::{MacroOrMessageDataItemNames, MessageDataItem, MessageDataItemName};
|
||||
use mail_parser::{Message, MessageParser};
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
use std::io::{stdin, BufRead, IsTerminal};
|
||||
use std::io::{BufRead, IsTerminal, stdin};
|
||||
|
||||
use anyhow::Result;
|
||||
use clap::Parser;
|
||||
use io_imap::types::{
|
||||
core::Literal, extensions::binary::LiteralOrLiteral8, flag::Flag, mailbox::Mailbox, IntoStatic,
|
||||
IntoStatic, core::Literal, extensions::binary::LiteralOrLiteral8, flag::Flag, mailbox::Mailbox,
|
||||
};
|
||||
use pimalaya_cli::printer::{Message, Printer};
|
||||
|
||||
|
||||
+2
-2
@@ -27,8 +27,8 @@ use std::{
|
||||
path::PathBuf,
|
||||
};
|
||||
|
||||
use anyhow::{anyhow, Result};
|
||||
use base64::{prelude::BASE64_STANDARD, Engine};
|
||||
use anyhow::{Result, anyhow};
|
||||
use base64::{Engine, prelude::BASE64_STANDARD};
|
||||
use io_jmap::client::JmapClientStd as Inner;
|
||||
use pimalaya_config::toml::TomlConfig;
|
||||
use pimalaya_stream::tls::Tls;
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
use anyhow::{bail, Result};
|
||||
use anyhow::{Result, bail};
|
||||
use clap::Parser;
|
||||
use io_jmap::rfc8621::email::EmailCopy;
|
||||
use pimalaya_cli::printer::{Message, Printer};
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
use anyhow::{bail, Result};
|
||||
use anyhow::{Result, bail};
|
||||
use clap::Parser;
|
||||
use io_jmap::rfc8621::email_set::JmapEmailSetArgs;
|
||||
use pimalaya_cli::printer::{Message, Printer};
|
||||
|
||||
@@ -15,14 +15,14 @@
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
use anyhow::{anyhow, Result};
|
||||
use anyhow::{Result, anyhow};
|
||||
use clap::Parser;
|
||||
use io_jmap::{client::JmapClientStd, rfc8621::capabilities::MAIL};
|
||||
use pimalaya_cli::printer::{Message, Printer};
|
||||
use pimalaya_stream::tls::Tls;
|
||||
use url::Url;
|
||||
|
||||
use crate::jmap::client::{jmap_http_auth, JmapClient};
|
||||
use crate::jmap::client::{JmapClient, jmap_http_auth};
|
||||
|
||||
/// Export a raw RFC 5322 message to stdout (Email/get + blob download).
|
||||
///
|
||||
|
||||
@@ -17,10 +17,10 @@
|
||||
|
||||
use std::{
|
||||
collections::BTreeMap,
|
||||
io::{stdin, BufRead, IsTerminal},
|
||||
io::{BufRead, IsTerminal, stdin},
|
||||
};
|
||||
|
||||
use anyhow::{bail, Result};
|
||||
use anyhow::{Result, bail};
|
||||
use clap::Parser;
|
||||
use io_jmap::{
|
||||
client::JmapClientStd,
|
||||
@@ -31,7 +31,7 @@ use pimalaya_stream::tls::Tls;
|
||||
use url::Url;
|
||||
|
||||
use crate::jmap::{
|
||||
client::{jmap_http_auth, JmapClient},
|
||||
client::{JmapClient, jmap_http_auth},
|
||||
error::format_set_error,
|
||||
};
|
||||
|
||||
|
||||
@@ -140,11 +140,7 @@ impl JmapEmailQueryCommand {
|
||||
|| f.subject.is_some()
|
||||
|| f.body.is_some();
|
||||
|
||||
if has_one_filter {
|
||||
Some(f)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
if has_one_filter { Some(f) } else { None }
|
||||
};
|
||||
|
||||
let sort = Some(vec![EmailComparator {
|
||||
@@ -247,8 +243,7 @@ impl fmt::Display for EmailsTable {
|
||||
row.add_cell(Cell::new(&flags).fg(self.colors.flags));
|
||||
row.add_cell(Cell::new(e.subject.as_deref().unwrap_or("")).fg(self.colors.subject));
|
||||
row.add_cell(
|
||||
Cell::new(format_addresses(e.from.as_deref().unwrap_or(&[])))
|
||||
.fg(self.colors.from),
|
||||
Cell::new(format_addresses(e.from.as_deref().unwrap_or(&[]))).fg(self.colors.from),
|
||||
);
|
||||
row.add_cell(Cell::new(e.received_at.as_deref().unwrap_or("")).fg(self.colors.date));
|
||||
table.add_row(row);
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
use anyhow::{bail, Result};
|
||||
use anyhow::{Result, bail};
|
||||
use clap::Parser;
|
||||
use io_jmap::rfc8621::email_set::JmapEmailSetArgs;
|
||||
use pimalaya_cli::printer::{Message, Printer};
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
use anyhow::{bail, Result};
|
||||
use anyhow::{Result, bail};
|
||||
use clap::Parser;
|
||||
use io_jmap::rfc8621::{identity::IdentityCreate, identity_set::JmapIdentitySetArgs};
|
||||
use pimalaya_cli::printer::{Message, Printer};
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
use anyhow::{bail, Result};
|
||||
use anyhow::{Result, bail};
|
||||
use clap::Parser;
|
||||
use io_jmap::rfc8621::identity_set::JmapIdentitySetArgs;
|
||||
use pimalaya_cli::printer::{Message, Printer};
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
use anyhow::{bail, Result};
|
||||
use anyhow::{Result, bail};
|
||||
use clap::Parser;
|
||||
use io_jmap::rfc8621::{identity::IdentityUpdate, identity_set::JmapIdentitySetArgs};
|
||||
use pimalaya_cli::printer::{Message, Printer};
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
use anyhow::{bail, Result};
|
||||
use anyhow::{Result, bail};
|
||||
use clap::Parser;
|
||||
use io_jmap::rfc8621::{mailbox::MailboxCreate, mailbox_set::JmapMailboxSetArgs};
|
||||
use pimalaya_cli::printer::{Message, Printer};
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
use anyhow::{bail, Result};
|
||||
use anyhow::{Result, bail};
|
||||
use clap::Parser;
|
||||
use io_jmap::rfc8621::mailbox_set::JmapMailboxSetArgs;
|
||||
use pimalaya_cli::printer::{Message, Printer};
|
||||
|
||||
@@ -88,11 +88,7 @@ impl JmapMailboxQueryCommand {
|
||||
|| f.is_subscribed.is_some()
|
||||
|| f.has_any_role.is_some();
|
||||
|
||||
if has_one_filter {
|
||||
Some(f)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
if has_one_filter { Some(f) } else { None }
|
||||
};
|
||||
|
||||
let sort = Some(vec![MailboxSortComparator {
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
use anyhow::{bail, Result};
|
||||
use anyhow::{Result, bail};
|
||||
use clap::Parser;
|
||||
use io_jmap::rfc8621::{mailbox::MailboxUpdate, mailbox_set::JmapMailboxSetArgs};
|
||||
use pimalaya_cli::printer::{Message, Printer};
|
||||
|
||||
+2
-2
@@ -17,10 +17,10 @@
|
||||
|
||||
use std::{
|
||||
fmt,
|
||||
io::{stdin, BufRead},
|
||||
io::{BufRead, stdin},
|
||||
};
|
||||
|
||||
use anyhow::{bail, Context, Result};
|
||||
use anyhow::{Context, Result, bail};
|
||||
use clap::Parser;
|
||||
use io_jmap::{
|
||||
rfc8620::{send::JmapRequest, session::capabilities::CORE},
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
use anyhow::{bail, Result};
|
||||
use anyhow::{Result, bail};
|
||||
use clap::Parser;
|
||||
use pimalaya_cli::printer::{Message, Printer};
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
use anyhow::{bail, Result};
|
||||
use anyhow::{Result, bail};
|
||||
use clap::Parser;
|
||||
use io_jmap::rfc8621::email_submission::{
|
||||
EmailAddressWithParameters, EmailSubmissionCreate, Envelope,
|
||||
|
||||
@@ -80,11 +80,7 @@ impl JmapSubmissionQueryCommand {
|
||||
|
||||
let has_one = f.undo_status.is_some() || f.before.is_some() || f.after.is_some();
|
||||
|
||||
if has_one {
|
||||
Some(f)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
if has_one { Some(f) } else { None }
|
||||
};
|
||||
|
||||
let output = client.email_submission_query(
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
use std::fmt;
|
||||
|
||||
use anyhow::{bail, Result};
|
||||
use anyhow::{Result, bail};
|
||||
use clap::Parser;
|
||||
use comfy_table::{Cell, Row, Table};
|
||||
use io_jmap::rfc8621::{capabilities::VACATION_RESPONSE, vacation_response::VacationResponse};
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
use anyhow::{bail, Result};
|
||||
use anyhow::{Result, bail};
|
||||
use clap::Parser;
|
||||
use io_jmap::rfc8621::{
|
||||
capabilities::VACATION_RESPONSE, vacation_response::VacationResponseUpdate,
|
||||
|
||||
@@ -27,7 +27,7 @@ use std::{
|
||||
path::PathBuf,
|
||||
};
|
||||
|
||||
use anyhow::{anyhow, Result};
|
||||
use anyhow::{Result, anyhow};
|
||||
use io_maildir::client::MaildirClient as Inner;
|
||||
use pimalaya_config::toml::TomlConfig;
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
use std::fmt;
|
||||
|
||||
use anyhow::{bail, Result};
|
||||
use anyhow::{Result, bail};
|
||||
use clap::Parser;
|
||||
use comfy_table::{Cell, Row, Table};
|
||||
use io_maildir::maildir::Maildir;
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
use std::{fmt, fs, path::PathBuf};
|
||||
|
||||
use anyhow::{bail, Result};
|
||||
use anyhow::{Result, bail};
|
||||
use clap::{Parser, ValueEnum};
|
||||
use convert_case::ccase;
|
||||
use io_maildir::maildir::Maildir;
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
use std::fmt;
|
||||
|
||||
use anyhow::{bail, Result};
|
||||
use anyhow::{Result, bail};
|
||||
use clap::Parser;
|
||||
use io_maildir::maildir::Maildir;
|
||||
use mail_parser::Message;
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
use std::fmt;
|
||||
|
||||
use anyhow::{bail, Result};
|
||||
use anyhow::{Result, bail};
|
||||
use clap::Parser;
|
||||
use io_maildir::maildir::Maildir;
|
||||
use mail_parser::Message;
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
use std::{
|
||||
fmt,
|
||||
io::{stdin, BufRead, IsTerminal},
|
||||
io::{BufRead, IsTerminal, stdin},
|
||||
path::PathBuf,
|
||||
};
|
||||
|
||||
|
||||
@@ -21,13 +21,13 @@ use std::{
|
||||
path::{Path, PathBuf},
|
||||
};
|
||||
|
||||
use anyhow::{bail, Result};
|
||||
use anyhow::{Result, bail};
|
||||
use clap::Parser;
|
||||
use mail_parser::{MessageParser, MimeHeaders};
|
||||
use pimalaya_cli::printer::Printer;
|
||||
|
||||
use crate::shared::{
|
||||
attachments::list::{mime_string, Attachment, AttachmentColors, Attachments},
|
||||
attachments::list::{Attachment, AttachmentColors, Attachments, mime_string},
|
||||
client::EmailClient,
|
||||
mailboxes::arg::MailboxArg,
|
||||
};
|
||||
|
||||
@@ -17,10 +17,10 @@
|
||||
|
||||
use std::fmt;
|
||||
|
||||
use anyhow::{bail, Result};
|
||||
use anyhow::{Result, bail};
|
||||
use clap::Parser;
|
||||
use comfy_table::{Cell, Color, ContentArrangement, Row, Table};
|
||||
use humansize::{format_size, BINARY};
|
||||
use humansize::{BINARY, format_size};
|
||||
use mail_parser::{MessageParser, MessagePart, MimeHeaders};
|
||||
use pimalaya_cli::printer::Printer;
|
||||
use serde::Serialize;
|
||||
|
||||
@@ -21,7 +21,7 @@ use anyhow::Result;
|
||||
use chrono::{DateTime, FixedOffset, Local};
|
||||
use clap::Parser;
|
||||
use comfy_table::{Cell, Color, ContentArrangement, Row, Table};
|
||||
use humansize::{format_size, BINARY};
|
||||
use humansize::{BINARY, format_size};
|
||||
use io_email::{address::Address, envelope::Envelope, flag::Flag};
|
||||
use pimalaya_cli::printer::Printer;
|
||||
use serde::Serialize;
|
||||
@@ -184,7 +184,9 @@ impl fmt::Display for Envelopes {
|
||||
let mut row = Row::new();
|
||||
row.max_height(1);
|
||||
row.add_cell(Cell::new(&env.id).fg(self.colors.id));
|
||||
row.add_cell(Cell::new(format_flags(&env.flags, &self.chars)).fg(self.colors.flags));
|
||||
row.add_cell(
|
||||
Cell::new(format_flags(&env.flags, &self.chars)).fg(self.colors.flags),
|
||||
);
|
||||
if self.with_attachment {
|
||||
row.add_cell(
|
||||
Cell::new(format_attachment(env.has_attachment, self.chars.attachment))
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
use anyhow::{anyhow, Result};
|
||||
use anyhow::{Result, anyhow};
|
||||
use clap::Parser;
|
||||
|
||||
use crate::account::context::Account;
|
||||
|
||||
@@ -16,11 +16,11 @@
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
use std::{
|
||||
io::{stdin, IsTerminal, Read},
|
||||
io::{IsTerminal, Read, stdin},
|
||||
path::PathBuf,
|
||||
};
|
||||
|
||||
use anyhow::{bail, Result};
|
||||
use anyhow::{Result, bail};
|
||||
use clap::Parser;
|
||||
use io_email::flag::Flag;
|
||||
use pimalaya_cli::printer::Message;
|
||||
|
||||
@@ -29,15 +29,15 @@
|
||||
//! external command and never go through this module.
|
||||
|
||||
use std::{
|
||||
io::{stdin, IsTerminal, Read as _},
|
||||
io::{IsTerminal, Read as _, stdin},
|
||||
path::{Path, PathBuf},
|
||||
};
|
||||
|
||||
use anyhow::{anyhow, Result};
|
||||
use anyhow::{Result, anyhow};
|
||||
use clap::ValueEnum;
|
||||
use mail_builder::{
|
||||
headers::{address::Address, raw::Raw},
|
||||
MessageBuilder,
|
||||
headers::{address::Address, raw::Raw},
|
||||
};
|
||||
use mail_parser::{HeaderValue, MessageParser};
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
use anyhow::{bail, Result};
|
||||
use anyhow::{Result, bail};
|
||||
use clap::Parser;
|
||||
use pimalaya_cli::printer::Printer;
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
use anyhow::{bail, Result};
|
||||
use anyhow::{Result, bail};
|
||||
use clap::Parser;
|
||||
use pimalaya_cli::printer::Printer;
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
use anyhow::{anyhow, bail, Result};
|
||||
use anyhow::{Result, anyhow, bail};
|
||||
use clap::Parser;
|
||||
use percent_encoding::percent_decode_str;
|
||||
use pimalaya_cli::printer::Printer;
|
||||
|
||||
@@ -23,9 +23,9 @@
|
||||
//! `Sent` mailbox. With neither flag, the raw bytes are written to
|
||||
//! stdout — same shape as a manual `mml compile > out.eml`.
|
||||
|
||||
use std::io::{stdout, Write};
|
||||
use std::io::{Write, stdout};
|
||||
|
||||
use anyhow::{anyhow, bail, Result};
|
||||
use anyhow::{Result, anyhow, bail};
|
||||
use mail_parser::{Address as ParserAddress, HeaderValue, MessageParser};
|
||||
use pimalaya_cli::printer::{Message, Printer};
|
||||
|
||||
|
||||
@@ -17,10 +17,10 @@
|
||||
|
||||
use std::{
|
||||
fmt,
|
||||
io::{stdout, Write},
|
||||
io::{Write, stdout},
|
||||
};
|
||||
|
||||
use anyhow::{bail, Result};
|
||||
use anyhow::{Result, bail};
|
||||
use clap::Parser;
|
||||
use mail_parser::{Message, MessageParser};
|
||||
use pimalaya_cli::printer::Printer;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
use std::io::{stdout, Write};
|
||||
use std::io::{Write, stdout};
|
||||
|
||||
use anyhow::Result;
|
||||
use clap::Parser;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
use anyhow::{bail, Result};
|
||||
use anyhow::{Result, bail};
|
||||
use clap::Parser;
|
||||
use pimalaya_cli::printer::Printer;
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ use std::{
|
||||
process::{Command, Stdio},
|
||||
};
|
||||
|
||||
use anyhow::{anyhow, bail, Result};
|
||||
use anyhow::{Result, anyhow, bail};
|
||||
|
||||
use crate::config::{ComposerConfig, ReaderConfig};
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
use std::{
|
||||
io::{stdin, BufRead, IsTerminal},
|
||||
io::{BufRead, IsTerminal, stdin},
|
||||
path::PathBuf,
|
||||
};
|
||||
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ use std::{
|
||||
path::PathBuf,
|
||||
};
|
||||
|
||||
use anyhow::{anyhow, Result};
|
||||
use anyhow::{Result, anyhow};
|
||||
use io_smtp::{client::SmtpClientStd as Inner, rfc5321::types::ehlo_domain::EhloDomain};
|
||||
use pimalaya_config::toml::TomlConfig;
|
||||
use pimalaya_stream::{sasl::Sasl, std::stream::StreamStd, tls::Tls};
|
||||
|
||||
@@ -18,10 +18,10 @@
|
||||
use std::{
|
||||
borrow::Cow,
|
||||
collections::HashSet,
|
||||
io::{stdin, BufRead, IsTerminal},
|
||||
io::{BufRead, IsTerminal, stdin},
|
||||
};
|
||||
|
||||
use anyhow::{bail, Result};
|
||||
use anyhow::{Result, bail};
|
||||
use clap::Parser;
|
||||
use io_smtp::rfc5321::types::{
|
||||
domain::Domain, ehlo_domain::EhloDomain, forward_path::ForwardPath, local_part::LocalPart,
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
use std::process::Command;
|
||||
|
||||
use anyhow::{bail, Result};
|
||||
use anyhow::{Result, bail};
|
||||
use pimalaya_cli::wizard::{
|
||||
imap::{Encryption as ImapEncryption, ImapAuth, ImapSecret, WizardImapConfig},
|
||||
jmap::{JmapAuth, JmapSecret, WizardJmapConfig},
|
||||
|
||||
@@ -33,7 +33,7 @@ use pimalaya_cli::{
|
||||
},
|
||||
};
|
||||
|
||||
use crate::wizard::discover::{discovery_resolver, discovery_tls, DiscoveryResult};
|
||||
use crate::wizard::discover::{DiscoveryResult, discovery_resolver, discovery_tls};
|
||||
|
||||
pub fn run(local_part: &str, domain: &str) -> Option<Autoconfig> {
|
||||
let mut client =
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
use std::{collections::HashMap, path::Path, process::exit};
|
||||
|
||||
use anyhow::{anyhow, Result};
|
||||
use anyhow::{Result, anyhow};
|
||||
use log::info;
|
||||
use pimalaya_cli::{
|
||||
prompt,
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@
|
||||
|
||||
use std::path::Path;
|
||||
|
||||
use anyhow::{anyhow, Result};
|
||||
use anyhow::{Result, anyhow};
|
||||
use log::info;
|
||||
use pimalaya_cli::{
|
||||
prompt,
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ use pimalaya_cli::{
|
||||
},
|
||||
};
|
||||
|
||||
use crate::wizard::discover::{discovery_resolver, discovery_tls, DiscoveryResult};
|
||||
use crate::wizard::discover::{DiscoveryResult, discovery_resolver, discovery_tls};
|
||||
|
||||
pub fn run(domain: &str) -> Option<PaccConfig> {
|
||||
let spinner = Spinner::start(format!("Probing PACC for {domain}…"));
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ use pimalaya_cli::{
|
||||
},
|
||||
};
|
||||
|
||||
use crate::wizard::discover::{discovery_resolver, DiscoveryResult};
|
||||
use crate::wizard::discover::{DiscoveryResult, discovery_resolver};
|
||||
|
||||
pub fn run(domain: &str) -> Option<SrvReport> {
|
||||
let spinner = Spinner::start(format!("Probing SRV records for {domain}…"));
|
||||
|
||||
Reference in New Issue
Block a user