- Rust
- git
- A local SMTP relay or testing tool, like Mailpit
- pre-commit
- cargo-deny (It may be faster to install with
cargo binstall
cargo-deny
)
-
Clone the repository:
git clone https://github.com/metabrainz/mb-mail-service.git cd mb-mail-service
-
Install pre-commit hooks:
pre-commit install
cargo run
To send mail to your local SMTP relay, first start it, and then tell the service which port it is running on with an environment variable:
SMTP_PORT="1025" cargo run
- Install systemfd
- Install cargo-watch
- Run
systemfd --no-pid -s http::3000 -- cargo watch -x run
Logs are controlled through the RUST_LOG
environment variable using Tracing's Directives syntax.
For example:
APP_SMTP_PORT="1025" RUST_LOG="trace,html5ever=warn,lettre::transport::smtp::client::async_connection=warn,runtime=warn,tokio::task=warn" systemfd --no-pid -s http::3000 -- cargo watch -x run
cargo test
Commits in this repository follow Conventional Commits on a best-effort basis. This is automatically enforced by pre-commit hooks. For examples, please look at the commit history of the repository.