Closed mpfusion closed 5 years ago
Can you try version 4.1? I make a couple of changes to the mail logic to hopefully address this.
Still doesn't work, the error message (not visible) is mail: illegal option -- r
. The reason is that mail
is still called with the -r
flag:
case "${MAILMODE}" in
"mail")
echo "$MSG" | ${MAIL} -r $FROM -s "$SUBJECT" $TO
;;
"mailx")
echo "$MSG" | ${MAIL} $FROM -s "$SUBJECT" $TO
It defaults to mail
here and therefore uses the -r $FROM
part, which is not valid on my system. BTW: I don't need the from
header, since my system sets it automatically to the correct value. But that might not be the case for everyone.
I think I see the issue. Can you try the latest version? Folks should be able to work around the From: issue via their .mailrc.
Thanks for the quick fix. Mail is being sent but the subject is empty. I believe passing the TO
to mailx
won't work like that. Here's the top of the man page from my system:
NAME
mail, Mail, mailx – send and receive mail
SYNOPSIS
mail [-dEiInv] [-s subject] [-c cc-addr] [-b bcc-addr] [-F] to-addr ...
[-sendmail-option ...]
mail [-dEHiInNv] [-F] -f [name]
mail [-dEHiInNv] [-F] [-u user]
mail [-d] -e [-f name]
So I guess this should work:
"mailx")
echo "$MSG" | "${MAIL}" -s "$SUBJECT" "$TO"
Good catch. Try version 4.8. Hopefully that works. :)
Seems to work now. Thanks for the quick fix.
mail
on FreeBSD doesn't support the-r
option. Therefore sending emails fails on FreeBSD.11.2-STABLE ssl-cert-check Version 3.31