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

Hello,
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

Hello,
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?

Hello,
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:
https://www.fail2ban.org/wiki/index.php/MANUAL_0_8
And other pages in fail2ban.org , 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 | LinuxServer.io 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!

Hi
I also tried to setup sendmail with swag docker version

fail2ban.utils [543]: ERROR 14b8a6fe2920 – stderr: “sendmail: can’t connect to remote host (127.0.0.1): Connection refused”

I didn’t find any service listening on port 25 for sendmail, so it can’t work
or do I miss something?

you told sendmail to send email using swag… swag isn’t an email container

When I read this, I had a doubt about the sendmail service inside this docker

If you need something non default installed, you need to install it