use php mail function to send email is now sent by user@server-hostname

jackc

Verified User
Joined
Jan 19, 2007
Messages
347
It's been changed for a while, not like the old way the emails were sent by user@userdomain, now all are user@server-hostname, is it possible to change to back to the old way?
 

jackc

Verified User
Joined
Jan 19, 2007
Messages
347
so if I want sendmail act like running cli I have to change php.ini for every user? that's kinda difficult to do :(
 

smtalk

Administrator
Staff member
Joined
Aug 22, 2006
Messages
8,339
Location
LT, EU
Difficult? :) Set /home/user/domains/domain.com for php.ini and execute:
Code:
for u in `ls /usr/local/directadmin/data/users`; do
{
    for d in `cat /usr/local/directadmin/data/users/$u/domains.list`; do
    {
        touch /home/$u/domains/$d/php.ini; echo "sendmail_path=\"/usr/sbin/sendmail -t -i -f $u@$d\"" >> /home/$u/domains/$d/php.ini;
    }
    done;
}
done;
 

jackc

Verified User
Joined
Jan 19, 2007
Messages
347
I was setting up only one php.ini for every user, I guess I need to change my setup a bit to make this work.

thanks! appreciate your help.
 

rtaylor

Verified User
Joined
Aug 9, 2007
Messages
153
I was setting up only one php.ini for every user, I guess I need to change my setup a bit to make this work.
With suPHP the user's php.ini files only need the settings that they want to change from your system's main php.ini, not an entire copy. Also, be sure that everyone knows not to use php_flag in .htaccess files or the infamous 500 error will rear it's ugly head.
 

nobaloney

NoBaloney Internet Svcs - In Memoriam †
Joined
Jun 16, 2003
Messages
26,119
Location
California
It's not a fault; it's a byproduct of suPHP running the script as the user.

You should be able to change the default behavior by adding the users to exim.conf as trusted users; then exim should allow those users to change the email sender.

Don't forget to restart exim after any change to exim.conf

Try it and post here with your results.

Thanks.

Jeff
 

nobaloney

NoBaloney Internet Svcs - In Memoriam †
Joined
Jun 16, 2003
Messages
26,119
Location
California
I should have found that :(.

Should I implement that in the new exim.conf file? Probably, I'd think.

What do you think?

Jeff
 

Dennis

Verified User
Joined
Nov 13, 2004
Messages
123
Location
The Netherlands
Hi Jeff,

this is a post from long ago.....but why is it never added to the exim.conf? Is it a security issue? Or something else?

I think it is a very good idea. Do not want to add every user in the "trusted users list" and restart exim. I have recently changed to the a newer version of SPAMBlocker 3 and it is not implemented in the exim.conf.

I also found the solution in the forum for the "On behalf of" with suPHP settings. Can you add something about the:

local_from_check = false

option in the exim.conf? (Commented ofcourse)

Regards,

Dennis
 
Last edited:

nobaloney

NoBaloney Internet Svcs - In Memoriam †
Joined
Jun 16, 2003
Messages
26,119
Location
California
It fell off my radar until yesterday; it's now in my personal RC and will be added to the next RC and to the final release.

Can you please direct me to the local_from_check documentation; I'm just too busy to look right now.

I've moved this thread so I'll find it as I finish my final release.

Jeff
 

Dennis

Verified User
Joined
Nov 13, 2004
Messages
123
Location
The Netherlands
No problem, glad to help.

All credit goes to BigWil, he also mentioned it in his suggestions for the new Spamblocker config. Anyway...

The post by BigWil in the custombuild thread:
local_from_check solution post

The info from the Exim website at this link:
43.12. The Sender: header line (Search for "43.12")

I have tested and later implemented it on my servers. The scripts now do not email with my server hostname or the text "on behalf of". Configuration is suPHP and PHP 5.2.xx. I think it works with every other version or server....because it is in the exim config itself.

Regards,

Dennis
 
Top