sSMTP rewriting "From" field in emails

Scott picture Scott · Dec 3, 2012 · Viewed 11.7k times · Source

My problem is that whenever my server sends emails, the sender field gets overwritten.

From: should be: Web Site Name <[email protected]>

But email is delivered to the address from:

World Wide Web Owner <[email protected]>

Or while sending the emails from the root in the SSH:

Charlie & <[email protected]>

My /etc/ssmtp/ssmtp.conf configuration file content:

[email protected]
mailhub=ssl0.ovh.net:465

rewriteDomain=mywebsite.com
hostname=mywebsite.com
realname = "Web Site Name"

AuthUser=postmaster%mywebsite.com
AuthPass=removed
UseTLS=YES

How can I instruct ssmtp not to change From: fields in emails? Or just define the From: anywhere?

Answer

dan_s picture dan_s · Dec 3, 2012

Try adding FromLineOverride=YES in your ssmtp.conf, if you don't set this the from address will be overwritten since the default value should be set to "NO".

  • YES: Allow the user to specify their own From: address
  • NO: Use the system generated From: address