Notifications
Daniel's Disk Tester sends alert mails via SMTP. The mail server is configured with environment variables, recipients and alert switches in the web interface.
Mail server (environment variables)
The mail server is set in /appdata/disk-tester/disk-tester.env (mode 600; install.sh creates a commented-out template):
SMTP_HOST=smtp.example.org
SMTP_PORT=587
SMTP_SECURE=false
SMTP_USER=user
SMTP_PASSWORD=secret
SMTP_FROM=disk-tester@example.org
| Variable | Meaning |
|---|---|
SMTP_HOST | Mail server. Empty = no mails. |
SMTP_PORT | Port, default 587. |
SMTP_SECURE | true = TLS from the start of the connection (port 465), otherwise STARTTLS or unencrypted. |
SMTP_USER / SMTP_PASSWORD | Login, if the server requires one. |
SMTP_FROM | Sender address. Without it, SMTP_USER is used. |
SMTP_TO | Optional: recipients that are copied into the settings on first start. |
Then systemctl restart disk-tester. The SMTP password is never shown in the interface or stored in the settings.
Mailpit is handy for testing: SMTP on port 1025 (no TLS/login), web interface and API on port 8025 (http://<host>:8025/api/v1/messages).
Recipients and switches (interface)
Under Settings the status of the mail server is shown (configured or not) and the following is maintained:
- Recipients: Separate multiple addresses with commas.
- Email notifications enabled: Main switch.
- Individual switches: drive connected, drive removed, test finished, test failed, SMART problem detected, temperature limit exceeded.
- Temperature limit (°C): A warning is raised above this value. The mail is only sent when the limit is crossed, not on every poll.
Alert mails are also sent for critical SMART values and failed tests/runs. Counters accepted as a baseline (see Usage) trigger no mail, but a rise above the baseline does. After a restart of the service, the drives found in the first scan do not count as new, so there is no mail per drive on every restart. There is also an "auto-scheduled" mail when auto mode schedules a destructive plan. Subject and text of the mails follow the language in the settings. For erase operations, job mails state the method, passes and the result of the verification.
Test mail
Send test mail sends a mail to the stored recipients, regardless of the switches. The test mail uses the stored values, so save changes first. If sending fails, the mail server's error message is shown.