📫 Himalaya lib

Rust library for email management.

```rust let accountconfig = AccountConfig { email: "test@localhost".into(), displayname: Some("Test".into()), emailsender: EmailSender::Internal(SmtpConfig { host: "localhost".into(), port: 587, starttls: Some(true), login: "login".into(), passwdcmd: "echo password".into(), ..Default::default() }), ..Default::default() };

let imapconfig = ImapConfig { host: "localhost".into(), port: 993, starttls: Some(true), login: "login".into(), passwdcmd: "echo password".into(), ..Default::default() }; let backendconfig = BackendConfig::Imap(&imapconfig);

let mut backend = BackendBuilder::new().build(&accountconfig, &backendconfig).unwrap(); backend.listenvelopes("INBOX", 10, 0).unwrap(); backend.moveemail("INBOX", "Archives", "21").unwrap(); backend.delete_email("INBOX", "42").unwrap();

let mut sender = SenderBuilder::build(&accountconfig).unwrap(); let email = Email::from("To: test2@localhost\r\nSubject: Hello\r\n\r\nContent"); sender.send(&accountconfig, &email).unwrap(); ```

The project is under active development. Do not use in production before the v1.0.0.

Introduction

The role of this library is to extract and expose an API for managing emails. This way, you can build clients that match the best your workflow without reiventing the wheel. Here the list of available clients built by the community:

Features

Development

The development environment is managed by Nix. Running nix-shell will spawn a shell with everything you need to get started with the lib: cargo, cargo-watch, rust-bin, rust-analyzer, notmuch…

```shell-session

Starts a Nix shell

$ nix-shell

then builds the lib

$ cargo build ```

Testing

Before running the test suite you need to spawn an IMAP server. Here an example with docker and greenmail:

```shell-session $ docker run -it --rm \ -p 3025:3025 -p 3110:3110 -p 3143:3143 -p 3465:3465 -p 3993:3993 -p 3995:3995 \ -e GREENMAIL_OPTS='-Dgreenmail.setup.test.all -Dgreenmail.hostname=0.0.0.0 -Dgreenmail.auth.disabled -Dgreenmail.verbose' \ greenmail/standalone:1.6.2

$ cargo test ```

Contributing

If you find a bug, please send an email at ~soywod/pimalaya@todo.sr.ht.

If you have a question, please send an email at ~soywod/pimalaya@lists.sr.ht.

If you want to propose a feature or fix a bug, please send a patch at ~soywod/pimalaya@lists.sr.ht using git send-email (see this guide on how to configure it).

If you want to subscribe to the mailing list, please send an email at ~soywod/pimalaya+subscribe@lists.sr.ht.

If you want to unsubscribe to the mailing list, please send an email at ~soywod/pimalaya+unsubscribe@lists.sr.ht.

If you want to discuss about the project, feel free to join the Matrix workspace #pimalaya or contact me directly @soywod.

Credits

nlnet

Special thanks to the nlnet foundation that helped Himalaya to receive financial support from the NGI Assure program of the European Commission in September, 2022.

Sponsoring

GitHub PayPal Ko-fi Buy Me a Coffee Liberapay