Community Add-Ons

Add file to this package
Top » Other

fix emails bounced due to return path
for osCommerce Online Merchant v2.2

Download
by / 22 Mar 2007

If you find that emails sent by osCommerce are bouncing back to you check to see if the return path set by your web server reads something like anonymous@yourdomainname.com. Many spam filters these days don't like email coming from anonymous users. If you have this problem osCommerce makes it easy to fix so you can add your own return path. All you need to do is modify one line in the two general.php function files.

Under catalog/includes/functions/general.php file find the function tep_mail and scroll down until you find the line that reads:

$message->send($to_name, $to_email_address, $from_email_name, $from_email_address, $email_subject);

and change it to read

$message->send($to_name, $to_email_address, $from_email_name, $from_email_address, $email_subject,'Return-Path: <' . $from_email_address . '>');

Do the same thing in the catalog/admin/includes/functions/general.php file.

Legend:  Download   Report

Expand All / Collapse All

fix emails bounced due to return path 22 Mar 2007  

If you find that emails sent by osCommerce are bouncing back to you check to see if the return path set by your web server reads something like anonymous@yourdomainname.com. Many spam filters these days don't like email coming from anonymous users. If you have this problem osCommerce makes it easy to fix so you can add your own return path. All you need to do is modify one line in the two general.php function files.

Under catalog/includes/functions/general.php file find the function tep_mail and scroll down until you find the line that reads:

$message->send($to_name, $to_email_address, $from_email_name, $from_email_address, $email_subject);

and change it to read

$message->send($to_name, $to_email_address, $from_email_name, $from_email_address, $email_subject,'Return-Path: <' . $from_email_address . '>');

Do the same thing in the catalog/admin/includes/functions/general.php file.

Comment (reported 2007-11-25):

this 'fix' is incorrect. it adds a variable to a function send() and does not alter the actual php mail() command.

problem involves servers with safe_mode = on and not using 5th field in mail() function

1) server must have safe_mode = OFF in order to use 5th parameter in mail()
2) open /class/email.php

FIND:

return mail($to, $subject, $this->output, 'From: '.$from.$this->lf.implode($this->lf, $this->headers).$this->lf.implode($this->lf, $xtra_headers));

REPLACE WITH:

$params = "-f$from_addr";
return mail($to, $subject, $this->output, 'From: '.$from.$this->lf.implode($this->lf, $this->headers).$this->lf.implode($this->lf, $xtra_headers), $params);