mirror of
https://github.com/pimalaya/himalaya.git
synced 2026-06-17 05:07:55 +08:00
release v0.5.2 (#282)
* doc: fix blur in list msg screenshots (#181) * fix a typo in mbox arg (#245) `targetted` to `targeted` 👌🏻 * make inbox, sent and drafts folder customizable (#246) * mbox: make inbox, sent and drafts folder customizable * msg: update send handler parameters order * vim: fix extracting message ids from list (#247) The current method doesn't work because the list uses a fancy line character (`│`) as the separator, not a regular pipe character (`|`). Matching for the first number in the line instead solves the problem and will continue to work regardless of what separator is used. * add new line after printing strings (#251) * init cargo workspace (#252) * init cargo workspaces * nix: fix assets path * doc: update rtp vim plugin * vim: add error message if loading vim plugin from vim/ * init sub crates (#253) * init sub crates * doc: update readme * doc: improve main readme * doc: add links, add missing crate task * doc: update emojis * update cargo lock * implement contact completion with completefunc (#250) This allows users to define a command for contact completion with `g:himalaya_complete_contact_cmd` and trigger it with `<C-x><C-u>` when writing an email. * fix clippy lints (#255) * revert cargo workspace feature * fix nix run (#274) * replace cargo2nix by naersk * add rust-analyzer and rustfmt to nix build inputs * remove wiki from git submodules, update changelog * fix missing range when fetch fails, add more logs (#276) * add missing fix in changelog * remove blank lines and spaces from plain parts (#280) * fix watch command (#271) * remove also tabs from text parts (#280) * pin native-tls minor version (#278) * improve msg sanitization (#280) * fix mbox vim plugin telescope preview (#249) * bump version v0.5.2 * update changelog Co-authored-by: Austin Traver <austintraver@gmail.com> Co-authored-by: Jason Cox <dev@jasoncarloscox.com> Co-authored-by: Gökmen Görgen <gkmngrgn@gmail.com> Co-authored-by: Ethiraric <ethiraric@gmail.com>
This commit is contained in:
@@ -1,150 +0,0 @@
|
||||
// FIXME: fix tests
|
||||
// use std::convert::TryFrom;
|
||||
|
||||
// use himalaya::{
|
||||
// domain::account::entity::Account, flag::model::Flags, imap::model::ImapConnector,
|
||||
// mbox::model::Mboxes, msg::model::Msgs,
|
||||
// };
|
||||
|
||||
// use imap::types::Flag;
|
||||
|
||||
// use lettre::message::SinglePart;
|
||||
// use lettre::Message;
|
||||
|
||||
// fn get_account(addr: &str) -> Account {
|
||||
// Account {
|
||||
// name: None,
|
||||
// downloads_dir: None,
|
||||
// signature_delimiter: None,
|
||||
// signature: None,
|
||||
// default_page_size: None,
|
||||
// default: Some(true),
|
||||
// email: addr.into(),
|
||||
// watch_cmds: None,
|
||||
// imap_host: String::from("localhost"),
|
||||
// imap_port: 3993,
|
||||
// imap_starttls: Some(false),
|
||||
// imap_insecure: Some(true),
|
||||
// imap_login: addr.into(),
|
||||
// imap_passwd_cmd: String::from("echo 'password'"),
|
||||
// smtp_host: String::from("localhost"),
|
||||
// smtp_port: 3465,
|
||||
// smtp_starttls: Some(false),
|
||||
// smtp_insecure: Some(true),
|
||||
// smtp_login: addr.into(),
|
||||
// smtp_passwd_cmd: String::from("echo 'password'"),
|
||||
// }
|
||||
// }
|
||||
|
||||
// #[test]
|
||||
// fn mbox() {
|
||||
// let account = get_account("inbox@localhost");
|
||||
// let mut imap_conn = ImapConnector::new(&account).unwrap();
|
||||
// let names = imap_conn.list_mboxes().unwrap();
|
||||
// let mboxes: Vec<String> = Mboxes::from(&names)
|
||||
// .0
|
||||
// .into_iter()
|
||||
// .map(|mbox| mbox.name)
|
||||
// .collect();
|
||||
// assert_eq!(mboxes, vec![String::from("INBOX")]);
|
||||
// imap_conn.logout();
|
||||
// }
|
||||
|
||||
// #[test]
|
||||
// fn msg() {
|
||||
// // Preparations
|
||||
|
||||
// // Get the test-account and clean up the server.
|
||||
// let account = get_account("inbox@localhost");
|
||||
|
||||
// // Login
|
||||
// let mut imap_conn = ImapConnector::new(&account).unwrap();
|
||||
|
||||
// // remove all previous mails first
|
||||
// let fetches = imap_conn.list_msgs("INBOX", &10, &0).unwrap();
|
||||
// let msgs = if let Some(ref fetches) = fetches {
|
||||
// Msgs::try_from(fetches).unwrap()
|
||||
// } else {
|
||||
// Msgs::new()
|
||||
// };
|
||||
|
||||
// // mark all mails as deleted
|
||||
// for msg in msgs.0.iter() {
|
||||
// imap_conn
|
||||
// .add_flags(
|
||||
// "INBOX",
|
||||
// &msg.get_uid().unwrap().to_string(),
|
||||
// Flags::from(vec![Flag::Deleted]),
|
||||
// )
|
||||
// .unwrap();
|
||||
// }
|
||||
// imap_conn.expunge("INBOX").unwrap();
|
||||
|
||||
// // make sure, that they are *really* deleted
|
||||
// assert!(imap_conn.list_msgs("INBOX", &10, &0).unwrap().is_none());
|
||||
|
||||
// // == Testing ==
|
||||
// // Add messages
|
||||
// let message_a = Message::builder()
|
||||
// .from("sender-a@localhost".parse().unwrap())
|
||||
// .to("inbox@localhost".parse().unwrap())
|
||||
// .subject("Subject A")
|
||||
// .singlepart(SinglePart::builder().body("Body A".as_bytes().to_vec()))
|
||||
// .unwrap();
|
||||
|
||||
// let message_b = Message::builder()
|
||||
// .from("Sender B <sender-b@localhost>".parse().unwrap())
|
||||
// .to("inbox@localhost".parse().unwrap())
|
||||
// .subject("Subject B")
|
||||
// .singlepart(SinglePart::builder().body("Body B".as_bytes().to_vec()))
|
||||
// .unwrap();
|
||||
|
||||
// smtp::send(&account, &message_a).unwrap();
|
||||
// smtp::send(&account, &message_b).unwrap();
|
||||
|
||||
// // -- Get the messages --
|
||||
// // TODO: check non-existance of \Seen flag
|
||||
// let msgs = imap_conn.list_msgs("INBOX", &10, &0).unwrap();
|
||||
// let msgs = if let Some(ref fetches) = msgs {
|
||||
// Msgs::try_from(fetches).unwrap()
|
||||
// } else {
|
||||
// Msgs::new()
|
||||
// };
|
||||
|
||||
// // make sure that there are both mails which we sended
|
||||
// assert_eq!(msgs.0.len(), 2);
|
||||
|
||||
// let msg_a = msgs
|
||||
// .0
|
||||
// .iter()
|
||||
// .find(|msg| msg.headers.subject.clone().unwrap() == "Subject A")
|
||||
// .unwrap();
|
||||
|
||||
// let msg_b = msgs
|
||||
// .0
|
||||
// .iter()
|
||||
// .find(|msg| msg.headers.subject.clone().unwrap() == "Subject B")
|
||||
// .unwrap();
|
||||
|
||||
// // -- Checkup --
|
||||
// // look, if we received the correct credentials of the msgs.
|
||||
// assert_eq!(
|
||||
// msg_a.headers.subject.clone().unwrap_or_default(),
|
||||
// "Subject A"
|
||||
// );
|
||||
// assert_eq!(&msg_a.headers.from[0], "sender-a@localhost");
|
||||
|
||||
// assert_eq!(
|
||||
// msg_b.headers.subject.clone().unwrap_or_default(),
|
||||
// "Subject B"
|
||||
// );
|
||||
// assert_eq!(&msg_b.headers.from[0], "Sender B <sender-b@localhost>");
|
||||
|
||||
// // TODO: search messages
|
||||
// // TODO: read message (+ \Seen flag)
|
||||
// // TODO: list message attachments
|
||||
// // TODO: add/set/remove flags
|
||||
|
||||
// // Logout
|
||||
// imap_conn.logout();
|
||||
// }
|
||||
Reference in New Issue
Block a user