hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Hosting Security and Technology : Email Header - How to change Return Path
Reply

Hosting Security and Technology Configuring and optimizing web hosting servers and operating systems, developing administration scripts, building servers, protecting against hackers, and general security (SSL certificates, etc.)
Forum Jump

Email Header - How to change Return Path

Reply Post New Thread In Hosting Security and Technology Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 11-23-2004, 06:13 PM
hostchamp hostchamp is offline
Web Hosting Master
 
Join Date: Aug 2002
Posts: 647

Email Header - How to change Return Path


This happens with all php and cgi formail scripts hosted on my server. When one submits a form the "Return path" email header carries our email address; apache@www.server.com . Now i understand all bounced message will be received by apache@www.server.com instead of the domain which hosts the formmail script.

My MTA is Sendmail. We do not use Cpanel or any other Control panel.

What is the solution?

Reply With Quote


Sponsored Links
  #2  
Old 11-23-2004, 07:05 PM
ambirex ambirex is offline
Web Hosting Master
 
Join Date: Nov 2001
Posts: 551
From the manual: http://us2.php.net/manual/en/function.mail.php

PHP Code:
<?php
mail
("nobody@example.com""the subject"$message,
     
"From: webmaster@{$_SERVER['SERVER_NAME']}\r\n" .
     
"Reply-To: webmaster@{$_SERVER['SERVER_NAME']}\r\n" .
     
"X-Mailer: PHP/" phpversion());
?>
also, you can set it with your php.ini file or ini_set() function:
http://us2.php.net/manual/en/ref.mail.php

Reply With Quote
  #3  
Old 11-23-2004, 07:12 PM
Zadmin Zadmin is offline
WHT Addict
 
Join Date: Aug 2004
Posts: 126
well add extra headers to ur php like this

Code:
<?php
mail("nobody@example.com", "the subject", $message,
     "From: webmaster@{$_SERVER['SERVER_NAME']}\r\n" .
     "Reply-To: webmaster@{$_SERVER['SERVER_NAME']}\r\n" .
     "X-Mailer: PHP/" . phpversion());
?>

Reply With Quote
Sponsored Links
  #4  
Old 11-23-2004, 07:34 PM
hostchamp hostchamp is offline
Web Hosting Master
 
Join Date: Aug 2002
Posts: 647
I am not sure if i made myself clear. For instance please review a sample cgi formmail script submitted from one of my customer domains hosted on my server.

---------------------------------
Return-Path: <apache@www.myhostingservername.com>
Received: (from apache@localhost)
To: recipient@domain.com
From: sender@somename.com
-----------------------------------

In the above formmail script; the recipient address is set as recipient@domain.com, however please note the following header which the Sendmail MTA appends to all php and cgi form mail scripts;
Return-Path: <apache@www.myhostingservername.com>

How do you set the "Return-Path" header to be same as the recipient email address.

Do note that this is not script dependent but MTA (Sendmail) dependent as far i know.


Last edited by hostchamp; 11-23-2004 at 07:39 PM.
Reply With Quote
  #5  
Old 11-24-2004, 02:01 AM
davevad davevad is offline
WHT Addict
 
Join Date: May 2004
Location: Hungary
Posts: 106
Add this to the Apache virtualhost part:
php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -f example@example.com"
You can use it in the mail() function as well, as fourth variable after the mail body. If I'm not mistaken you have to write: -f example@example.com (without "-s)

__________________
Webpresence Ltd.
http://www.1gbit.info
http://hosting.webenlet.com

Reply With Quote
  #6  
Old 11-24-2004, 08:48 AM
hostchamp hostchamp is offline
Web Hosting Master
 
Join Date: Aug 2002
Posts: 647
Quote:
Originally posted by davevad
Add this to the Apache virtualhost part:
php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -f example@example.com"
You can use it in the mail() function as well, as fourth variable after the mail body. If I'm not mistaken you have to write: -f example@example.com (without "-s)
I guess this should fix it, many thanks for this much needed tip mate!

Reply With Quote
  #7  
Old 11-24-2004, 08:51 AM
hostchamp hostchamp is offline
Web Hosting Master
 
Join Date: Aug 2002
Posts: 647
Dave another question:

This would do the trick for php based formmail scripts.

What would be solution for cgi/perl based formmail scripts?

Is there a virtualhost directive for cgi as well?

Reply With Quote
Reply

Related posts from TheWhir.com
Title Type Date Posted
Strategies to Reduce Operating Costs, Avoid Email Blacklisting and Improve Deliverability Webinars 2013-05-15 11:27:46
50dae337-dae4-44bb-8bd2-23d945a79962 Listing 2013-03-05 18:24:34
50d0d1f2-f254-44ec-a69a-695345a799a0 Listing 2013-03-05 18:26:06
Could Microsoft's New Outlook.com Webmail Service Change User Expectations about Email? Web Hosting News 2012-08-03 11:24:20
Web Host Rackspace Adds New Features to Cloud Load Balancer Web Hosting News 2011-09-16 16:35:04


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?