Skip to content

Instantly share code, notes, and snippets.

@igalic
Last active March 22, 2023 12:45
Show Gist options
  • Save igalic/c77ed494e102977c9fd06ce9b053cda0 to your computer and use it in GitHub Desktop.
Save igalic/c77ed494e102977c9fd06ce9b053cda0 to your computer and use it in GitHub Desktop.
disable sendmail on FreeBSD, completely.
# if with the below rc.conf and periodic.conf settings you somehow still see logs like
# Nov 28 03:01:00 webproxy sendmail[41991]: My unqualified host name (webproxy) unknown; sleeping for retry
# Nov 28 03:02:00 webproxy sendmail[41991]: unable to qualify my own domain name (webproxy) -- using short name
# Nov 28 03:56:50 webproxy sendmail[74256]: My unqualified host name (webproxy) unknown; sleeping for retry
# Nov 28 03:56:51 webproxy sendmail[87297]: My unqualified host name (webproxy) unknown; sleeping for retry
# Nov 28 03:57:51 webproxy sendmail[74256]: unable to qualify my own domain name (webproxy) -- using short name
# Nov 28 03:57:51 webproxy sendmail[87297]: unable to qualify my own domain name (webproxy) -- using short name
# we can kill it off like this:
sendmail /usr/bin/true
mailq /usr/bin/true
newaliases /usr/bin/true
hoststat /usr/bin/true
purgestat /usr/bin/true
# disable sendmail (mailqueue) cleanups:
daily_clean_hoststat_enable="NO"
daily_status_mail_rejects_enable="NO"
daily_status_mailq_enable="NO"
daily_submit_queuerun="NO"
# disable periodic's emailing by logging!
daily_output=/var/log/daily.log
weekly_output=/var/log/weekly.log
monthly_output=/var/log/monthly.log
# put these into the log, instead of trying to mail them:
daily_status_security_inline="YES"
weekly_status_security_inline="YES"
monthly_status_security_inline="YES"
# since sendmail_enable="NONE" is deprecated (since 2004, lol), this is how to disable all of Sendmail:
sendmail_enable="NO"
sendmail_submit_enable="NO"
sendmail_msp_queue_enable="NO"
sendmail_outbound_enable="NO"
# don't allow cron to mail
cron_flags="-m ''"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment