#imap

bin+lib atarashii_imap

IMAP client written in Rust

3 unstable releases

Uses old Rust 2015

0.3.0 May 16, 2017
0.2.1 Jun 25, 2016
0.2.0 Jun 12, 2016

#28 in #mail

22 downloads per month

Apache-2.0

20KB
446 lines

新しい IMAP client Build Status crates.io

新しい (atarashii/new) IMAP client in Rust. It supports plain and secure connections.

In progress

It's under development...

Usage

Put this in your Cargo.toml:

[dependencies]
atarashii_imap = "<current version of atarashii_imap>"

Example

extern crate atarashii_imap;
extern crate openssl;

use atarashii_imap::{Connection, Response};
use openssl::ssl::{SslContext, SslStream};
use openssl::ssl::SslMethod::Sslv23;

//.......
match Connection::open_secure("imap.gmail.com", SslContext::new(Sslv23).unwrap(), "gmail_login@gmail.com", "password") {
  Ok(mut conn) => {
    match conn.select("inbox") {
      Ok(sel_res) => {
        println!("select cmd result: {}", sel_res);
      },
      Err(e) => println!("select cmd error")
    }
  },
  Err(e) => panic!("Unable to open connection")
}

Commands supported

  • select(mailbox_name: &str)
  • examine(mailbox_name: &str)
  • create(mailbox_name: &str)
  • delete(mailbox_name: &str)
  • rename(current_name: &str, new_name: &str)
  • subscribe(mailbox_name: &str)
  • unsubscribe(mailbox_name: &str)
  • close
  • logout
  • capability
  • fetch
  • copy(seq_set: String, mailbox_name: String)
  • list(folder_name: &str, search_pattern: &str)
  • lsub(folder_name: &str, search_pattern: &str)
  • expunge
  • check
  • noop

Author

Alex Maslakov | me@gildedhonour.com

License

Apache 2.0

Dependencies

~5MB
~113K SLoC