Forum Discussion

Nicolas's avatar
Nicolas
Icon for Nimbostratus rankNimbostratus
Jul 31, 2017

change from address in mail command

Hey All,

 

I've wrote a script that in one part it send email using the following command

 

mail -s "subject" recipient@xxx.xxx

 

I want to know how can I change the sender by default it take the user root@f5_domain.

 

F5 version is 12.1.1HF1

 

I've noticed taht in this version i cant change ssmtp.conf manualy.

 

Thanks Nicolas

 

2 Replies

  • Hello Nicolas,

    Try using the -r argument

      -r address
                  Sets the From address. Overrides any from variable specified in environment or startup files.  Tilde escapes are disabled.  The -r address options are passed to the mail transfer agent unless SMTP is
                  used.  This option exists for compatibility only; it is recommended to set the from variable directly instead.