Page MenuHomeFreeBSD

disable sendmail with variables specified in rc.sendmail(8)
AbandonedPublic

Authored by john.grafton_runbox.com on Oct 12 2022, 3:29 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 11 2025, 8:04 AM
Unknown Object (File)
Dec 29 2024, 10:12 AM
Unknown Object (File)
Dec 12 2024, 11:47 PM
Unknown Object (File)
Nov 24 2024, 7:37 AM
Unknown Object (File)
Nov 19 2024, 5:49 AM
Unknown Object (File)
Oct 26 2024, 8:42 PM
Unknown Object (File)
Sep 22 2024, 3:36 AM
Unknown Object (File)
Sep 13 2024, 10:21 PM
Subscribers

Details

Reviewers
emaste
Summary

According to the rc.sendmail(8) man page under sendmail_enable:
The "NONE" option is deprecated and should not be used.

Yet the hardening menu of bsdinstall uses the NONE option to disable sendmail.

This change updates bsdinstall to use the documented method for disabling sendmail.

Test Plan

Execute patched bsdinstall and select disable sendmail in the hardening menu.

/etc/rc.conf should reflect disabled sendmail options specified in rc.sendmail(8)

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 47791
Build 44678: arc lint + arc unit

Event Timeline

At this point in time, it might be easier to revert d87e0e8e230495df3be59a8a5c173aafc83bc450 😓

In D36950#839671, @jlduran_gmail.com wrote:

At this point in time, it might be easier to revert d87e0e8e230495df3be59a8a5c173aafc83bc450 😓

I concur. This change is from 2002, and the commit message only gives "new rcNG effort" as the justification, which is most probably irrelevant 20 years after (whatever "rcNG effort" means and whether it completed or not).

More generally, having a single knob to deactivate sendmail completely is useful as long as Sendmail is shipped in base (barring custom builds and installs, obviously).

Even if the NONE case is removed, the Sendmail's rc variables would arguably still not comply with the usual practice. The sendmail_enable knob gives the impression that all functionality related to Sendmail can be controled at once, as is the case for other programs.
A very welcome change would be to enforce exactly that, as well as introducing a new specific knob controling the "daemon listening for incoming email" functionality, such as sendmail_incoming_enable.

Honestly, I don't have an opinion on whether the documentation or code should be changed.

I'd just like the one of them changed so bsdinstall doesn't configure rc.conf in a way that is specifically called out as deprecated.

In the past, I've been confused why a newly installed system used sendmail_enable=NONE when the documentation explicitly states it's not supported.

Thus why I picked up the bug report and submitted a patch. :)

FWIW: Bastille disables sendmail with the four rc configuration options described in rc.sendmail(8) in its base template:
https://github.com/BastilleBSD/bastille/blob/0dcefae18c0b954d60f9a1062090ac40f53dc2eb/usr/local/share/bastille/templates/default/base/Bastillefile#L5

Dragonfly Mail Agent becoming the default mta makes this change moot. :)