Hallo zusammen,

Ich habe ein Script geschrieben "filter_postfix_SASL_fail_dmn.sh" welches mich über fehlerhafte Logins informieren soll:
Code:
#!/bin/sh
# Postfix SASL fail

tail -fn0 /var/log/maillog | while read line ; do
stamp=`grep "SASL PLAIN authentication failed" /var/log/maillog | tail -n 1 | cut -d ' ' -f 1-3`
ip=`grep "SASL PLAIN authentication failed" /var/log/maillog | tail -n 1 | cut -d '[' -f 3 | cut -d ']' -f 1`

mail -s "Postfix SASL failed" user@domain.com <<< "Date: $stamp
    IP: $ip
    ";
done

Um das Script zu starten, habe ich unter Centos 7.8 einen systemd service "maillogmon.service" angelegt:
Code:
[Unit]
Description=Mail Log Monitor SASL fail logins
After=network.target

[Service]
Type=simple
ExecStart=/bin/bash /usr/local/bin/filter_postfix_SASL_fail_dmn.sh
TimeoutStartSec=0
Restart=always
StartLimitInterval=0

[Install]
WantedBy=default.target

in /var/log/maillog sehe ich nun folgende wiederkehrende Logeinträge:
Code:
Sep 16 09:00:16 farm11 bash: tail: write error: Broken pipe
Sep 16 09:00:16 farm11 bash: tail: write error
Sep 16 09:00:16 farm11 systemd: maillogmon.service holdoff time over, scheduling restart.
Sep 16 09:00:16 farm11 systemd: Stopped Mail Log Monitor SASL fail logins.
Sep 16 09:00:16 farm11 systemd: Started Mail Log Monitor SASL fail logins.

Warum ist das so und wie kann ich das vermeiden?
Grundlegend funktioniert das Script aber die permanenten Neustarts sind nicht in Ordnung.
Statt bei tail die Option -F statt -f zu verwenden, hat auch nix gebracht.

lg Frank