I am running a bash script that contains these statements:
which gives this error:
despite this:
Following the trail of breadcrumbs gives this:
However, changing the mailer does not work either:
This probably has something to do with dma
Using that works no better:
So, how does one send mail from inside a bash script on FreeBSD?
Code:
MAILER="/usr/sbin/sendmail -t" # -t get To:, CC:, and BCC:, from message
. . .
local _mailer_return=$(cat "${_msg_file_name}" | "${MAILER}") # <<== this is the error, using a variable instead of a literal
which gives this error:
Code:
line 266: /usr/sbin/sendmail -t: No such file or directory
despite this:
Code:
ls -l /usr/sbin/sendmail
lrwxr-xr-x 1 root wheel 11 Nov 1 2019 /usr/sbin/sendmail -> mailwrapper
Following the trail of breadcrumbs gives this:
Code:
ls -l /usr/sbin/mailwrapper
-r-xr-xr-x 1 root wheel 9224 Dec 24 10:44 /usr/sbin/mailwrapper
However, changing the mailer does not work either:
Code:
line 266: /usr/sbin/mailwrapper -t: No such file or directory
This probably has something to do with dma
Code:
cat /etc/mail/mailer.conf
# $FreeBSD: releng/12.3/etc/mail/mailer.conf 363973 2020-08-06 18:13:45Z kevans $
#
# Execute the "real" sendmail program, named /usr/libexec/sendmail/sendmail
#
# If dma(8) is installed, an example mailer.conf that uses dma(8) instead can
# can be found in /usr/share/examples/dma.
#
sendmail /usr/local/libexec/dma
send-mail /usr/local/libexec/dma
mailq /usr/local/libexec/dma
#sendmail /usr/libexec/sendmail/sendmail
#mailq /usr/libexec/sendmail/sendmail
#newaliases /usr/libexec/sendmail/sendmail
#hoststat /usr/libexec/sendmail/sendmail
#purgestat /usr/libexec/sendmail/sendmail
ls -l /usr/local/libexec/dma
-r-xr-sr-x 1 root mail 66336 Apr 6 11:22 /usr/local/libexec/dma
Using that works no better:
Code:
line 266: /usr/local/libexec/dma -t: No such file or directory
So, how does one send mail from inside a bash script on FreeBSD?
Last edited: