Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Executing /usr/bin/mail From Within Daemon

I've created a script that, among other things, sends an email to an external email address and it works fine from the command line. When the same script is run periodically from within a daemon (i.e. launchctl), the email functionality of the script does not execute. There are no errors in the system.log, the appfirewall.log or the mail.log. All of my referenced paths are absolute. I'm overlooking something, but don't know what.


Python:

cmd = "/bin/echo \"%s\" | /usr/bin/mail -s \"%s\" %s" % (messageText.strip(),subject,receiver)

os.system(cmd)



The question is, why does /usr/bin/mail not function correctly from within a daemon?


I appreciate your assistance

iMac (27-inch Late 2009), OS X Mavericks (10.9.5)

Posted on Mar 3, 2015 5:22 AM

Reply
Question marked as Best reply

Posted on Aug 17, 2015 10:18 AM

Proper filename is important. Oops.

1 reply

Executing /usr/bin/mail From Within Daemon

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.