I got my nagios server banned by fail2ban because of errors in the postfix mail.log log. I know that I can simply whitelist the nagios server but I prefer it working perfectly.
Checking the logs I could see this error repeating itself on each check:
Mar 25 13:01:13 xxx-123 postfix/smtpd: connect from nagios.example.com[184.108.40.206]
Mar 25 13:01:13 xxx-123 postfix/smtpd: improper command pipelining after QUIT from nagios.example.com[220.127.116.11]:
Mar 25 13:01:13 xxx-123 postfix/smtpd: disconnect from nagios.example.com[18.104.22.168]
Apparently postfix is picky about having extra input after a QUIT or DATA command, see details here.
It turns out that I haven’t updated nagios plugins in a while. Even if I kept nagios up-to-date the plugins were at 2.0.3. Updating to 2.1.1 fixed the issue and now I simply see a connect/disconnect in the postfix logs when nagios performs a check.