Command line emails with attachments using postfix and mutt
Is anyone using the command line to email binary attachments?
My problem is that sometimes the Mail app stops sending emails because it asks for the password for the email account. As near as I can tell this is being cause by checking for new email too often of attempting to send too many emails at one time. I have found it annoying not to get SecuritySpy images captured during certain motion events. Instead I have to log on to the computer and type in the password a few times to empty the out-box queue.
So my solution is to bypass the Mail app completely and send the emails via postfix. I have configure postfix and it is working correctly. I have installed mutt but have yet to send an attachment successfully.
What I would like to do is call a shell script from an indigo trigger every time a motion sensor goes off, the doorbell rings, or a camera detects motion. I don't know how to write a shell script for mutt. I also can't figure out the proper syntax to send a file via mutt within the terminal app.
Can anyone help?
The command I am trying to run is: do shell script "mutt -s \"Subject\" -a /Users/username/Desktop/variables/image.png firstname.lastname@example.org
When I run the command is says that the mutt command cannot be found.