Return-path problem with the mail.module

Dublin Drupaller - November 2, 2005 - 18:16
Project:Mail
Version:4.6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs work
Description

Hi,

(Apologies for posting this twice..but, there seems to be a scattered splurge of email related modules and this tip /patch applies to both the simplenews.module and the mail.module)

Just a quick one re: Return-Path issue with sending emails from a website....I'm not sure how prevelant or common this is or whether it's specific to my server, but I thought I would post in case it helps others:

The Problem
When sending an email using mail.module my server automatically picks up an apache@drupalsite.org email address and sets that as the RETURN-PATH in the sent email.

That's not good.

The Solution
Change line 182 in the activemaillib.php file that comes with mail.module from this:

if($serv[0]==true) $this->mailsent[$res]=mail($res, $this->mailsubj, $this->mailbody, $this->mailheaders);

to this:

if ($serv[0]==true) $this->mailsent[$res]=mail($res, $this->mailsubj, $this->mailbody, $this->mailheaders, '-f your@site.com');

Where your@site.com is the correct RETURN-PATH for your site.

As I mentioned earlier..I'm not too sure how common this is but, there it is for anyone who is experiencing the same problem.

Dub

#1

jo1ene - November 4, 2005 - 17:08
Status:reviewed & tested by the community» needs work

Am i seeing this right? The patch hard-codes the return email address? That's not good. It should extract it from the site settings or mail should create it's own return email setting.

#2

Dublin Drupaller - November 4, 2005 - 17:21

Good point.

probably a good idea to setup a new settings page field for it.

 
 

Drupal is a registered trademark of Dries Buytaert.