I have a box running on Fedora 13 that does some monitoring. My scripts can send email notifications. I decided to give the sender of these emails proper names, to sort them in outlook and create some rules that move these emails in referencing folders. That works good in Fedora 13. Unfortunately it is not working in RedHat EL5 or higher, because the -r attribute is not known by mail(x). It took me a while to find a way to simulate the -r attribute in these operating systems. By using this syntax mailx is sending emails with a defined from email address.
[root@RH6 ~]# echo -e "Here comes the email body" | mailx -s "The subject of the email" "recipient email address" -- -f "sender email address"
Using this syntax makes it also possible to use other sendmail attributes in mailx. This webpage gives you a good overview of these attributes.
A Quote from qotd.org
Difficulties are meant to rouse, not discourage. The human spirit is to grow strong by conflict.
William Ellery Channing
1780 - 1842Archives
- September 2017
- June 2017
- February 2017
- June 2016
- December 2015
- September 2015
- July 2015
- June 2015
- January 2015
- November 2014
- August 2014
- June 2014
- May 2014
- April 2014
- February 2014
- January 2014
- September 2013
- August 2013
- July 2013
- June 2013
- May 2013
- March 2013
- February 2013
- January 2013
- November 2012
- August 2012
- June 2012
- February 2012
- January 2012
- December 2011
UserOnline
Recent comments