Solved Sendmail in 2022?

I've been trying to figure out if I really need sendmail, or if there's a better option in 2022 for FreeBSD 13? I read that disabling it entails:

Code:
sendmail_enable="NO"
sendmail_submit_enable="NO"
sendmail_outbound_enable="NO"
sendmail_msp_queue_enable="NO"

But what are the consequences? I do like to get notified when stuff breaks via the logging facility. Is that affected, is there an alternative that folks like? I definitely don't need it to send emails outside of the machine.

sendmail pauses at startup and it annoys me. Over the years, I've troubleshot this nearly every time I've installed. Sometimes it's missing a hostname - easy fix in rc.conf, sometimes, it's missing an entry in hosts, other times, like right now, I have no idea why it's hesitating (maybe a couple of seconds) - but it's really slow compared to every other boot task, and so I ask, if a mail capability is needed to get log messages, is there an alternative?
 
I disabled sendmail.
I installed opensmptd (listeniing on port 25)
Are you using it for system mail only or for real email (outside system)?
 
I finally broke down and read the handbook: 30.4.1. Disable Sendmail and 30.4.2. Replace the Default MTA, this tidbit was particularly instructive - aish:

Warning!
If Sendmail’s outgoing mail service is disabled, it is important that it is replaced with an alternative mail delivery system. Otherwise, system functions such as periodic(8) will be unable to deliver their results by email. Many parts of the system expect a functional MTA. If applications continue to use Sendmail’s binaries to try to send email after they are disabled, mail could go into an inactive Sendmail queue and never be delivered.
 
I'll checkout opensmtpd, for sure. In the meantime, I just followed the handbook and did

Code:
sudo pkg install postfix

mkdir -p /usr/local/etc/mail
install -m 0644 /usr/local/share/postfix/mailer.conf.postfix /usr/local/etc/mail/mailer.conf

sysrc postfix_enable="YES"
sysrc sendmail_enable="NONE"

mv /usr/local/etc/mail/mailer.conf /usr/local/etc/mail/mailer.conf.old
install -d /usr/local/etc/mail
install -m 0644 /usr/local/share/postfix/mailer.conf.postfix /usr/local/etc/mail/mailer.conf

vi /etc/periodic.conf(.local):
daily_clean_hoststat_enable="NO"
daily_status_mail_rejects_enable="NO"
daily_status_include_submit_mailq="NO"
daily_submit_queuerun="NO"
 
simple fix in the end, just

Code:
# fix sendmail
echo "O DontProbeInterfaces=True" >> /etc/mail/sendmail.cf
 
We install ssmtp on appliances that just need to send notifications. Just replace the entries in /etc/mail/mailer.conf and you're done
 
If all you need is local delivery and/or getting mail off the machine via "smarthost", there's no need to install any ports.

See mailer.conf(5) and dma(8). I use dma on all my machines except the "real" MTA (which uses exim here).

I personally don't understand why sendmail is still in base. Most installations don't need a full-featured MTA, and those that do can install a port/package. ?‍♂️
 
If you do not use mail you can disable sendmail but in addition you should configure cron and periodic to work without it.

Add following line to /etc/crontab:
Code:
MAILTO=""

Add following lines to /etc/periodic.conf:
Code:
# Disable mail related jobs
daily_clean_hoststat_enable="NO"
daily_backup_aliases_enable="NO"
daily_status_mailq_enable="NO"
daily_status_mail_rejects_enable="NO"
daily_queuerun_enable="NO"
# Redirect output to file
daily_output="/var/log/daily.log"
daily_status_security_inline="YES"
weekly_output="/var/log/weekly.log"
weekly_status_security_inline="YES"
monthly_output="/var/log/monthly.log"
monthly_status_security_inline="YES"

You can also configure newsyslog to rotate these logs if necessary.

I have no MTA on my systems for years and everything is logging to files without any issues.
 
If you do not use mail you can disable sendmail but in addition you should configure cron and periodic to work without it.

...

I have no MTA on my systems for years and everything is logging to files without any issues.

I do agree with your comments, however I prefer to receive my daily messages from Charlie Root delivered directly to my email, so I don't need to remember to poke around the log files.
Personal preference is such a wonderful thang.
 
Back
Top