How to use sendmail with Fail2ban instead of Postfix

https://www.cyberciti.biz/faq/how-to-protect-ssh-with-fail2ban-on-centos-8/

I installed the Centos 8 with minimal options, there is no postfix or sendmail by default.

When I install fail2ban by dnf (yum), postfix is one of the dependent packages.

Now I am done with fail2ban, but I would like to use sendmail instead of postfix, if I run “dnf remove postfix”, fail2ban will be removed too as it is one of dependent packages.

How to remove postfix and install sendmail instead?

Thanks.

Welcome @watoan to nixcraft forum!

The workaround is as follows.

Install sendmail

Run:

sudo yum install sendmail

Now remove postfix

Execute

sudo yum remove postfix

Configure sendmail

As per your need configure sendmail. I hope this helps!