2

I'm using the SSMTP mail server on my Ubuntu server to send emails from my PHP scripts using a 3rd party SMTP and all is working fine expect that the emails that are being sent have there from & reply-to email address set to "[email protected]" instead of the ones provided to the mail() function.

I all so have the "FromLineOverride" set to "YES" in the "ssmtp.conf". The only difference it seems to be making is that in the reply-to address it adds both the "[email protected]" & the email address provided to the mail() function.

I have looked over every setting I could find but it still keeps using the Apache2's process user account as the from address.

Does anyone know why this is happening?

2 Answers 2

5

I had the same issue on my new dedicated server, which came without Postfix, but with ssmtp. All mails were sent with process user name and hostname like : user@host

In /etc/ssmtp/ssmtp.conf file I just added the following directive : FromLineOverride=YES, and now it works like a charm.

BTW, I'm agree, what Postfix is much better, just it takes some time to configure it properly, and something we need just simple email send.

1

I don't know much about SSMTP anymore (used it once like 8 years ago) but in general these values are from the SMTP envelope (RCPT TO and MAIL FROM) itself outside your system.

This page seems to indicate you need to use 'revaliases':

http://forums.gentoo.org/viewtopic-t-420358-start-0.html

Honestly, SSMTP should be replaced by Postfix on your server if you can. Here's a quick link on getting the relay authentication configured:

http://www.freelock.com/kb/postfix-relayhost

Once you get that working, you can use all sorts of address rewriting and domain masquerading features that Postfix has to offer. A server isn't really a place you want to be using SSMTP, it was designed for people on home systems with dynamic dialups, laptops, etc. as the primary use case.

1
  • Thanks for the help but nothing helped in getting SSMTP working right so in the end I went with the Postfix server without relaying the emails through a 3rd part SMTP server. So now it sends the emails by its self which works just fine including the from & reply-to part granted if those address are provided by the PHP scripts. Jan 12, 2011 at 0:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .