Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

modify Return-Path: with php mail()

Discussion in 'E-mail Discussion' started by h2oski, Mar 18, 2003.

  1. h2oski

    h2oski Well-Known Member

    Joined:
    Dec 12, 2001
    Messages:
    68
    Likes Received:
    0
    Trophy Points:
    306
    does anyone know a way to modify the Return-Path: address in mail sent with the php mail() function

    I have tried the -f user@domain.com
    And adding the Return-Path: user@domain.com to the headers paramater.


    for the life of me I can not get the Return-Path: to be anything other than nobody@server.name.com
     
  2. MarlboroMan

    MarlboroMan Well-Known Member

    Joined:
    Dec 7, 2001
    Messages:
    64
    Likes Received:
    0
    Trophy Points:
    306
    You don't use sendmail notation in the mail function. Take a look at the manual page for mail at PHP. The 3rd and 4th variables (I think) are used for adding headers, each seperated by a \r\n.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. pdxz

    pdxz Registered

    Joined:
    Feb 24, 2003
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    151
    Location:
    San Francisco
    although the 5th mail() option of -f user@domain.com, should take care of it- but it dosnt when the .php is being run by nobody (if called from a browser). Potentially you could use php+suexec.. or open a socket to your smtp server directly... i'm still wrestling with the problem myself.
     
  4. fgauthier

    fgauthier Member
    PartnerNOC

    Joined:
    Feb 22, 2003
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    151
    Hi,

    use the php 5th argument using -freturn@pathhere

    -f over write the return path, and you need to allow this in exim aswell,

    add in the exim conf:

    untrusted_set_sender = true

    OR

    truster_user = nobody

    it's as you wish...
     
  5. h2oski

    h2oski Well-Known Member

    Joined:
    Dec 12, 2001
    Messages:
    68
    Likes Received:
    0
    Trophy Points:
    306
    fgauthier,

    the exim config modification is exactly what I needed.

    does anyone know if there are any security issues with setting

    untrusted_set_sender = true

    ??

    Thanks
     
  6. fgauthier

    fgauthier Member
    PartnerNOC

    Joined:
    Feb 22, 2003
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    151
    hi,

    i have been using this for years without any problem :)

    I prefer untrusted_set_sender = true over setting up a truster user on nobody.

    Regards,
     
  7. vishal

    vishal Well-Known Member

    Joined:
    Jan 28, 2003
    Messages:
    340
    Likes Received:
    0
    Trophy Points:
    166
    Location:
    India
    where to add?

    Hello,

    Where do i add this untrusted_user in exim.conf?
    I mean under which section?

    Regards,
    :confused:
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. will123195

    will123195 Registered

    Joined:
    Sep 23, 2003
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    151
  9. ExtremeIS

    ExtremeIS Member

    Joined:
    Jul 11, 2003
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    151
    While using

    untrusted_set_sender = *

    DOES work, in my paranoia I used instead:

    untrusted_set_sender = *@+local_domains

    This restricts the setting of the address of the envelope sender to locally-delivered domains.

    (for reference, and in case my setup is somehow unique, local_domains is elsewhere defined as follows:
    domainlist local_domains = lsearch;/etc/localdomains
    )
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  10. Valetia

    Valetia Well-Known Member

    Joined:
    Jun 20, 2002
    Messages:
    213
    Likes Received:
    1
    Trophy Points:
    168
    cPanel Access Level:
    Root Administrator
    Tried inserting this directive into exim.conf:

    untrusted_set_sender = *

    ...and it still doesn't work with CGI scripts that send out email.

    The Return-path is still being replaced by:

    username@machine.name.com

    The server has both SuExec as well as phpSuExec enabled.

    What could be the problem? Why is it so difficult to get Exim to use the correct Return-path?
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice