Results 1 to 6 of 6
  1. #1
    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

  2. #2
    Join Date
    Sep 2003
    Location
    Canada
    Posts
    97
    I have same problem too, but i have no idea how to get it solve.
    Henry

  3. #3
    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.

  4. #4
    how can one fix a script without seeing a script ?

  5. #5
    Join Date
    Sep 2003
    Location
    Canada
    Posts
    97
    thank a lot buddy.
    Henry

  6. #6
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •