Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

My root user send emails with ssmtp. However I can't change "From: root ..." root name. Is there any way to send email with another name without using another user?

Tried:

echo 'From: "New name" ' | ssmtp to@gmail.com -v

share|improve this question

5 Answers 5

You can set up a reverse alias in /etc/ssmtp/revaliases

root:someone@yourdomain.tld

it's hidden at the bottom of the man page.

share|improve this answer

I suggest you switch from ssmtp to msmtp since ssmtp is not actively developed any more. msmtp provides all the same features as ssmtp plus more. In particular, with msmtp you can set the from setting to control who the mail appears to be sent from.

share|improve this answer

Add the following in Your /etc/ssmtp/ssmtp.conf file and You will capable to set any name and email during runtime :

FromLineOverride=YES
share|improve this answer

Looks like FromLineOverride=YES doesn't work anymore.

I guess GMAIL is not allowing this now. But I am not sure.

share|improve this answer

Try option -Ffull_name, ex:

ssmtp login@mail.com -F"Look at me" 

i'll change full name.
there is also -f for changing sender email, ex:

ssmtp -f"helper@world" -F"SuperHero" save@our.world
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.