Results 1 to 4 of 4
Im using the mail command to send emails from my shell. Everything is working fine but i cannot seem to change the sent from name.
Im using the command ...
...
- 01-03-2010 #1Just Joined!
- Join Date
- Jul 2009
- Posts
- 4
Mail command
Im using the mail command to send emails from my shell. Everything is working fine but i cannot seem to change the sent from name.
Im using the command ...
But my emails are still coming from root ??Code:HDD=$(df | awk ' NR>3 (S=$5) (M=$6) { if (S>10) print "Your Systems "M" is """S" Full" } ') ; [[ $HDD ]] && echo "$HDD" | mail -s "Hard-Drives Full" email###### -- -f FROM###### >/dev/null
Any Ideas ??
- 01-03-2010 #2
The mail command uses the send name of the user executing the command. I'm sure you are using this command in a cron job. All you need to do is change the executing user to have the mail come from another user. But I don't understand why this would be a problem.
- 01-03-2010 #3Just Joined!
- Join Date
- Jul 2009
- Posts
- 4
its not a major problem but it would be nice to see my emails in my inbox coming from something other then "root".
i just thought there was a simple switch you could use to change the sent from user,
- 01-03-2010 #4Linux User
- Join Date
- Nov 2009
- Location
- France
- Posts
- 292
You may try this :
Edit your nail.rc file, perhaps /etc/nail.rc
Add these lines :
account test {
set from="fancy@valid.domain"
set smtp="your.smtp.server"
}
In your script, add the supplementary parameter
-A test
to your mail command.
Works for me using postfix.


Reply With Quote