-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -121,4 +121,24 @@ POSTFIX_SERVER=postfix | |
DISABLE_ONBOARDING=true | ||
NAMESERVERS="1.1.1.1" | ||
DISABLE_REGISTRATION=0 | ||
``` | ||
## Self Test | ||
Create `test` aliases for each domain and disable them so you won't get emails. | ||
Add the following to your host's cron, edit the targets and curl command accordingly. | ||
```bash | ||
#!/bin/bash | ||
TARGETS=("[email protected]" "[email protected]" "[email protected]") | ||
for TARGET in "${TARGETS[@]}"; do | ||
docker exec postfix sendmail $TARGET | ||
sleep 10 | ||
result=$(docker exec sldb psql -U sl_user simplelogin -AXqtc "SELECT COUNT(*) FROM email_log JOIN alias ON email_log.alias_id = alias.id WHERE alias.email = '$TARGET' AND email_log.created_at BETWEEN NOW() - INTERVAL '5 MINUTES' AND NOW();") | ||
if [[ "$result" -lt 1 ]]; then | ||
curl -d "Email test failed for $TARGET" "https://ntfy.domain1.com/topic" | ||
fi | ||
done | ||
``` |