To permanently disable sendmail in FreeBSD, simply add sendmail_enable=”NONE” in the /etc/rc.conf file. You can also disable the sendmail service during the FreeBSD installation by checking the Disable Sendmail service [option 8] on the System Hardening section of the installer.
Sendmail is a mail transfer agent [MTA] on Unix and Unix-like operating systems that supports a variety of mail-transfer and delivery protocols, including the SMTP [Simple Mail Transfer Protocol]. Simply said, sendmail is a service used when installing a mail server on FreeBSD.
You can read more about the sendmail service, variables, and flags available on FreeBSD, have a look HERE.
Disable sendmail in FreeBSD
The following procedure will disable sendmail in FreeBSD. You can choose to make the change temporary or persistent on reboot.
- Open a terminal and log in as the root user by issuing the following command:
- To temporary disable sendmail in FreeBSD until the system reboots:
- To permanently disable sendmail, edit the rc.conf file located in the /etc folder on your system:
- Add the following line at the bottom of your rc.conf file:
Press the ESC key and type the letter “a” twice to save and exit the file.
Next time you boot your FreeBSD machine, the sendmail service won’t be loaded in the system.
If for some reason you want to enable the sendmail service on FreeBSD, simply comment the sendmail_enable=”NONE” line in your /etc/rc.conf file.
You might also want to check How To Enable Support for NTFS in FreeBSD 13.
Disable sendmail in FreeBSD during installation
You can disable the sendmail daemon during the FreeBSD installation, respectively on the System Hardening section of the installer, by checking the Disable Sendmail service as shown in the screenshot below:
If for the however reason you want to enable sendmail on your system, simply add the following line on your rc.conf file and reboot your system.
If you are looking for more FreeBSD installation and troubleshooting guides like this, check the FreeBSD section of this website.
If you found this tutorial useful, please share it with your friends and colleagues.