https://github.com/iroco-co/mailtempest
Email smtp/imap load injector based on tokio
https://github.com/iroco-co/mailtempest
benchmark email-injection imap rust-lang smtp
Last synced: 3 months ago
JSON representation
Email smtp/imap load injector based on tokio
- Host: GitHub
- URL: https://github.com/iroco-co/mailtempest
- Owner: iroco-co
- License: mit
- Created: 2023-08-31T06:49:21.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-14T22:26:19.000Z (almost 2 years ago)
- Last Synced: 2023-09-15T04:47:18.269Z (almost 2 years ago)
- Topics: benchmark, email-injection, imap, rust-lang, smtp
- Language: Rust
- Homepage:
- Size: 144 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mailtempest [](https://dl.circleci.com/status-badge/redirect/gh/iroco-co/mailtempest/tree/main)
> If we can’t face it, we can’t escape it
> But tonight the storm’s come
> -- Kae Tempest - Tunnel VisionThis is a mail injector based on tokio and [Stalwart Labs](https://github.com/stalwartlabs) mail libraries.
For IMAP it's using [async_imap](https://github.com/async-email/async-imap).
It is intended to bench your mail servers and your mail server settings.
# How does it work?

```shell
mailtempest 0.1.0
Mail injector to generate SMTP/IMAP load to a mail platformUSAGE:
mailtempest [FLAGS] [OPTIONS] [imap-host]FLAGS:
-f, --fixed-pace there is no random delay between messages. The delay is always pace_seconds
-h, --help Prints help information
--prepare utility prepare command. It will use the CSV file to replace all the email addresses in the
files located in mail directory and rewrite them with .mt extension
-V, --version Prints version informationOPTIONS:
--mail-dir directory where the mails are going to be read [default: ./mails]
--pace-seconds average pace of injection in second for pace maker (float) [default: 1.0]
--users-csv CSV file where users login/password can be loaded [default: ./users.csv]
--workers number of workers [default: 1]ARGS:
host of the SMTP server
host of the IMAP server. If not provided, only SMTP load will be injected
```If you want [logs](https://docs.rs/env_logger/latest/env_logger/) you can use the env variable `RUST_LOG`:
```shell
RUST_LOG=info mailtempest smtp.host imap.host
```## For SMTP inbound mail
It reads mail samples from a directory and randomly send them to the configured SMTP url.
It is multithreaded and will send mails concurrently with `workers` threads (=number of mail users for now).
It sends them with an average of `worker_pace` seconds. It can be set to 0 to continuously send mails.
## For IMAP reading
IMAP clients are run if the imap host is provided.
Clients are logging in at launch. Then the INBOX is selected.
The loop is using [IMAP IDLE](https://en.wikipedia.org/wiki/IMAP_IDLE). Each time an email is received it is fetched.