mattnenterprise / rust-pop3

POP3 client for Rust
MIT License
31 stars 13 forks source link

POP3 retrieval errors after failure #20

Open ttcc-gh opened 4 years ago

ttcc-gh commented 4 years ago

Hi, I just tried to retrieve some mails in a loop, knowing that message #44 is not formatted correctly according to RFC (Spam message contains un-encoded binary data) and so, must run into error:

Example:

for i in 43..49 {
        let message = pop3.retr(i);
        let _eml = match message {
            POP3Message { raw: _ } => println!("{} ->  OK", i),
            _ => {  println!("{} -> ERR", i)
            }
        };

Result

43 ->  OK
44 -> ERR
45 -> ERR
46 -> ERR
47 -> ERR
48 -> ERR

Omitting message #44 in this loop by adding if i == 44 { continue } before pop3.retr results in correct output:

43 ->  OK
45 ->  OK
46 ->  OK
47 ->  OK
48 ->  OK

Any ideas what´s going wrong here? Did I miss something?