Bug 237821

Summary: /usr/bin/mail: path to sendmail hard coded
Product: Base System Reporter: oz42
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed Works As Intended    
Severity: Affects Some People    
Priority: ---    
Version: 12.0-RELEASE   
Hardware: Any   
OS: Any   

Description oz42 2019-05-10 08:38:09 UTC
It seems that the path to the sendmail binary is hardcoded in the mail binary:

# echo test | mail -s test root
mail: /usr/sbin/sendmail: No such file or directory

l /usr/local/sbin/sendmail
-rwxr-xr-x  1 root  wheel    30K May 10 10:32 /usr/local/sbin/sendmail*

This system does not have sendmail but postfix from ports installed.
Comment 1 Conrad Meyer freebsd_committer freebsd_triage 2019-05-10 15:57:17 UTC
It can be overridden by setting the "sendmail" variable in either ~/.mailrc or 
 as an environment variable to the path of the correct program to use.  It can be set on a global basis in any of: /usr/share/misc/mail.rc; /usr/local/etc/mail.rc; and /etc/mail.rc.
Comment 2 Conrad Meyer freebsd_committer freebsd_triage 2019-05-10 15:58:14 UTC
(Tragically, this is not well document in the mail.1 manual page.  Sorry.)

See also mailwrapper(8).
Comment 3 oz42 2019-05-13 11:15:49 UTC
Thank you for clarifying! So this is no software bug, let us close this.
Comment 4 Mark Linimon freebsd_committer freebsd_triage 2019-05-13 16:38:38 UTC
Submitter requested to close.