We want to add the 'from' email address to mailx command in all our linux script. After searching this site I am able to find the command '-- -f' to add the from the email address. Bu the problem is our from email address is :- "Proper Support Name <support@company.com>"
Now when I am running mailx command I am getting email from 'support@company.com', but I need to have "Proper Support Name" (alias).
Could you please let me know how can we add the email alias ("Proper Support Name" in this case) in the from email address?
Command which I tried so far:-
The sendmail compatibility options `-F' and `-f' after `--' do not appear to be in mailx anymore.
man mailx do not show any longer [-- sendmail-options ...]
However, looking at it, it appears to have an -S from= variable that you can use for the same purpose.
See if this will help
mailx -s "`hostname` : ${Subj}" -S "from=Proper Support Name <support@company.com>" ${list} < 1.txt
Make sure that you do not add the recipient anywhere else but as the last argument or it will fail. I am assuming that it is ${list}
mailx -r does set as well the Return-Path which may or may not be what is wanted, and if the format "Name Title <me@here.com>" is given as requested, the Return-Path gets <me@here.com> which is not valid.
It appears that your mailx program is not a real binary but rather a symbolic link to the mail program. Futher more, your mail binary supports the compatible sendmail options. Are you in redhat 5.x?