带有 IMAP 客户端的轻量级独立 DMARC 和 SMTP TLS 报告查看器
A lightweight standalone DMARC and SMTP TLS report viewer. Ideal for smaller selfhosted mailservers to browse, visualize and analyze the reports.
The application is a single fully statically linked executable written in Rust. It combines a report parser with an IMAP client and an HTTP server. The embedded HTTP server offers a web UI for easy access and filtering of the reports.
You can run the precompiled executable directly on any Linux, Windows or MacOS system. Alternatively, you can use the tiny 10 MB Docker image to deploy the application. It is also easy to build the application directly from source.
You can find more screenshots here.
Read the CHANGELOG.md file for a list of all released versions and their corresponding changes.
The latest versions are automatically published as Docker images in the GitHub container registry.
You can download the latest release using the command sudo docker pull ghcr.io/cry-inc/dmarc-report-viewer.
Alternatively, you can also pull from Docker Hub: sudo docker pull cryinc/dmarc-report-viewer.
The following tags are available (aside from the versioned tag for all individual releases):
latest (Latest stable release)develop (Last development build from master branch)List all available configuration parameters with the corresponding environment variables and default values by running this command:
sudo docker run --rm ghcr.io/cry-inc/dmarc-report-viewer ./dmarc-report-viewer --help.
You can configure the application with command line arguments or environment variables. For the Docker use case, environment variables are recommended. Do not forget to forward the port for the HTTP server! By default the HTTP server will use port 8080.
Here is an example:
sudo docker run --rm \
-e IMAP_HOST=imap.mymailserver.com \
-e [email protected] \
-e IMAP_PASSWORD=mysecurepassword \
-e HTTP_SERVER_USER=webui-user \
-e HTTP_SERVER_PASSWORD=webui-password \
-p 8080:8080 \
ghcr.io/cry-inc/dmarc-report-viewerThis application does not store any reports in a database or in any other kind of file. All data is kept in memory and retrieved each time fresh from the configured IMAP account. The only exception is the certificate cache folder when using Let's Encrypt, this folder should be persisted and saved between application restarts.
By default, a single INBOX folder is used to look for all supported report types.
You can change this to any other folder by specifying the ENV variable IMAP_FOLDER.
To enable the search of one or more levels of sub-folders, use the setting IMAP_FOLDER_DEPTH.
Its also possible to specify separate dedicated IMAP folders for each different report type.
Use the ENV variables IMAP_FOLDER_DMARC or IMAP_FOLDER_TLS to use this feature.
Warning: As soon as you set one of the dedicated folders, the default folder will be ignored!
TLS reports in the DMARC folder and vice versa will lead to warnings because of unexpected errors.
Please note that fetching reports from different IMAP accounts is currently not supported. You might have to setup some forwarding if you are receiving them on separate accounts.
By default the IMAP client will attempt to use a TLS encrypted connection using port 993.
For STARTTLS set the ENV variables IMAP_STARTTLS=true and IMAP_PORT=143.
By default, the application will start an unencrypted and unsecure HTTP server. It is strongly recommended use the automatic HTTPS feature that will automatically fetch and renew a certificate from Let's Encrypt. This feature uses the TLS-ALPN-01 challenge, which uses the HTTPS port 443 also for the challenge. No port 80 required! Alternatively, you can use an separate HTTPS reverse proxy like Caddy to secure the application. The application works also when being served via reverse-proxy on a non-root folder!
To use the included HTTPS feature you need to make sure that the public port exposed to the internet is 443. You should also persist the certificate caching directory on your host file system:
sudo docker run --rm \
-e IMAP_HOST=imap.mymailserver.com \
-e [email protected] \
-e IMAP_PASSWORD=mysecurepassword \
-e HTTP_SERVER_PORT=8443 \
-e HTTP_SERVER_USER=webui-user \
-e HTTP_SERVER_PASSWORD=webui-password \
-e HTTPS_AUTO_CERT=true \
-e HTTPS_AUTO_CERT_CACHE=/certs \
-e [email protected] \
-e HTTPS_AUTO_CERT_DOMAIN=dmarc.mymailserver.com \
-v /host/cert/folder:/certs \
-p 443:8443 \
ghcr.io/cry-inc/dmarc-report-viewerBy default the HTTP server will bind to any IPv4 address of the machine.
This is because the default bind setting is 0.0.0.0.
You can use the configuration option --http-server-binding [::] or ENV variable HTTP_SERVER_BINDING=[::] for IPv6.
Note that on Linux this will bind to both, IPv4 and IPv6 by default.
By default the application requires you to set an password to secure access via basic HTTP authentication. If you want to use other access controls (e.g. via reverse proxy), you can disable basic authentication by setting an empty string as password.
The service provides an health check endpoint at /health that always returns an empty HTTP 200 OK response.
The Docker image also contains a HEALTHCHECK statement and allows containers to check themselves.
The health check works by executing the binary in a special mode by providing the --health-check argument.
It will then try to get the HTTP/HTTPS configuration from the ENV vars to build an URL to query the health check endpoint.
If you have an exotic network setup this might fail and you need to override or disable the health check.
Feel free to create an issue in this case!
Microsoft does not allow simple password-based authentication. If you receive your DMARC or SMTP TLS reports via MS mail address, you will not be able to use this tool directly, since it only supports password-based authentication.
But you can use other software like DavMail to create an local IMAP proxy that takes care of the authentication and provides an IMAP with password-based access. You can find more information and an example configuration here.
cargo build --release in the folder with this README filetarget/releasedmarc-report-viewer --helpThe Dockerfile works for amd64 and arm64 architectures.
sudo docker build . --pull --tag dmarc-report-viewer in the folder with this README filesudo docker imagesYou only need git and the Rust toolchain to work on this project. No JavaScript tooling like Node, NPM or a bundler is required for the UI. The UI code has all dependencies included and does not need any build steps.
When running debug builds, the UI files can be reloaded from your checkout. This means you can iterate on the UI without rebuilding the Rust backend every time! This does not work for release builds where the UI load the files directly from the binary.
Please create an issue before creating a PR for a bigger feature, so we can discuss your idea. I might decline some contributions because I want to keep the scope as small as possible.
Once you are ready to create a PR, please do the following:
cargo fmt).cargo clippy --all --all-targets --all-features).cargo test).The PR validation pipeline will also run the commands and fails if there are any issues.
暂无开放 Issues,或尚未同步最近议题。