Swedie's picture

How can I change the header info in emails sent via PHP?

Currently in the log i get a lot of:

Apr 15 10:39:08 lamp postfix/smtp[3274]: 821843F6007: host mail.comhem.basefarm.net[80.76.149.106] said: 451 Invalid sender <www-data@lamp> (in reply to RCPT TO command)
 

As you can see it denies the sender www-data@lamp ... but WHERE do I change this setting to something more appropriate?

Forum: 
Liraz Siri's picture

PHP manual on configuration mail settings: http://php.net/manual/en/mail.configuration.php

I'm going to assume PHP is configured to send mail via a locally installed mail server (e.g., postfix). You'll want to configure it so that instead of www-data@lamp, you're sending out mail as username@hostname.com.

If you're using postfix you can do that by setting up the myhostname parameter and to map www-data to a different username you'll want to setup a canonical map.

Configuring postfix will probably be a bit easier for you if you install the webmin-postfix module.

Hope this helps!

Swedie's picture

I did install postfix, and that apparently made the emails stop working. I re-installed sendmail and it now works again since I could google myself towards finding the right configs. So postfix is a replacement to sendmail? But what should I type in php.ini for value to sendmail_path ?

Add new comment