Improved spamcheck and thereby donaspam and adspam

This commit is contained in:
2026-04-15 13:31:27 +02:00
parent a1046bda79
commit de44af64b4
4 changed files with 54 additions and 56 deletions
+7 -13
View File
@@ -18,18 +18,6 @@ tba.
```bash
spamcheck
Anzahl S3150: 0
Anzahl S775: 0
Anzahl S7771: 0
Anzahl S7772: 0
Anzahl S7773: 0
Anzahl S7774: 0
Anzahl S7775: 0
Anzahl S7776: 0
Anzahl S7777: 0
Anzahl S7778: 0
Anzahl S7779: 0
Anzahl Spamhaus: 0
```
## Syntax
@@ -42,7 +30,13 @@ spamcheck
```bash
# random Plesk-Server
spamcheck
eign01_easyname.at@ws25 ~ $ spamcheck
=== ws25.inname.net Spamcheck ===
✅ All systems green.
eign01_easyname.at@ws26 ~ $ spamcheck
=== ws26.inname.net Spamcheck ===
❌ Anzahl S3150: 24
```
## Troubleshooting
+9 -2
View File
@@ -3,11 +3,18 @@
# Maintainer: peignerpausz
printf '=== %s Spamcheck === \n' "$(hostname)"
found_errors=0
for a in S3150 S775 S7771 S7772 S7773 S7774 S7775 S7776 S7777 S7778 S7779 Spamhaus
do
count=$(sudo grep -c "\($a\)" /var/log/maillog 2>/dev/null)
count=${count//$'\r'/}
count=${count//[^0-9]/}
count=${count:-0}
if [ "$count" -gt 0 ]; then
printf "|=> Anzahl %s: %s\n" "$a" "$count"
printf "❌ Anzahl %s: %s\n" "$a" "$count"
found_errors=1
fi
done
printf '=== %s Spamcheck done === \n' "$(hostname)"
if [ "$found_errors" -eq 0 ]; then
printf "✅ All systems green.\n"
fi