View unanswered posts | View active topics It is currently Thu May 23, 2013 3:03 am



Reply to topic  [ 3 posts ] 
 Command line emails with attachments using postfix and mutt 
Author Message

Joined: Aug 13, 2006
Posts: 390
Location: Northern Idaho
Post 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 myname@gmail.com"

When I run the command is says that the mutt command cannot be found.

_________________
Image


Last edited by Matt on Sat Apr 23, 2011 8:16 am, edited 1 time in total.



Thu Apr 21, 2011 3:30 pm
Profile
Site Admin
User avatar

Joined: Mar 19, 2008
Posts: 6659
Location: Austin, Texas
Post Re: Comand line emails with attachments using postfix and mu
Try using the full path to the mutt application since the environment that IndigoServer runs in probably doesn't have it in it's path.

_________________
Jay (Indigo Support)
Image


Thu Apr 21, 2011 4:55 pm
Profile WWW

Joined: Aug 13, 2006
Posts: 390
Location: Northern Idaho
Post Re: Comand line emails with attachments using postfix and mu
Thanks a lot Jay!

This is the final command that worked - for those who are interested:

do shell script "/Users/username/mutt-1.5.20/mutt -s \"Email Subject\" username@gmail.com -a /Users/username/Desktop/variables/filename.png "

_________________
Image


Thu Apr 21, 2011 6:17 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.   Template designed by STSoftware.