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.

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 "www-data@mydomain.com" 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 "www-data@mydomain.com" & 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?

share|improve this question
add comment

2 Answers

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.

share|improve this answer
    
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. –  Usman Bashir Jan 12 '11 at 0:02
add comment

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.

share|improve this answer
add comment

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.