# Disable sendmail: NO or NONE



## Alucn (Dec 17, 2022)

hello everyone. I disable sendmail writing to rc.conf in community search, saying it is sendmail_ Enable="NO", but when I choose to disable the sendmail configuration file when installing the system, it is sendmail again_ Eenable="NONE", which parameter is really valid?


----------



## ralphbsz (Dec 17, 2022)

Made me look ...

The canonical answer is: If you look at /etc/rc.subr, you see that you can use "NO" in any mixture of upper and lower case (so "nO" and "No" would be valid, but ugly and a bad idea), as well as "false" and "off" (again in any case). And for "yes", you can also use "true" and "on".

In the case of sendmail, please look at /etc/rc.d/sendmail. Right at the top, if you set the variable sendmail_enable to "none" (in lower or upper case), then it gets automatically changed to "no". So it seems that you are not the first person to ask this question, and because others have gotten it wrong before, "none" is equivalent to "no".

So the formal answer to your question is: Both are valid. That immediately leads to the next question: Which one should you use? And should you use no, NO, NoNe, nOnE, fAlSe or oFf, or some other perverse mix? Here my advice would be: It seems that the distributed defaults all use YES and NO (in all uppercase), so best to stick to that. You know, when in Rome, do like the Romans ...


----------



## gpw928 (Dec 17, 2022)

Please also see the response by tingo in this post.


----------



## CuatroTorres (Dec 17, 2022)

Disabling sendmail_enable on the installation/hardening screen is not enough in the latest versions, other related services appear on the next reboot.
You can use `bsdconfig` too.


----------



## Alain De Vos (Dec 17, 2022)

I use rc.conf:

```
sendmail_enable="NO"    # Run the sendmail inbound daemon
sendmail_cert_create="NO"    # Create a server certificate if none 
sendmail_submit_enable="NO"    # Start a localhost-only MTA for mail submission
sendmail_outbound_enable="NO"    # Dequeue stuck mail
sendmail_msp_queue_enable="NO"    # Dequeue stuck clientmqueue mail
```


----------



## bob2112 (Dec 18, 2022)

ralphbsz said:


> In the case of sendmail, please look at /etc/rc.d/sendmail. Right at the top, if you set the variable sendmail_enable to "none" (in lower or upper case), then it gets automatically changed to "no". So it seems that you are not the first person to ask this question, and because others have gotten it wrong before, "none" is equivalent to "no".



They aren't equivalent, setting sendmail_enable=NONE sets multiple variables to "NO".



> case ${sendmail_enable} in
> [Nn][Oo][Nn][Ee])
> sendmail_enable="NO"
> sendmail_submit_enable="NO"
> ...


----------



## ralphbsz (Dec 19, 2022)

You're correct, None is a superset of No.


----------

