Question

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

From: should be: Web Site Name <admin@mywebsite.com>

But email is delivered to the address from:

World Wide Web Owner <www@mywebsite.com>

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

Charlie & <root@mywebsite.com>

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

root=postmaster@mywebsite.com
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?

Was it helpful?

Solution

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

OTHER TIPS

If you ahve problem with working of SSMTP try use MSMTP (work for me)

cat email.txt | msmtp --account=sender@mail.com --from=sender@mail.com -t adres@mail.com
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top