testing: add server_port to IMAP shell app, imapconn

This commit is contained in:
Manos Pitsidianakis 2019-09-22 10:13:48 +03:00
parent ee82ae175a
commit d007ef7e00
No known key found for this signature in database
GPG Key ID: 73627C2F690DF710

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(())
}