sendmail
Linux
If it crashed, it would be a pain to remove and reinstall it because it use MAKE to install stuff, and those stuff would stored everywhere.
First you may want to remove it first, read carefully what it have removed, confirm there is no stuff which should not be uninstall:
Or you may want to remove it with aptitude, as it would remove the stuff more clean:
Then go to /etc/sendmail, read the makefile, check what it have done and try to remove all the other stuff it have done manually, then run
It should now installed sendmail again, and you can now do your configuration
Remember, DO NOT run make command because it not work on Ubuntu 22 but crash sendmail, and sometimes m4 also, some tutorial on the internet may tell you to use it, but it might either based on some very old version, or they are installing it in a old fashion way, so unless you have tons of time for knowing what you are doing, else just DON'T.
To do the configuration, you can just simple looking for the sendmail.mc and edit it, then run:
It will convert it as sendmail.cf for sendmail to run by itself, no MAKE or M4 is need to do the convert.
You may check if the sendmail is working by running the below command:
Sendmail test script :