How to change sender name in ssmtp?

Artem picture Artem · Oct 5, 2014 · Viewed 9.3k times · Source

I have installed ssmtp on my Linux server. Apache server works under www-data user, and send mail from ssmtp. In recieved emails I see www-data in sender name. How can I change it?

Here`s my configs:

/etc/ssmtp/ssmtp.conf

mailhub=smtp.gmx.com:587
hostname=mysite.com
FromLineOverride=YES
[email protected]
AuthPass=password
UseTLS=YES
UseSTARTTLS=YES

/etc/ssmtp/revaliases

root:[email protected]
user:[email protected]
www-data:[email protected]

Answer

Yves picture Yves · May 17, 2015

You could change the user finger information for user 'www-data', namelly the 'Full Name" finger parameter.

You may do so using Linux 'chfn' command:

chfn -f "Email Sender Name" www-data

What this does is setting/changing the real name for that user in the finger information (stored in the /etc/passwd file -cf chfn man page-).

Alternatively you could use the Linux 'usermod' command as follow (though Linux manual states this is normally modified using the chfn utility - cf user mod man page - ):

usermod -c "Email Sender Name" www-data

This worked for me.