mailme

Crates.iomailme
lib.rsmailme
version0.1.1
sourcesrc
created_at2020-10-29 15:24:00.445107
updated_at2020-10-29 15:27:53.961473
descriptionAsync Rust pop3 client with tokio
homepagehttps://github.com/PrivateRookie/mailme
repository
max_upload_size
id306669
size27,831
(PrivateRookie)

documentation

README

mailme

Async POP3 client impl with Rust.

supported methods

some pop3 server may not some methods list below

  • user

  • pass

  • stat

  • list (split into list_one and list)

  • retr

  • dele

  • noop

  • rset

  • quit

  • top

  • uidl (split into uidl_one and uidl)

  • capa

  • apop

example

add tokio and mailme to dep

tokio = { version = "0.3.1", features = ["io-util", "io-std", "net", "rt", "rt-multi-thread"] }
mailme = "0.1.1"
use pop3::POP3Client;
use tokio::runtime::Runtime;

fn main() {
    let rt = Runtime::new().unwrap();
    rt.block_on(async {
        // if not tls connection, use new_basic instead
        let mut client = POP3Client::new_tls("pop.qq.com", 995).await.unwrap();
        // remember to read welcome message
        println!("{:?}", client.read_welcome().await);
        // login
        println!("{:?}", client.user("PrivateRookie").await);
        println!("{:?}", client.pass("踏遍青山人未老").await);

        // do some thing
        println!("{:?}", client.stat().await);
    })
}

Todos

  • impl POP3 protocol(:heavy_check_mark:)

  • pop3 retr return parsed email

  • support custom ssl context

  • calling quit when pop3 client drop ?

  • impl imap protocol

  • add monitor methods

Refs

Commit count: 0

cargo fmt