A mail suite written in rust meant to be easy to use.

Last update: Jun 10, 2022

Erooster

codecov Contributor Covenant

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 server (pem format) and a postgres database.

To get started you need a config.yml like this it can either be in /etc/erooster or the working dir:

tls:
  key_path: "./certs/key.pem"
  cert_path: "./certs/cert.pem"
mail:
  maildir_folders: "./maildir"
  hostname: "localhost"
database:
  postgres_url: ""
listen_ips:
  - "[::1]"
  - "127.0.0.1"
webserver:
  port: "80"
  tls: false
  displayname: Erooster
sentry: false

The maildir_folders defines where the emails and folders can be found at. This is close to the maildir format postfix uses. (We use other files to keep track of the state of it)

After that you can just do cargo run --release to run it. The server is reachable via the usual IMAP ports. STARTTLS is currently not supported.

Setting up users

To set up users you can use the eroosterctl command. It will talk to the database. So make sure your config file is set up.

To register a user you simply run eroosterctl register and follow the questions. The password is safed as an argon2 hash inside the database.

To change a password there is the change-password subcommand. You need to provide the old password and the new one. It is planned that admins can also change this using a preencrypted password instead. In the future this is going to be replaced by an integrated web interface users can directly use.

Note: The status subcommand at this time doesn't actually check the server status.

Features

  • Imap4rev2 compatible
  • Maildir support
  • TLS by default
  • Single binary
  • Low Resource usage
  • Postgres first
  • Integrated SMTP server

Non Goal

  • Implementing every single peace of optional spec
  • MySQL/Mariadb support
  • Support for imap LOGIN command (It is per rev2 spec)
  • Support for POP3
  • Support for Exchange

Error Reporting

Erosster by default does not auto report an panics or errors. It provides however a github reporting link on panics.

Additionally it is able to let ou auto report to a sentry. This also will record performance using tracing. Due to how sentry works this is not public. It is disabled by default due to gdpr rules.

To enable sentry please set sentry: true in yout config file.

Comparisons

As I made a reddit post some comparisons were made in the commands. You can check them out at https://www.reddit.com/r/rust/comments/uyxxrg/comment/ia7qwcg/?utm_source=share&utm_medium=web2x&context=3

GitHub

https://github.com/MTRNord/erooster
Comments
  • 1. panic: Failed to parse fetch arguments: "Parsing Error: VerboseError { errors: [(\".PEEK[HEADER.FIELDS (...

    We seem to not yet correctly parse the args for fetch:

    Sentry Issue: EROOSTER-2

    panic: Failed to parse fetch arguments: "Parsing Error: VerboseError { errors: [(\".PEEK[HEADER.FIELDS (From To Cc Bcc Subject Date Message-ID Priority X-Priority References Newsgroups In-Reply-To Content-Type Reply-To x-spamd-result x-spam-score x-rspamd-score x-spam-status x-mailscanner-spamcheck X-Spam-Flag x-spam-level)])\", Char(')')), (\"(UID RFC822.SIZE FLAGS BODY.PEEK[HEADER.FIELDS (From To Cc Bcc Subject Date Message-ID Priority X-Priority References Newsgroups In-Reply-To Content-Type Reply-To x-spamd-result x-spam-score x-rspamd-score x-spam-status x-mailscanner-spamcheck X-Spam-Flag x-spam-level)])\", Context(\"fetch_arguments\"))] }"
      File "panicking.rs", line 584, in rust_begin_unwind
      ?, in erooster::imap_commands::uid::Uid::exec::{{closure}}
      ?, in erooster::imap_commands::Data::parse::{{closure}}
      ?, in tokio::runtime::task::core::CoreStage<T>::poll
      ?, in tokio::runtime::task::harness::poll_future
    ...
    (21 additional frame(s) were not displayed)
    
    Reviewed by sentry-io[bot] at 2022-05-31 11:51
  • 2. Abstract the mail storage to later allow multiple backends

    Currently, this is maildir only.

    We can provide a trait for example to abstract this in the future if someone wants to use some other backend for their mail.

    Reviewed by MTRNord at 2022-05-28 10:53
  • 3. We strip the suffix dot incorrect

    In https://github.com/MTRNord/erooster/blob/main/src/smtp_servers/sending.rs#L316

    The none case means we had no suffix. So we need to just return the string in that case instead of omitting it.

    Reviewed by MTRNord at 2022-06-01 14:42
  • 4. We seem to do TLS on sending not quite right yet

    Sentry Issue: EROOSTER-7

    [a0e520ad-5ed6-4d35-94f9-bf7ad861a4e9] Error sending email via tls on port 465: invalid peer certificate contents: invalid peer certificate: CertNotValidForName
    
    Reviewed by sentry-io[bot] at 2022-05-31 21:17
  • 5. Provide fail2ban jail setup

    It shouldn't be too hard to make logs and a jail for fail2ban :) It seems this currently attracts a lot of fuzzers and attackers. Banning them would be quite nice. In the future an integration with rspamd would be nice as well.

    Reviewed by MTRNord at 2022-06-26 19:01
  • 6. RUSTSEC-2020-0071: Potential segfault in the time crate

    Potential segfault in the time crate

    | Details | | | ------------------- | ---------------------------------------------- | | Package | time | | Version | 0.1.43 | | URL | https://github.com/time-rs/time/issues/293 | | Date | 2020-11-18 | | Patched versions | >=0.2.23 | | Unaffected versions | =0.2.0,=0.2.1,=0.2.2,=0.2.3,=0.2.4,=0.2.5,=0.2.6 |

    Impact

    Unix-like operating systems may segfault due to dereferencing a dangling pointer in specific circumstances. This requires an environment variable to be set in a different thread than the affected functions. This may occur without the user's knowledge, notably in a third-party library.

    The affected functions from time 0.2.7 through 0.2.22 are:

    • time::UtcOffset::local_offset_at
    • time::UtcOffset::try_local_offset_at
    • time::UtcOffset::current_local_offset
    • time::UtcOffset::try_current_local_offset
    • time::OffsetDateTime::now_local
    • time::OffsetDateTime::try_now_local

    The affected functions in time 0.1 (all versions) are:

    • at
    • at_utc
    • now

    Non-Unix targets (including Windows and wasm) are unaffected.

    Patches

    Pending a proper fix, the internal method that determines the local offset has been modified to always return None on the affected operating systems. This has the effect of returning an Err on the try_* methods and UTC on the non-try_* methods.

    Users and library authors with time in their dependency tree should perform cargo update, which will pull in the updated, unaffected code.

    Users of time 0.1 do not have a patch and should upgrade to an unaffected version: time 0.2.23 or greater or the 0.3 series.

    Workarounds

    No workarounds are known.

    References

    time-rs/time#293

    See advisory page for additional details.

    Reviewed by github-actions[bot] at 2022-06-03 01:50
  • 7. [Tracking] Client and provider support

    Email clients that are known fully working

    • None

    Email clients known to be able to send emails

    • k9mail
    • thunderbird

    Email clients known to display messages

    • thunderbird

    Software or providers that (tend to) accept our emails

    • Google (sometimes marked as spam due to missing dkim though)
    • postfix with rspamd and postscreen
    • onsite Exchange seems to work (sample set of 1 test both directions)
    Reviewed by MTRNord at 2022-06-01 16:18
  • 8. Smtp sending tracking issue

    Known todos:

    • [x] #12
    • [x] #13
    • [x] Make sure we don't crash the job if only one of the servers didn't like our email.
    • [x] dmarc (This is more something for the web interface to generate. I added it to my test setup now)
    • [x] spf (This is more something for the web interface to generate. I added it to my test setup now)
    • [ ] dane
    • [ ] dkim
    • [ ] arc
    • [ ] Notify the user about the messages' status, similar to how postfix does
    • [x] Fix parser: Failed to parse fetch arguments: "Parsing Error: VerboseError { errors: [(\" RFC822.HEADER FLAGS)\", Char(')')), (\"(UID RFC822.SIZE RFC822.HEADER FLAGS)\", Context(\"fetch_arguments\"))] }" request was (UID RFC822.SIZE RFC822.HEADER FLAGS) (Turns out we got deprecated requests)

    And likely more...

    Reviewed by MTRNord at 2022-05-30 12:09
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

May 24, 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

Jun 15, 2022
Mjml - the only framework that makes responsive-email easy
Mjml - the only framework that makes responsive-email easy

MJML 4 If you're looking for MJML 3.3.X check this branch | Translated documentation | Introduction | Installation | Usage | Translated documentation

Jun 19, 2022
📫Himalaya: CLI email client written in Rust.
📫Himalaya: CLI email client written in Rust.

??Himalaya: CLI email client written in Rust.

Jun 22, 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.

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

Jun 22, 2022
新しい IMAP client in Rust

新しい IMAP client 新しい (atarashii/new) IMAP client in Rust. It supports plain and secure connections. In progress It's under development... Usage Put thi

Sep 13, 2020
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

May 21, 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

Jun 17, 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

Jun 8, 2022
Rust implementation of catapulte email sender
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

Jun 7, 2022
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

Jun 19, 2022
A command line interface meant to bridge the gap between Rust and shell scripting

clawbang A command line interface meant to bridge the gap between Rust and shell scripting. Intended for use with HEREDOCs and shebangs: $ clawbang <<

Mar 25, 2022
Simple library to host lv2 plugins. Is not meant to support any kind of GUI.

lv2-host-minimal Simple library to host lv2 plugins. Is not meant to support any kind of GUI. Host fx plugins (audio in, audio out) Set parameters Hos

Mar 21, 2022
A static mail HTML archive for the 21st century, written in Rust

?? Crabmail ?? self-hosted / github mirror A static mail HTML archive for the 21st century, written in Rust. Includes helpful "modern" features that e

Jun 22, 2022
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

May 24, 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

Jun 15, 2022
Coppers is a custom test harnass for Rust that measures the energy usage of your test suite.
Coppers is a custom test harnass for Rust that measures the energy usage of your test suite.

Coppers Coppers is a test harness for Rust that can measure the evolution of power consumptions of a Rust program between different versions with the

Jun 10, 2022
An NLP-suite powered by deep learning
An NLP-suite powered by deep learning

DeepFrog - NLP Suite Introduction DeepFrog aims to be a (partial) successor of the Dutch-NLP suite Frog. Whereas the various NLP modules in Frog wre b

Feb 28, 2022
Hidden parameters discovery suite

x8 Hidden parameters discovery suite written in Rust. How does it work Features Examples Send parameters via query Send parameters via body Custom tem

Jun 17, 2022
Terra development suite

rover Terra development suite Planned features Usage Commands Planned features Includes a starter smart contract, can be cw-template or similar. Has a

Nov 9, 2021