mirror of
https://git.meli.delivery/meli/meli
synced 2024-11-19 03:25:38 +00:00
testing: add server_port to IMAP shell app, imapconn
This commit is contained in:
parent
ee82ae175a
commit
d007ef7e00
@ -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…
Reference in New Issue
Block a user