Install docker and from that install a container already configured
that handle email
You just need to configured some variable like stmp , impa adrs etc …
The scope of setting up a mail server is likely outside the scope of this forum however if you utilize something such as Exim for your MTA you can utilize the pipe transport to run an arbitrary command as you see fit: 29. The pipe transport
@Jintor, if you are talking about local system mail messages, which can be read using the mail command provided by the mailx package then you might be able to do a grep of the appropriate mail file, but even that is risky.
Risky because your mail for the root account, for example, would be stored in /var/spool/mail/root - an ASCII text file. You could grep out whatever text strings you want and then take the appropriate action. The real reason it is risky is that you would have to delete the mail message out of the /var/spool/mail/root file; and in doing so other system messages that you may not be aware of may also be deleted.
An important point to make here is that the mail command and mailx commands can both ve used to send and read email, but they are not fully-featured email clients (MUAs).
If you just want to get email services up and running I can provide you with a decent Youtube video that you may want to watch over and over again because the guy who made the video is difficult to understand at times.
This is the Youtube link to the video:
I also have the instructions written up in a Word Doc, but do not know how to get it to you privately.
There is a little known control panel for Alma/CentOS linux, which can configure virtual hosts and all mail related things, without adding any extra packages.
After setup you can even delete it, because all it does is configure your system, it does not stay resident, very clean and easy: