I have a bunch of scripts on an IBM AIX server's crontab that call the mail command to send myself an e-mail, kinda like this:
$ mail -r [email protected] -s "Results for `hostname`" [email protected] <<EMAILCONTENT
Results of execution of command $COMMAND on `hostname`:
`cat /home/myon/executionresults.txt`
EMAILCONTENT
I intend to put a script that has something like this in a production environment, and as a result I'm trying to find a way to set mail headers using AIX's /usr/bin/mail
so that the mails that come from Production arrive to my inbox as high priority. Migrating to Perl's Mail package would take a while, so it preferentially has to be with the standard mail command. I couldn't find an option to specify a mail header neither on mail
nor on sendmail
(which from what I gathered receives any option that mail can't already parse, in this case the -r
).
Any idea of how to set headers this way?
EDIT: Thanks for the answer :3 here's how it worked, reworked so that it looks a bit more like the exhibit above:
$ sendmail -i -- [email protected] <<EMAILCONTENT
From: [email protected]
To: [email protected]
Importance: High
Subject: Results for `hostname`
Results of execution of command $COMMAND on `hostname`:
`cat /home/myon/executionresults.txt`
EMAILCONTENT