How to set SMTP credentials for email notification for the Fail2Ban include in SWAG?

I’m new to SWAG container, and I would like to get fail2ban notifications with email. But I can’t find a way to set my smtp server and ID/pwd for it…
So, how can I set SMTP credentials for email notification for the Fail2Ban include in SWAG ?

Thanks in advance.

1 Like

I up my thread because I’m about to move my swag container to a new server, and it would be a great thing to use the integrated fail2ban instead of another image.
So how can I send emails notifications with smtp credentials ?
I’m open to all solutions if they are not too complex to set up.
Thanks for your help.

fail2ban has this well documented already, have you checked their documentation?

What documentation are you talking about ? The one from crasymax’s image ?
Because this doesn’t work with the f2b integrated in swag. That’s why I was asking some help.

Fail2ban’s documentation is what I’m talking about, crazy max works for docker, not fail2ban

I looked in the fail2ban documentation here:
And other pages in , but I can’t find anything related to email smtp configuration…
Can you point me to the appropriate page about smtp configuration ? (witch work with swag integrated fail2ban).
Thanks for the precision about crazymax :blush:
And thanks in the advance.

Merry Christmas :christmas_tree::gift: all of you .

According to their docs, you just need the MAILTO stuff setup and a working mail command. You’d install your mail client of choice, perhaps mutt, and then configure it to use your smtp provider of choice.

happy holidays!

Hi :wave:t2:
Do you have a link to this doc ?
Because I don’t know how to do what you just said :sweat_smile:
Thanks for your help :innocent::pray:t2:

I do not believe there is any doc. You can use Customizing our Containers | to add the cli mail app of your choice in, then configure it per their documentation (the documentation for whatever mail app you choose)

sendmail is in there and you can use that. There is no smtp configuration per se. You just put in the smtp details as cli arguments for sendmail in your fail2ban action config

well there we go, my bad, i didn’t know sendmail was in there. fortunately, sendmail is heavily documented by themselves and tons of ppl online!