Ubuntu 20.04 Clean install - Fail2ban not sending any emails with action_mw or action _mwl

OS type and version Ubuntu 20.04
Webmin version 1.991
Virtualmin version 7.0-4
Related packages fail2ban

I have a newly configured Virtualmin host Ubuntu 20.04 all the basics are configured and the first domain deployed.

Working on fail2ban config I cannot get any email notifications even though the correct action_mw or action_mwl are set and the default root@localhost destemail is set with mta = sendmail

What am I missing? Lots of google searching turned up a lot of conflicting information. But no solutions worked. I don;t want to start installing things that may break my virtualmin install which is working fine apart from no fail2ban notifications.

I tested sendmail from the command line using echo “Subject: test” | /sbin/sendmail -v root@localhost

This works fine and I get the email in the root account.

I have other virtualmin installs and this works OOTB on earlier Ubuntu versions.

Any help would be appreciated as I am drawing a blank.


So your using sendmail? Default VM is postfix isn’t it?

Postfix is installed by virtualmin. Sendmail is still installed and works at the command line level as I have tested. As fail2ban is working under the root account with root privileges so should be able to be used as per the default fail2ban behaviour.

By experimentation I have managed to get email output. If I set the destemail to another mail system I have control over with a valid email account. e.g. destemail = validaccount@realmailserverontheinternet and send it from root@FQDN of the virtualmin host even though it is on a private subnet. I get email.

However if I try and get it to send to the root account of the virtualmin host server I get nothing.

This is weird. Does anyone have any explanation as to why this might be happening.


The same command name (sendmail) is used in both Postfix and Sendmail.

Yes, I am aware. How does that help me solve the problem! Do you have any idea why I cannot send mail to the root account of the local server?


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