How to change php send mail adres?

janton

Verified User
Joined
Sep 17, 2009
Messages
145
Hey All,

I got a simple question but i really can't figure it out.
Now when i send with php my email is send from:
[email protected]

i would like to make this:
[email protected]


i found the httpd.conf file in /usr/local/directadmin/data/users/NAME
with the following line:

php_admin_value sendmail_path '/usr/sbin/sendmail -t -i -f [email protected]'

i changes this to
php_admin_value sendmail_path '/usr/sbin/sendmail -t -i -f [email protected]'

and restarted httpd, BUT this was not the right one... because still no changes!


What file do i need to edit? Yes i know i can send FROM in php but that would be a workaround! (because i would always like to send emails with php from the support email adres)
 
I found the answer, but not really sure if this is nice or good?


i added

no_local_from_check
untrusted_set_sender = *

in my etc/exim.conf totally above in the document.



Can i do it like this? Is this not bad for the php mails? (perhaps they are reported as spam faster?)
 
i would suggest you to edit the virtual_host2.conf template in /usr/local/directadmin/data/templates/

well, not to edit it directly but to copy it in /usr/local/directadmin/data/templates/custom/ and make the changes you want and then rewrite httpd confs and restart apache.

To rewrite httpd confs do:
Code:
echo "action=rewrite&value=httpd" >> /usr/local/directadmin/data/task.queue
/usr/local/directadmin/dataskq d

Regards
 
yes i think we posted my solution and your reaction on the same time...

I guess i was looking for a way to get rid if the server sender, your solution doesn't do that i think? i mean this would do simular like i wrote in my first post from this topic? (only then the directadmin way)
 
My solution will apply the custom email for each existing domain and for each new domain will be added.

Edit a single user httpd.conf will be overwritten once directadmin rewrite confs (dont know if each night or each time a domain is added).

Regards
 
Looks like you're using PHP as CGI, thats why sendmail_path has vanished. Personally, I'd use mod_ruid over php_cgi.
 
Thanks for the answer.

But it not only not allowing the users home dirs its not allowing at all. Its not a problem for user home dirs. But if i want to install something like torrent flux or put a php file in to the /var/www/html what should i do cause its not working. And only way to enter this part with root. Is there any way i let suphp allows root to run php files.

Thanks for the assistance.
 
Back
Top