From 3e3f111d3b42f53492c2a31be2464d74ad9dd7e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20DOUIN?= Date: Mon, 11 Dec 2023 22:01:48 +0100 Subject: [PATCH] fix typos --- config.sample.toml | 9 +++++++++ src/config/mod.rs | 2 +- src/folder/config.rs | 8 ++++---- src/imap/wizard.rs | 8 +++++++- src/smtp/wizard.rs | 8 +++++++- 5 files changed, 28 insertions(+), 7 deletions(-) diff --git a/config.sample.toml b/config.sample.toml index 31da751..e7b3eff 100644 --- a/config.sample.toml +++ b/config.sample.toml @@ -20,6 +20,15 @@ sync.enable = true # Override the default Maildir path for synchronization. sync.dir = "/tmp/himalaya-sync-example" +# Define main folder aliases +folder.alias.inbox = "INBOX" +folder.alias.sent = "Sent" +folder.alias.drafts = "Drafts" +folder.alias.trash = "Trash" + +# Also define custom folder aliases +folder.alias.prev-year = "Archives/2023" + # Default backend used for all the features like adding folders, # listing envelopes or copying messages. backend = "imap" diff --git a/src/config/mod.rs b/src/config/mod.rs index 3cd780d..9fafd1f 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -201,7 +201,7 @@ impl TomlConfig { downloads_dir: config.downloads_dir, folder: config.folder.map(|c| FolderConfig { - aliases: c.remote.aliases, + aliases: c.alias, list: c.list.map(|c| c.remote), }), envelope: config.envelope.map(|c| EnvelopeConfig { diff --git a/src/folder/config.rs b/src/folder/config.rs index 5f4bed4..5b1f3c3 100644 --- a/src/folder/config.rs +++ b/src/folder/config.rs @@ -1,18 +1,18 @@ use serde::{Deserialize, Serialize}; -use std::collections::HashSet; +use std::collections::{HashMap, HashSet}; use crate::backend::BackendKind; #[derive(Clone, Debug, Default, Eq, PartialEq, Deserialize, Serialize)] pub struct FolderConfig { + #[serde(alias = "aliases")] + pub alias: Option>, + pub add: Option, pub list: Option, pub expunge: Option, pub purge: Option, pub delete: Option, - - #[serde(flatten)] - pub remote: email::folder::config::FolderConfig, } impl FolderConfig { diff --git a/src/imap/wizard.rs b/src/imap/wizard.rs index a3cacd8..75674eb 100644 --- a/src/imap/wizard.rs +++ b/src/imap/wizard.rs @@ -51,13 +51,19 @@ pub(crate) async fn configure(account_name: &str, email: &str) -> Result { config.ssl = Some(true); + config.starttls = Some(false); 993 } Some(idx) if PROTOCOLS[idx] == STARTTLS => { + config.ssl = Some(false); config.starttls = Some(true); 143 } - _ => 143, + _ => { + config.ssl = Some(false); + config.starttls = Some(false); + 143 + } }; config.port = Input::with_theme(&*THEME) diff --git a/src/smtp/wizard.rs b/src/smtp/wizard.rs index a6ea67a..bbc199b 100644 --- a/src/smtp/wizard.rs +++ b/src/smtp/wizard.rs @@ -51,13 +51,19 @@ pub(crate) async fn configure(account_name: &str, email: &str) -> Result { config.ssl = Some(true); + config.starttls = Some(false); 465 } Some(idx) if PROTOCOLS[idx] == STARTTLS => { + config.ssl = Some(false); config.starttls = Some(true); 587 } - _ => 25, + _ => { + config.ssl = Some(false); + config.starttls = Some(false); + 25 + } }; config.port = Input::with_theme(&*THEME)