how to send mail with fail2ban using postfix
in /etc/fail2ban/action.d/ I copied and renamed this files by changing all the sendmail to postfix Works fine for me now:
e.g cp sendmail-buffered.conf postfix-buffered.conf
same for all the rest of the sendmail conf files within this folder....
Then restart the fail2ban service -ref: https://serverfault.com/questions/640064/fail2ban-mta-postfix-setting-in-jail-config-giving-errorWhen you create your jail.local file (because you should not modify the jail.conf because of fail2ban updates), these are the overwrite settings I have used:
sender = fail2ban
destemail = email@example.com
action = %(action_mwl)s
#Action to take when a possible intruder is detected. Default is %(action_)s which will only ban the IP. With %(action_mwl)s it will ban the IP and send a mail notification including whois data and log entries. See comments in /etc/fail2ban/jail.conf for more information.