Oefenweb / ansible-fail2ban

Ansible role to set up fail2ban in Debian-like systems
MIT License
117 stars 55 forks source link

fail2ban_sendername and fail2ban_sender not taken into account when using sendmail as MTA #54

Open eHanseJoerg opened 5 years ago

eHanseJoerg commented 5 years ago

I am using the sendmail command (via SSMTP) as MTA. I made sure to configure sendmail/SSMTP in such a way that the FROM address is overwriteable by the service using the MTA (e.g. by fail2ban).

my fail2ban action is %(action_mwl)s

This will result in the action at /etc/fail2ban/actions.d/sendmail-common.conf to be executed.

I observe that fail2ban_sendername and fail2ban_sender are not taken into account. Replacing /etc/fail2ban/actions.d/sendmail-common.conf with a correctly configured /etc/fail2ban/actions.d/sendmail-common.local will resolve the problem.

Is this an error in the role or in fail2ban itself?

deveth0 commented 4 years ago

Afaics this is an issue with the action configuration in jail.local which does not set the sender / sendername: https://github.com/fail2ban/fail2ban/issues/2071#issuecomment-371796715