On 16:40, Mon 04 Sep 06, Patrick Tuite wrote:
> Hi
>> I'm using the BSD mail application that's in a RHEL4 AS distribution to mail
> me log extracts, as below:
>> Mail -s "$subject" "$adminEmail" < $mailLog
>> I get these mails as coming from root. I'd like to be able to modify the From:
> field so it says what system it is being mailed from. i.e. From:
> <system.ucd.ie>.
From 'man mail' on CentOS:
-a Specify additional header fields on the command line such as "X-Loop: foo at bar"
etc. You have to use quotes if the string contains spaces. This
argument may be specified more than once, the headers will then be concatenated.
This should do:
mail -a From:someuser at system.ucd.ie -s "$subject" "$adminEmail" < $mailLog
Sarunas
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!