Return-path problem with the mail.module
| Project: | |
| Version: | 4.6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs work |
Jump to:
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
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
Good point.
probably a good idea to setup a new settings page field for it.