I'm using this setup to be able to send mail from Terminal: http://www.anujgakhar.com/2011/12/09/using-macosx-lion-command-line-mail-with-gmail-as-smtp/
It works great, and I can use it in scripts. As long as I run the script manually.
However when the script is launched by launchd, no mails are ever sent off.
Looking around, it seems that this could be related to AbandonProcessGroup, which I didn't specify in the launchd job first.
However, despite setting AbandonProcessGroup to true, mails are still never sent off. I can't find any error message in log (or I'm looking at the wrong place). How to fix this?