Help for a simple Sendmail server

SYSTEM INFORMATION
OS type and version Ubuntu 22.04.3 & Debian 12
Webmin version 2.105

I’m testing on both a small Ubuntu 22.04.3 server and Debian 12.
I need to install a small sendmail server to send an error message from an application (fail2ban).
I therefore need only one user (the one who sends the email) to a single destination email.
I don’t need a complex setup because there will be no incoming mail or spam to deal with any other complications.
The user was created in the terminal with adduser and is present in Webmin in the user list.

I’m getting lost among the various Webmin guides and documentation.
Where can I find a guide for simple installation?
How can I test to see if it works?

Thanks in advance for your help and advice.

Simple installation of what? I don’t know what your question is.

Test to see if what works?

Thanks for the reply.
Maybe I did not say it clear enough.
I don’t need all the features of a mail server because the PC will only have to forward error messages sent by the application that detected them.
So I was looking for one of the simplest instructions to install only what is absolutely necessary of sendmail.
The guide on Webmin is for the complete installation of Sendmail.

The mail server is either on or off for the virtual sever (domain) that you setup.

If you enable it, all you have to do is setup an email account. SPF, DKIM, DMARC is all optional but is needed nowadays to ensure email delivery.

Webmin has nothing to do with installation of sendmail (not a simple MTA).
Webmin is the GUI to config your OS and applications on the OS.
You be better getting a linux guide to install Sendmail (I’m sure there are heaps on the internet).
I would recommend Postfix rather then Sendmail, its less complicated.

Although Virtualmin is a bigger install it does configure software to use, you could install that and disable all feature you don’t need, alot easier if you not good in Linux. By default it install postfix though and need the OS to be clean to install on. This also allows to add features later on.

Just install mailutils this will add everything you need to do what you want without a full mail stack

1 Like

I already installed sendmail and mailutils two days ago.
I just need to configure it to send Fail2Ban error messages from a single user who is enabled to send these messages.
The Webmin guides (which I have already read and used) lead me to configure it with options that go beyond my needs.
At the moment I’m trying and trying to figure out what’s not working.
I was hoping to find something simpler for this setup.

You have set this user up in fail2ban and have set the condition to send mail in your fail to ban configs ?
when you say fail2ban error messages what exactly do you mean ? Is it when fail2ban errors out or when fail2ban bans someone ?

however if you install postfix on a webmin only system it still works fine, I have a server with just postfix (mailutils) installed, from the command line just use something like

echo “This email body is sent with webmin” | mail -s “webmin email” bill.gates@microsoft.com

so you just build a script around scanning whichever log file and sending the message when the condition is met. That said, on a webmin only system there may not be any dmarc, spf or dkim which would need to be addressed to ensure the mail is delivered if sent to a ‘picky’ mail server

1 Like

The configuration of Fail2Ban actions involves sending an email.
In any case, I’m still stuck with the Sendmail configuration that I’m testing by sending a message from the terminal with
echo “Test 1 from $(hostname -f)”|mail -s “Test 1 $(hostname -f)” my-email@gmail.com

In Webmin / Sendmail / Mail Queue I find the various messages with:
From: pc-user@hostname.mydomain.tld
To: my-email@gmail.com
Status: Deferred: Connection refused by g1.upgradelab.it.

In Spam Control Access I entered with the Allow Relaying action
Network: PC IP (in LAN)
Domain: hostname.mydomain.tld
email: pc-user@hostname.mydomain.tld
user: hostname

In Ubuntu there are users with name “hostname” and “pc-user”.

When I saw in the guides that it was enough to insert half a dozen lines in the configuration I opted for sendmail.
I installed Postfix on one of my servers, but years ago. I don’t remember much about that setup, but it didn’t take me long.
Now I’ll do some more testing because I don’t want to let sendmail win, otherwise I’ll do a nice sudo apt remove sendmail and install postfix.

mailutils installs postfix so

apt install mailutils

will install postfix & webmin (if webmin only system) will recognise it

I ended up removing sendmail and installing postfix, but I’m having another problem.
I’m closing this thread and opening another.
Thank you

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