Results 1 to 3 of 3

Thread: Return-Path in php/apache mailing, is changing possible ?

  1. #1
    Join Date
    Oct 2007
    Posts
    31
    Rep Power
    8

    Default Return-Path in php/apache mailing, is changing possible ?

    Can somebody tell me how it is possible to change the return-path ?
    I don't want this address like it is now:

    apache@server-1.domain.tld

    But I would like to have this:

    info@domain.tld

    Is that possible ?
    I used this php script to test:

    Code:
    <?php
    $email_address_to = "myname@mydomain.tld";
    $subject = "Test email subject";
    $message_contents = "Hi! This is the content of the test message.";
    $header = "From: info@domain.tld\r\n";
    $header .= "Reply-To: info@domain.tld\r\n";
    $header .= "Return-Path: info@domain.tld\r\n";
    mail($email_address_to,$subject,$message_contents,$header);
    ?>
    But I get this is in my E-Mail headers:

    Return-Path: <apache@servername.domain.tld>

    servername.domain.tld is the hostname of the server btw

  2. #2
    Join Date
    Mar 2006
    Location
    Beaucaire, France
    Posts
    2,322
    Rep Power
    13

    Default

    Try this :
    PHP Code:
    <?php
    $email_address_to 
    "myname@mydomain.tld";
    $subject "Test email subject";
    $message_contents "Hi! This is the content of the test message.";
    $header "From: info@domain.tld\r\n";
    $header .= "Reply-To: info@domain.tld\r\n";
    $header .= "Return-Path: info@domain.tld\r\n";
    $myreturnpath "-finfo@domain.tld";
    mail($email_address_to,$subject,$message_contents,$header,$myreturnpath);
    ?>
    You have to tell sendmail (or the MTA you're using) this way (the -f parameter) because the header does not work...

  3. #3
    Join Date
    Oct 2007
    Posts
    31
    Rep Power
    8

    Default

    Thanks !
    That was the solution
    Great.

Similar Threads

  1. Errors installing Outlook Connector
    By Tim G in forum Zimbra Connector for Outlook
    Replies: 57
    Last Post: 05-05-2011, 02:27 PM
  2. [SOLVED] Changing the Backup Path
    By Nicrad in forum Administrators
    Replies: 8
    Last Post: 09-12-2007, 03:48 PM
  3. Error Installing Outlook Connector
    By DanO in forum Zimbra Connector for Outlook
    Replies: 17
    Last Post: 08-28-2007, 09:35 AM
  4. MTA is Dying after yum update
    By tonyawbrey in forum Administrators
    Replies: 27
    Last Post: 04-02-2006, 06:11 PM

Posting Permissions

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