Setup mail for fail2ban

Hello, I am trying to setup fail2ban and I need to be able to send an email. I have googled and found either s-nail or mailutils that I can install on Mamjaro. s-nail will not work because of no directory in /var/spool/ and mailutils doesn’t seem to have a mail command at all.

Can someone please tell me what I need to install and how to configure it to get a working email for fail2ban.

                                      Thank You.
                                                  vovim.

You need to configure any SMTP client – smsmtp, sendmail, postfix…
https://wiki.archlinux.org/title/Fail2ban#Receive_an_alert_e-mail

Thank you Tomek, I know what to do when the mail is working. I just need to set up the mail (email).
Manjaro does not come with mail installed. How do I install a working mail system ?

Do you want to send these emails to a real mail provider like Gmail, Outlook.com or Proton Mail or do you want to save the mail just in a local mailbox on this system?

Sending the mail to a mail provider is usually easier, since you don’t need an MDA. You can use msmtp or sSMTP. The Arch wiki has simple instructions on how it can be used.

If you want to store mail, you need an MDA. Postfix is often used since it is sendmail compliant and can act as a MDA in simple cases. It can easily used with Dovecot or procmail if you need more options. Of course there are others, just use what you want.

But you need to read up on how to configure it.

4 Likes

Hi xabbu, Thank you for your reply. I just want mail for local mailboxes. I already have Thunderbird for real emails. I will try installing sendmail and postfix and see how they work.

                                        Thank You.

You just need to install postfix, it provides sendmail.

You need to add the options listed in the Arch Wiki for local mail to main.cf, otherwise it will not work.

3 Likes

Hi xabbu, Sorry for the delay in replying, I’ve been a bit busy with other things. That has worked fine. Installed and tested O.K. Thank You for your help it is very much appreciated.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.