# Installing sendmail to get fail2ban notifications

**URL:** <https://forum.hhf.technology/t/installing-sendmail-to-get-fail2ban-notifications/284>\
**Category:** General\
**Tags:** fail2ban\
**Created:** [October 21, 2024, 12:42am UTC](https://forum.hhf.technology/t/installing-sendmail-to-get-fail2ban-notifications/284 "2024-10-21T00:42:45Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![distro-nix](https://forum.hhf.technology/user_avatar/forum.hhf.technology/distro-nix/32/181_2.png) [@distro-nix](https://forum.hhf.technology/u/distro-nix)\
**Post date:** [October 21, 2024, 12:42am UTC](https://forum.hhf.technology/t/installing-sendmail-to-get-fail2ban-notifications/284/1 "2024-10-21T00:42:45Z")

</div>

I am following [Setting Up Nextcloud with Docker, Portainer, Cloudflare Tunnel, and Uptime Kuma on a Raspberry Pi (No Port Forwarding Needed)](https://forum.hhf.technology/t/setting-up-nextcloud-with-docker-portainer-cloudflare-tunnel-and-uptime-kuma-on-a-raspberry-pi-no-port-forwarding-needed/234)

A prerequisite for fail2ban and since I would like email notifications, but haven’t installed or configured sendmail. How to proceed? I already have potainer installed and fail2ban is active.

---

<div class="post-metadata">

**Author:** ![hhf.technoloy](https://forum.hhf.technology/user_avatar/forum.hhf.technology/hhf.technoloy/32/68_2.png) [@hhf.technoloy](https://forum.hhf.technology/u/hhf.technoloy)\
**Post date:** [October 21, 2024, 8:23am UTC](https://forum.hhf.technology/t/installing-sendmail-to-get-fail2ban-notifications/284/2 "2024-10-21T08:23:00Z")

</div>

you need to check out [nextcloud\_hardening/etc at main - hhf/nextcloud\_hardening - HHF Technology Repository](https://git.hhf.technology/hhf/nextcloud_hardening/src/branch/main/etc)

it has all the config files related to fail2ban with nextcloud. fail2ban is not docker based.

---

<div class="post-metadata">

**Author:** ![hhf.technoloy](https://forum.hhf.technology/user_avatar/forum.hhf.technology/hhf.technoloy/32/68_2.png) [@hhf.technoloy](https://forum.hhf.technology/u/hhf.technoloy)\
**Post date:** [October 21, 2024, 8:29am UTC](https://forum.hhf.technology/t/installing-sendmail-to-get-fail2ban-notifications/284/3 "2024-10-21T08:29:41Z")

</div>

for email  
you can use postfix config  
Replace the domains and necessary paths:

```plaintext
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
append_dot_mydomain = no
readme_directory = no
compatibility_level = 2
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_security_level=may
smtp_tls_CApath=/etc/ssl/certs
smtp_tls_security_level=may
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = ihre.domain.de
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = $myhostname, ihre.hhf.technology, localhost.hhf.technology, localhost
relayhost = smtp.mailserver.de:587
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = loopback-only
inet_protocols = all
#If you have problems with IPv6, change the line as follows.
#inet_protocols = ipv4
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
sender_canonical_maps = hash:/etc/postfix/sender_canonical
smtp_use_tls = yes
smtp_enforce_tls = yes

```

---

<div class="post-metadata">

**Author:** ![hhf.technoloy](https://forum.hhf.technology/user_avatar/forum.hhf.technology/hhf.technoloy/32/68_2.png) [@hhf.technoloy](https://forum.hhf.technology/u/hhf.technoloy)\
**Post date:** [October 21, 2024, 8:30am UTC](https://forum.hhf.technology/t/installing-sendmail-to-get-fail2ban-notifications/284/4 "2024-10-21T08:30:25Z")

</div>

if you need dedicate VM setup. i will write later-on

---

<div class="post-metadata">

**Author:** ![distro-nix](https://forum.hhf.technology/user_avatar/forum.hhf.technology/distro-nix/32/181_2.png) [@distro-nix](https://forum.hhf.technology/u/distro-nix)\
**Post date:** [October 23, 2024, 10:17pm UTC](https://forum.hhf.technology/t/installing-sendmail-to-get-fail2ban-notifications/284/5 "2024-10-23T22:17:17Z")

</div>

Thanks. I will try to adapt your tutorial and get back to you if I have any issues.  
I’m sure there are plenty of other things to occupy your time than writing a dedicated tutorial.

Michael

---

<div class="post-metadata">

**Author:** ![hhf.technoloy](https://forum.hhf.technology/user_avatar/forum.hhf.technology/hhf.technoloy/32/68_2.png) [@hhf.technoloy](https://forum.hhf.technology/u/hhf.technoloy)\
**Post date:** [October 24, 2024, 5:32am UTC](https://forum.hhf.technology/t/installing-sendmail-to-get-fail2ban-notifications/284/6 "2024-10-24T05:32:35Z")

</div>

[Adding ban/unban notifications from Fail2Ban to Email!](https://forum.hhf.technology/t/adding-ban-unban-notifications-from-fail2ban-to-email/292)

[Adding ban/unban notifications from Fail2Ban to Pushover!](https://forum.hhf.technology/t/adding-ban-unban-notifications-from-fail2ban-to-pushover/290)

[Adding ban/unban notifications from Fail2Ban to Discord!](https://forum.hhf.technology/t/adding-ban-unban-notifications-from-fail2ban-to-discord/291)

---

<div class="post-metadata">

**Author:** ![hhf.technoloy](https://forum.hhf.technology/user_avatar/forum.hhf.technology/hhf.technoloy/32/68_2.png) [@hhf.technoloy](https://forum.hhf.technology/u/hhf.technoloy)\
**Post date:** [October 24, 2024, 5:33am UTC](https://forum.hhf.technology/t/installing-sendmail-to-get-fail2ban-notifications/284/7 "2024-10-24T05:33:00Z")

</div>

hope this helps on your journey.
