add client_auth using sasl

This commit is contained in:
Astro 2017-06-06 01:29:20 +02:00
commit f8de49569f
5 changed files with 182 additions and 1 deletions

View file

@ -33,6 +33,9 @@ fn main() {
} else {
panic!("No STARTTLS")
}
}).map_err(|e| format!("{}", e)
).and_then(|stream| {
stream.auth("astrobot", "").expect("auth")
}).and_then(|stream| {
stream.for_each(|event| {
match event {
@ -40,7 +43,7 @@ fn main() {
_ => println!("!! {:?}", event),
}
Ok(())
})
}).map_err(|e| format!("{}", e))
});
match core.run(client) {
Ok(_) => (),