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)