I am writing a bash shell script for Mac that sends email notification by opening an automator application that sends email out with the default mail account in Mail.app. The automator application also attaches a text file that the script has written to. The problems with this solution are
- It is visible in the GUI when sending
- It steals focus if Mail is not the current application
- It is dependent on Mail.app's account setup being valid in the future
I figure to get around those shortcomings I should send the mail directly from the script by entering smtp settings, address to send to, etc directly in the script. The catch is I would like to deploy this script on multiple computers (10.5 and 10.6) without enabling postfix on the computer. Is it possible to do this in the script so it will run on a base OS install of 10.5. and 10.6?
Update: I've found the -bs option for sendmail which seems to be what I need, but I'm at a loss of how to specify settings.
Also, to clarify, the reason I'd like to specify smtp settings is that mails from localhost on port 25 sent out via postfix would be blocked by most corporate firewalls, but if I specify the server and an alternate port I won't run into that problem.