View Single Post
  #4  
Old 28th January 2012, 18:57
erosbk erosbk is offline
Senior Member
 
Join Date: Mar 2011
Posts: 337
Thanks: 49
Thanked 36 Times in 30 Posts
Default

If you are using postfix, you could try this:

Create this file:
echo "www-data@www1.internet-content.net no-reply@internet-content.com.ar" >> /etc/postfix/sender_canonical

Next, run the following commands:

postmap hash:/etc/postfix/sender_canonical
postconf -e "sender_canonical_maps=hash:/etc/postfix/sender_canonical"

Finally, restart postfix
/etc/init.d/postfix restart

Try to send mail and post results here.

This will change www-data for no-reply, but it will work for every site in the same way...

If you want to have a different behavior per site, you must declare a path por sendmail in php.ini, create a script to intercept mail, validate from direction, if it is "www..." you must consult which domain is seding mail (I don't know is the are available variables for this in sendmail, but I think you can get path of file sending mail and with that get the sender domain) and as a final step, replace to "from" of the mail.

Regards
Reply With Quote