Browse Source

testing: add server_port to IMAP shell app, imapconn

tags/pre-alpha-0.3.1
Manos Pitsidianakis 6 months ago
parent
commit
d007ef7e00
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS. GPG Key ID: 73627C2F690DF710
1 changed files with 10 additions and 4 deletions
  1. +10
    -4
      testing/src/imap_conn.rs

+ 10
- 4
testing/src/imap_conn.rs View File

@@ -8,28 +8,34 @@ use melib::Result;

fn main() -> Result<()> {
let mut args = std::env::args().skip(1).collect::<Vec<String>>();
if args.len() != 3 {
eprintln!("Usage: imap_conn server_hostname server_username server_password");
if args.len() != 4 {
eprintln!("Usage: imap_conn server_hostname server_username server_password server_port");
std::process::exit(1);
}

let (a, b, c) = (
let (a, b, c, d) = (
std::mem::replace(&mut args[0], String::new()),
std::mem::replace(&mut args[1], String::new()),
std::mem::replace(&mut args[2], String::new()),
std::mem::replace(&mut args[3], String::new()),
);
let set = AccountSettings {
extra: [
("server_hostname".to_string(), a),
("server_username".to_string(), b),
("server_password".to_string(), c),
("server_port".to_string(), d),
(
"danger_accept_invalid_certs".to_string(),
"true".to_string(),
),
]
.iter()
.cloned()
.collect(),
..Default::default()
};
let mut imap = ImapType::new(&set);
let mut imap = ImapType::new(&set, Box::new(|_| true));
imap.shell();
Ok(())
}

Loading…
Cancel
Save