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)
Feb 9 2024, 7:37 PM
Unknown Object (File)
Feb 9 2024, 10:43 AM
Unknown Object (File)
Jan 15 2024, 10:52 AM
Unknown Object (File)
Dec 20 2023, 5:12 AM
Unknown Object (File)
Dec 12 2023, 11:46 AM
Unknown Object (File)
Nov 15 2023, 8:38 PM
Unknown Object (File)
Nov 15 2023, 8:26 PM
Unknown Object (File)
Nov 13 2023, 4:42 PM

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 😓

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. :)