新しい IMAP client in Rust

Overview

新しい 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::{Client, Response, SslMode};
use native_tls::{TlsConnector, TlsConnectorBuilder, TlsStream, SslMethod, SslConnectorBuilder};
//.......

match Client::connect("imap.gmail.com") {
  Ok(mut client) => {
    match conn.authenticate("[email protected]", "password") {
        //todo

        // doing stuff with client
        // ............

        client.disconnect();
      },

      Err(e) => println!("authentication error")
    }
  },

  Err(e) => panic!("connection error")
}

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 | [email protected]

License

Apache 2.0

You might also like...
An ESMTP server library written in Rust.

rs-smtp An ESMTP server library written in Rust. Features ESMTP client & server implementing RFC 5321 Support for SMTP AUTH and PIPELINING UTF-8 suppo

E-mail delivery library for Rust with DKIM support

mail-send mail-send is a Rust library to build, sign and send e-mail messages via SMTP. It includes the following features: Generates e-mail messages

Remedy is a multi-threaded rust-imap-maildir synchronization program

remedy Remedy is a multi-threaded rust-imap-maildir synchronization program. Please note that remedy is under heavy development. Current features: IMA

Meteor Client Installer - Installer to automate the install of Fabric and Meteor Client
Meteor Client Installer - Installer to automate the install of Fabric and Meteor Client

This is an installer that automates the install of Meteor and Fabric

Provides a mock Ambi client that emulates real sensor hardware such as an Edge client

ambi_mock_client Provides a mock Ambi client that emulates real sensor hardware such as an Edge client. Usage You must have Rust installed to build am

Affine-client is a client for AFFINE based on Tauri
Affine-client is a client for AFFINE based on Tauri

Affine Client affine-client is a client for AFFINE based on Tauri Supported Platforms Windows Linux MacOS Download https://github.com/m1911star/affine

Acts as an IRC server and a nostr client. Connect with your IRC client using your nostr private key as the password.

nostr-irc Acts as an IRC server and a nostr client. Connect with your IRC client using your nostr private key as the password. Experimental code, use

Rust/Axum server implementation with PCR(Prisma Client Rust)
Rust/Axum server implementation with PCR(Prisma Client Rust)

Realworld Rust Axum Prisma This project utilizes Rust with the Axum v0.7 framework along with the Prisma Client Rust to build a realworld application.

Coinbase pro client for Rust

Coinbase pro client for Rust Supports SYNC/ASYNC/Websocket-feed data support Features private and public API sync and async support websocket-feed sup

Rust Ethereum 2.0 Client
Rust Ethereum 2.0 Client

Lighthouse: Ethereum 2.0 An open-source Ethereum 2.0 client, written in Rust and maintained by Sigma Prime. Documentation Overview Lighthouse is: Read

rust client libraries to deal with the current cardano mainnet (byron / cardano-sl)

Rust implementation of Cardano primitives, helpers, and related applications Cardano Rust is a modular toolbox of Cardano’s cryptographic primitives,

A client and server implementation of the OPC UA specification written in Rust

Introduction This is an OPC UA server / client API implementation for Rust. Linux Windows OPC UA is an industry standard for monitoring of data. It's

memcache client for rust
memcache client for rust

rust-memcache rust-memcache is a memcached client written in pure rust. Install The crate is called memcache and you can depend on it via cargo: [depe

Cassandra DB native client written in Rust language. Find 1.x versions on https://github.com/AlexPikalov/cdrs/tree/v.1.x Looking for an async version? - Check WIP https://github.com/AlexPikalov/cdrs-async
Cassandra DB native client written in Rust language. Find 1.x versions on https://github.com/AlexPikalov/cdrs/tree/v.1.x Looking for an async version? - Check WIP https://github.com/AlexPikalov/cdrs-async

CDRS CDRS is looking for maintainers CDRS is Apache Cassandra driver written in pure Rust. 💡 Looking for an async version? async-std https://github.c

CouchDB client-side library for the Rust programming language

Chill Chill is a client-side CouchDB library for the Rust programming language, available on crates.io. It targets Rust Stable. Chill's three chief de

A Rust client for the ElasticSearch REST API

rs-es Introduction An ElasticSearch client for Rust via the REST API. Targetting ElasticSearch 2.0 and higher. Other clients For later versions of Ela

An Elasticsearch REST API client for Rust

elastic elastic is an efficient, modular API client for Elasticsearch written in Rust. The API is targeting the Elastic Stack 7.x. elastic provides st

An etcd client library for Rust.

etcd An etcd client library for Rust. etcd on crates.io Documentation for the latest crates.io release Running the tests Install Docker and Docker Com

Mysql client library implemented in rust.

mysql This crate offers: MySql database driver in pure rust; connection pool. Features: macOS, Windows and Linux support; TLS support via nativetls cr

Comments
  • Consider using AsRef for public APIs

    Consider using AsRef for public APIs

    When accepting references to stringy types, it can be useful to accept a generic S: AsRef<T> where T is the target stringy type (e.g., str). For example:

    fn my_fn<S: AsRef<str>>(my_name: S) {
        let my_name: &str = my_name.as_ref();
        println!("{}", my_name);
    }
    

    Can be called with owned Strings, &strs, or any other custom string-like type that implements AsRef<str>.

    opened by Stebalien 4
  • Prefer using string slices over owned Strings

    Prefer using string slices over owned Strings

    The API often asks for owned String objects when a string slice (&str) would suffice. Accepting string slices will significantly reduce allocations.

    opened by Stebalien 1
  • Derive Debug for enums, convert Display impl to Debug impl

    Derive Debug for enums, convert Display impl to Debug impl

    All types should derive Debug. Furthermore, Display is meant for things that should be displayed to the end user, and a library like this isn't supposed to decide that. Using Debug makes more sense.

    opened by gsingh93 0
  • Current master (c18674aafa7af437fa66ffdb634b9b2c2b08862a) fails to build

    Current master (c18674aafa7af437fa66ffdb634b9b2c2b08862a) fails to build

    error[E0433]: failed to resolve. Use of undeclared type or module `ssl`
      --> atarashii_imap/src/lib.rs:68:12
       |
    68 |   StartTls(ssl::SslStream<TcpStream>),
       |            ^^^^^^^^^^^^^^^^^^^^^^^^^ Use of undeclared type or module `ssl`
    
    error[E0433]: failed to resolve. Use of undeclared type or module `ssl`
      --> atarashii_imap/src/lib.rs:69:10
       |
    69 |   SslTls(ssl::SslStream<TcpStream>)
       |          ^^^^^^^^^^^^^^^^^^^^^^^^^ Use of undeclared type or module `ssl`
    
    error[E0433]: failed to resolve. Use of undeclared type or module `TslConnectorBuilder`
       --> atarashii_imap/src/lib.rs:234:25
        |
    234 |         let connector = TslConnectorBuilder::new(SslMethod::tls()).unwrap().build();
        |                         ^^^^^^^^^^^^^^^^^^^^^^^^ Use of undeclared type or module `TslConnectorBuilder`
    
    error[E0433]: failed to resolve. Use of undeclared type or module `SslMethod`
       --> atarashii_imap/src/lib.rs:234:50
        |
    234 |         let connector = TslConnectorBuilder::new(SslMethod::tls()).unwrap().build();
        |                                                  ^^^^^^^^^^^^^^ Use of undeclared type or module `SslMethod`
    
    error[E0433]: failed to resolve. Use of undeclared type or module `ssl`
       --> atarashii_imap/src/lib.rs:248:38
        |
    248 |   fn verify_greeting(stcp_conn: &mut ssl::SslStream<TcpStream>) -> () {
        |                                      ^^^^^^^^^^^^^^^^^^^^^^^^^ Use of undeclared type or module `ssl`
    
    error: aborting due to previous error(s)
    
    error: Could not compile `atarashii_imap`.
    
    
    opened by omern1 1
Owner
Alex Maslakov
I help people, dogs and parrots create custom software. I swim in the oceans of web, ecommerce, security, cryptocurrencies, machine learning and marketing
Alex Maslakov
Unofficial Rust library for the SendGrid API

sendgrid-rs Unofficial Rust library for the SendGrid API. This crate requires Rust 1.15 or higher as it uses a crate that has a custom derive implemen

Garrett Squire 88 Dec 27, 2022
a mailer library for Rust

lettre A mailer library for Rust NOTE: this readme refers to the 0.10 version of lettre, which is still being worked on. The master branch and the alp

lettre 1.3k Jan 4, 2023
Rust library to parse mail files

mailparse A simple parser for MIME email messages. API The primary entry point for this library is the following function: parse_mail(&[u8]) -> Re

Kartikaya Gupta (kats) 150 Dec 27, 2022
Implementation of mjml in rust

MRML Introduction This project is a reimplementation of the nice MJML markup language in Rust. How to use it use mrml; fn main() { match mrml::to

Jérémie Drouet 228 Dec 28, 2022
Rust implementation of catapulte email sender

Catapulte What is catapulte? Catapulte is an open source mailer you can host yourself. You can use it to quickly catapult your transactionnal emails t

Jérémie Drouet 108 Dec 14, 2022
Check if an email address exists without sending any email, written in Rust.

Check if an email address exists without sending any email, written in Rust.

Reacher 3.5k Dec 31, 2022
Fast and robust e-mail parsing library for Rust

mail-parser mail-parser is an e-mail parsing library written in Rust that fully conforms to the Internet Message Format standard (RFC 5322), the Multi

Stalwart Labs 158 Jan 1, 2023
mail-builder is a flexible e-mail builder library written in Rust that generates RFC5322 compliant e-mail messages

mail-builder mail-builder is a flexible e-mail builder library written in Rust that generates RFC5322 compliant e-mail messages. The library has full

Stalwart Labs 37 Dec 19, 2022
A mail suite written in rust meant to be easy to use.

Erooster A mail suite written in rust meant to be easy to use. Getting started Currently the setup is quite rough. You need some certificates for your

Marcel 33 Dec 19, 2022
A rewrite of the server side parts of emersion/go-smtp package into rust.

rust-smtp-server A rust smtp server library. It's mainly a rewrite of the server side parts of the emersion/go-smtp library. Features Usage Add this t

Nick Westendorf 3 Apr 26, 2023