# Disable sendmail on boot



## jemate18 (Jan 28, 2009)

On bootstrap, sendmail keeps me waiting for 10 to 20 seconds and flushes the message unqualified hostname ..... ..

How do I disable the sendmail?

I remember disabling it once in solaris 10 by using
svcadm disable sendmail

How do I do it in FreeBSD. Thanks again...

Follow up, if I disable sendmail, will all the mail function be disabled? like the mailing of info to root and other stuff?


----------



## DutchDaemon (Jan 28, 2009)

```
In rc.conf:
sendmail_submit_enable="NO"    # Start a localhost-only MTA for mail submission
sendmail_outbound_enable="NO"  # Dequeue stuck mail (YES/NO).
sendmail_msp_queue_enable="NO" # Dequeue stuck clientmqueue mail (YES/NO).
```

You won't receive system mail. Better give your server a hostname and put it in /etc/hosts.


----------



## Nightweaver (Jan 28, 2009)

Just add:

```
sendmail_enable="NONE"
sendmail_msp_queue_enable="NO"
sendmail_outbound_enable="NO"
sendmail_submit_enable="NO"
```
to /etc/rc.conf.

Mail function should work OK as far as I know.


----------



## DutchDaemon (Jan 28, 2009)

I don't think so, because system mail gets offered to 127.0.0.1 for further delivery. And Sendmail won't be there to handle it.


----------



## jemate18 (Jan 28, 2009)

in my /etc/hosts
127.0.0.1 mybsd

and still on bootstrap, sendmail says unqualified hostname


----------



## DutchDaemon (Jan 28, 2009)

It needs a fully qualified hostname, like mybsd.my.domain or mybsd.domain.local.


----------



## jemate18 (Jan 28, 2009)

I have just restarted and no more unqualified error. I have added mybsd.my.domain in my /etc/hosts and retaining the system mail to active mode

Thanks again [solved]


----------



## crees@ (Nov 15, 2020)

Necro-post (high search engine result).

In /etc/rc.conf:


```
sendmail_enable=NONE
```
is sufficient- it also disables submit_queue and everything else.

You also want to put:


```
daily_clean_hoststat_enable=NO
```
into /etc/periodic.conf as well.


----------



## rwatt (Dec 2, 2021)

Like cree@ said, this post is high in the search engine results. I stumbled upon it today, because I needed to disable this.

It seems like `sendmail_enable="NONE"` has been deprecated. Quoting rc.sendmail(8):


```
sendmail_enable
     (str) If set to "YES", run the sendmail(8) daemon at system boot
     time. If set to "NO", do not run a sendmail(8) daemon to listen
     for incoming network mail. This does not preclude a sendmail(8)
     daemon listening on the SMTP port of the loopback interface. The
     "NONE" option is deprecated and should not be used. It will be
     removed in a future release.
```


```
To completely prevent any sendmail(8) daemons from starting, you must
set the following variables in /etc/rc.conf:

sendmail_enable="NO"
sendmail_submit_enable="NO"
sendmail_outbound_enable="NO"
sendmail_msp_queue_enable="NO"
```


----------



## crees@ (Dec 2, 2021)

I would personally ignore that advice, as it's nearly 20 years old and deprecation hasn't happened yet 









						Deprecate the use of sendmail_enable="NONE" as it adversely affects the · freebsd/freebsd-src@d87e0e8
					

new rcNG effort.  Submitted by:	Mike Makonnen <makonnen@pacbell.net>




					github.com
				




I think that as it's not hampered RCng at all, the warning can be removed.  I'll hopefully get round to doing that if I get a chance.


----------

