2
waldz
3y

Hi everyone,
Does anyone have experience setting up email notifications for fail2ban?
I am trying to set sendmail MTA (mail transfer agent) to send an email with my gmail account when fail2ban bans an IP address but without success.
Any help is appreciated.

Comments
  • 1
    Do you try to use sendmail, or just an MTA compatible with sendmail?

    In case of the former, I would suggest doing the latter.
  • 0
    @sbiewald I don't care as long as I make it work, sendmail or anything else. If you have something in mind that's is well documented and easy to use I will be thankful.
  • 1
    how about using a webhook?

    there is this fail2ban webhook for slack you could adapt to sendmail maybe?
    https://github.com/coleturner/...
  • 1
    @heyheni man this is awesome.
    We don't use slack but I can adapt that for my purpose. Thanks a lot.
  • 1
    @waldz hmm while googling for that webhook i learned about ntopng network traffic monitoring tool. Looks interesting and it offers an integrated notification system for various server tools like fail2ban.

    https://ntop.org/products/...

    ntop alerts
    https://ntop.org/guides/ntopng/...
  • 3
    @waldz In case you still want some mails:

    - Postfix itself is well documented.
    - If a "fully equipped" MTA is to much work, try mstmp. Just give it a username, password and server of an email account and you are done. On Debian/Ubuntu, install mstmp-mta for a sendmail compatible binary.
  • 0
    +1 for mstmp. Easy to setup, up in mere minutes
Add Comment