Can't get IDLE to work
timakro opened this issue · comments
Tim Schumacher commented
My understanding is I keep an IDLE handle open and receive untagged responses on the unsolicited_responses
channel.
use imap;
use native_tls;
fn main() {
let domain = "example.com";
let tls = native_tls::TlsConnector::builder().build().unwrap();
let client = imap::connect((domain, 993), domain, &tls).unwrap();
let mut session = client.login("user", "pass").unwrap();
session.select("INBOX").unwrap();
loop {
println!("{:?}", session.unsolicited_responses.try_recv());
println!("enter idle");
let handle = session.idle().unwrap();
handle.wait_keepalive().unwrap();
println!("exit idle");
}
}
But I'm not getting any untagged responses (e.g. EXISTS
when mail arrives).
Err(Empty)
enter idle
exit idle
Err(Empty)
enter idle
exit idle
Err(Empty)
enter idle
exit idle
Err(Empty)
enter idle
The unsolicited_responses
channel is always empty. The server, Dovecot, supports IDLE. What am I doing wrong?
Tim Schumacher commented
I guess I should really upgrade to "unstable" 3.0.