Search code examples
bashfreebsdmuttssmtp

Mutt bash script sends email fine from command line but not from motioneye notification hook


So I'm about ready to pull my hair out on this one. I am running ssmtp and mutt on a freeBSD jail. I have a bash script called notify that contains the following line.

mutt -s "$subject" "$email" -a "$attachment" < "$logfile3"

When I run

bash notify.sh

The email will send just fine, but if I run that exact same command from inside motioneye I receive an extremely non-descript error from mutt enter image description here

Could not send the message

I have tried using a daemon but that hasn't had any effect. I wish the mutt error message was more descriptive.


Solution

  • My script did not have access to the "sent" mailbox and therefore mutt was failing to send. -e "set copy=no" added to the mutt call corrected the issue.

    For a better walkthrough: https://gitlab.com/muttmua/mutt/issues/119