Results 1 to 6 of 6
Thread: Programming / Hostname problem
-
04-11-2004, 11:30 AM #1WHT Addict
- Join Date
- Oct 2000
- Location
- Canada
- Posts
- 115
Programming / Hostname problem
Hi everyone -
I currently have a Servermatrix server that a client is running a perl script on to send out email confirmations for site purchases. Previously the script was on a EV1 server and it worked fine - the script sent email with no problems, and the from account was being set as "sales@clientsdomain.com" correctly.
On the new server, however, all of the emails from this script are being sent with the server's hostname in the from field (eg. "sales@hostname.servername.com"). This is even though the script that my client is running implicitly sets the from field.
The only major change between the two is that the EV1 server was running sendmail, and the new one is running Exim. Is there something I can do, either in the script or on the server to get this to work?
Thanks,
Neil
-
04-17-2004, 01:56 PM #2Junior Guru Wannabe
- Join Date
- Sep 2003
- Location
- Canada
- Posts
- 97
I have same problem too, but i have no idea how to get it solve.
Henry
-
04-17-2004, 02:02 PM #3WHT Addict
- Join Date
- Oct 2000
- Location
- Canada
- Posts
- 115
I figured out the problem - you need to edit the exim.conf file and add trusted users that have permission to change the various headers. Scripts run as their owner, so if you have a script under a certain user's domain, adding their username into the trusted user will allow the script to change the from header.
In exim.conf, add the following somewhere after the main configuration area starts:
trusted_users = username1 : username2 : etc...
Someone else on this forum pointed out the answer to me, so I can't claim credit for this, but figured it would be helpful for you.
-
04-17-2004, 02:02 PM #4Registered User
- Join Date
- Feb 2004
- Posts
- 76
how can one fix a script without seeing a script ?
-
04-19-2004, 09:15 AM #5Junior Guru Wannabe
- Join Date
- Sep 2003
- Location
- Canada
- Posts
- 97
thank a lot buddy.
Henry
-
04-19-2004, 09:32 AM #6Web Hosting Evangelist
- Join Date
- Jul 2002
- Posts
- 500
You can also force a -f flag in the script, which will override the "From" field in the header. So for example:
-f youruser@domain.com
would override the from field which may have originally been: apache@server1.yourcompany.com.
To do this with PHP's mail() function, you must have safemode off.