Page 1 of 4 123 ... LastLast
Results 1 to 10 of 31

Thread: Changing the return path

  1. #1
    Join Date
    Apr 2006
    Location
    Amsterdam
    Posts
    352
    Thanks
    20
    Thanked 11 Times in 11 Posts

    Default Changing the return path

    Does anyone have any experience in changing the return-path?

    The default retrun-path seems to be phpmail_<domain>@periodicnetwork.com. I've tried :
    Code:
    ini_set("sendmail_from",$return_path);
    But that doesnt seem to have any effect. Is that correct Warren?

    Are there other ways to change the retrun-path in PHP?

    [orginal post]Do need to flag (using the fifth parameter to mail, -f) if I want to change the return path in PHP()?[/]
    Last edited by Rappie; 21st August 2008 at 01:02 PM. Reason: changing the question

  2. #2
    Join Date
    Feb 2004
    Posts
    4,903
    Thanks
    2
    Thanked 134 Times in 113 Posts

    Default

    Use the PHP mail() headers parameter:

    PHP Code:
    <?php
    $to 
    'nobody@example.com';
    $subject 'the subject';
    $message 'hello';
    $headers 'From: webmaster@example.com';

    mail($to$subject$message$headers);
    ?>
    Warren Ashcroft
    Red Fox UK Limited - Pioneers in Internet Technology
    http://www.redfoxuk.com
    w.ashcroft [at] redfoxuk.com

    NOTE: Forum Private Messaging should not be used to contact staff with support queries.

  3. #3
    Join Date
    Apr 2006
    Location
    Amsterdam
    Posts
    352
    Thanks
    20
    Thanked 11 Times in 11 Posts

    Default

    Quote Originally Posted by Warren Ashcroft View Post
    Use the PHP mail() headers parameter:
    No luck

    The return-path is still the same: phpmail_<domain>@periodicnetwork.com.

    Code:
    Received: from wsspam03.livemail.com ([123.0.120.95]) by livemail.com  with MailEnable ESMTP; Thu, 21 Aug 2008 17:36:05 +0200
    X-Barracuda-URL: http://123.0.120.95:80/cgi-bin/mark.cgi
    Received: from xenon.lon.periodicnetwork.com (localhost [127.0.0.1])
     by wsspam03.livemail.com (Spam Firewall) with ESMTP id 454F536F2A9
     for <my-mail@domain.com>; Thu, 21 Aug 2008 17:36:53 +0200 (CEST)
    Received: from xenon.lon.periodicnetwork.com (xenon.lon.periodicnetwork.com [83.245.63.100]) by wsspam03.livemail.com with ESMTP id lIuHPHPRDa1LbxuA for <my-mail@domain.com>; Thu, 21 Aug 2008 17:36:53 +0200 (CEST)
    Received: from xenon ([127.0.0.1]) by xenon.lon.periodicnetwork.com with Microsoft SMTPSVC(6.0.3790.3959);
      Thu, 21 Aug 2008 16:36:53 +0100
    Date: Thu, 21 Aug 2008 16:36:53 +0100
    X-Barracuda-BBL-IP: 127.0.0.1
    X-Barracuda-RBL-IP: 127.0.0.1
    X-ASG-Orig-Subj: the subject
    Subject: the subject
    To: my-mail@domain.net
    From: webmaster@example.com
    Message-ID: <XENONBJHsxPCFj2AhGw0000043d@xenon.lon.periodicnetwork.com>
    Return-Path: <phpmail_domain.com@periodicnetwork.com>
    Last edited by Rappie; 21st August 2008 at 08:22 PM.

  4. #4
    Join Date
    Feb 2004
    Posts
    4,903
    Thanks
    2
    Thanked 134 Times in 113 Posts

    Default

    Then change that one also

    PHP Code:
    <?php 
    $to 
    'nobody@example.com'
    $subject 'the subject'
    $message 'hello'
    $headers 'From: webmaster@example.com' '\r\n' 'Return-Path: webmaster@example.com'

    mail($to$subject$message$headers); 
    ?>
    Warren Ashcroft
    Red Fox UK Limited - Pioneers in Internet Technology
    http://www.redfoxuk.com
    w.ashcroft [at] redfoxuk.com

    NOTE: Forum Private Messaging should not be used to contact staff with support queries.

  5. #5
    Join Date
    Apr 2006
    Location
    Amsterdam
    Posts
    352
    Thanks
    20
    Thanked 11 Times in 11 Posts

    Default

    Quote Originally Posted by Warren Ashcroft View Post
    Then change that one also
    It doesnt change anything. The same return-path is still being used: phpmail_<domain>@periodicnetwork.com.

    Code:
    Received: from wsspam03.livemail.com ([123.0.120.95]) by livemail.com with MailEnable ESMTP; Thu, 21 Aug 2008 22:35:04 +0200
    X-ASG-Debug-ID: 1219350953-406f012e0000-Y0bWxX
    X-Barracuda-URL: http://193.93.174.91:80/cgi-bin/mark.cgi
    Received: from xenon.lon.periodicnetwork.com (localhost [127.0.0.1])
     by wsspam03.livemail.com (Spam Firewall) with ESMTP id 92DA164CEAA
     for <my-mail@domain.net>; Thu, 21 Aug 2008 22:35:53 +0200 (CEST)
    Received: from xenon.lon.periodicnetwork.com (xenon.lon.periodicnetwork.com [123.0.120.95]) by wsspam03.livemail.nl with ESMTP id nWuD59cR49lYH6YK for <my-mail@domain.net>; Thu, 21 Aug 2008 22:35:53 +0200 (CEST)
    Received: from xenon ([127.0.0.1]) by xenon.lon.periodicnetwork.com with Microsoft SMTPSVC(6.0.3790.3959);
      Thu, 21 Aug 2008 21:35:54 +0100
    Date: Thu, 21 Aug 2008 21:35:54 +0100
    X-Barracuda-BBL-IP: 127.0.0.1
    X-Barracuda-RBL-IP: 127.0.0.1
    X-ASG-Orig-Subj: the subject
    Subject: the subject
    To: my-mail@domain.net
    From: webmaster@example.com
    Message-ID: <XENONIiGXix4A2DreBB00000456@xenon.lon.periodicnetwork.com>
    Return-Path: <phpmail_<domain>@periodicnetwork.com>

  6. #6
    Join Date
    Feb 2004
    Posts
    4,903
    Thanks
    2
    Thanked 134 Times in 113 Posts

    Default

    Even when you specify the Return-Path header for mail()?
    Warren Ashcroft
    Red Fox UK Limited - Pioneers in Internet Technology
    http://www.redfoxuk.com
    w.ashcroft [at] redfoxuk.com

    NOTE: Forum Private Messaging should not be used to contact staff with support queries.

  7. #7
    Join Date
    Apr 2006
    Location
    Amsterdam
    Posts
    352
    Thanks
    20
    Thanked 11 Times in 11 Posts

    Default

    Unfortunately, Yes. I've tested it with the code you provided above. Adding Return-Path header doenst make much differences. I did some more tetsing.

    When I send test mails to mailboxes on MailEnable, LotusNotus or SmarterMail systems the Return-Path stays: phpmail_<domain>@periodicnetwork.com

    Strangely though,

    With Gmail and Hotmail the custom Return-Path does get added to the header. But unfortunately so is the default retrun-path: phpmail_<domain>@periodicnetwork.com

    Code:
    Delivered-To: my-gmail@gmail.com
    Received: by 10.150.198.16 with SMTP id v16cs218708ybf;
            Fri, 22 Aug 2008 05:33:25 -0700 (PDT)
    Received: by 10.210.136.10 with SMTP id j10mr1448466ebd.43.1219408404364;
            Fri, 22 Aug 2008 05:33:24 -0700 (PDT)
    Return-Path: <phpmail_domain@periodicnetwork.com>
    Received: from xenon.lon.periodicnetwork.com (xenon.lon.periodicnetwork.com [83.245.63.100])
            by mx.google.com with ESMTP id j8si4985896gvb.1.2008.08.22.05.33.22;
            Fri, 22 Aug 2008 05:33:24 -0700 (PDT)
    Received-SPF: pass (google.com: domain of phpmail_domain@periodicnetwork.com designates 83.245.63.100 as permitted sender) client-ip=83.245.63.100;
    Authentication-Results: mx.google.com; spf=pass (google.com: domain of phpmail_domain@periodicnetwork.com designates 83.245.63.100 as permitted sender) smtp.mail=phpmail_domain@periodicnetwork.com
    Received: from xenon ([127.0.0.1]) by xenon.lon.periodicnetwork.com with Microsoft SMTPSVC(6.0.3790.3959);
    	 Fri, 22 Aug 2008 13:33:26 +0100
    Date: Fri, 22 Aug 2008 13:33:26 +0100
    Subject: the subject
    To: my-gmail@gmail.com
    From: webmaster@example.com
    Return-Path: webmaster@example.com
    Message-ID: <XENONoTR3The0h2Wn9o0000046f@xenon.lon.periodicnetwork.com>
    X-OriginalArrivalTime: 22 Aug 2008 12:33:26.0372 (UTC) FILETIME=[46393240:01C90453]

  8. #8
    Join Date
    Mar 2005
    Location
    Isle of Man
    Posts
    1,261
    Thanks
    3
    Thanked 24 Times in 24 Posts

    Default

    I can confirm this, it is picking up the value from the local sendmail_from variable, and ignoring anything you try and set in the script.
    There was a bug report on something similar a long while ago: http://bugs.php.net/bug.php?id=28976
    Last edited by nick; 22nd August 2008 at 01:35 PM. Reason: ignore that last bit. long day

  9. #9
    Join Date
    Apr 2006
    Location
    Amsterdam
    Posts
    352
    Thanks
    20
    Thanked 11 Times in 11 Posts

    Default

    Thanks Nick for the confirmation.

    What I am after is getting bounced emails routed back to the sender or the original Return-path address. Searching google I quickly found that adding Return-Path to the header doenst do anything at all. (nothing usefull anyway).

    Its the ini_set("sendmail_from",$return_path); that will do all the magic. I've successfully tested it on another server. It will change the retrun-path and allow me to receive bounced emails. But it seems to be disabled on RFH. Can you confirm this Warren?

  10. #10
    Join Date
    Feb 2004
    Posts
    4,903
    Thanks
    2
    Thanked 134 Times in 113 Posts

    Default

    Nothing is disabled in PHP on our shared web servers, try changing the INI setting and then outputting a phpinfo() - does it show the new address?
    Warren Ashcroft
    Red Fox UK Limited - Pioneers in Internet Technology
    http://www.redfoxuk.com
    w.ashcroft [at] redfoxuk.com

    NOTE: Forum Private Messaging should not be used to contact staff with support queries.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. changing nameserver
    By slippers in forum Technical Support
    Replies: 4
    Last Post: 11th May 2007, 10:23 AM
  2. changing file permissions
    By Space Cowboy in forum General Technical Support
    Replies: 6
    Last Post: 3rd April 2007, 06:43 PM

Bookmarks

Posting Permissions

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