Closed (fixed)
Project:
SMTP Authentication Support
Version:
4.7.x-1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
6 Nov 2006 at 03:27 UTC
Updated:
22 Dec 2007 at 00:01 UTC
The SMTP module is replacing the name area of the "From" portion of the email, even if the setting is filled out.
I'm using user_mail and I set the "from" portion (ex. "Jacob Redding ") but the email goes out "Website Submission
How do I prevent this?
Comments
Comment #1
LukeLast commentedI'm not exactly sure what "from" portion you are referring too. Are you adding
From: "Jacob Redding" <user@example.com>to the header?That is the only way to get a "from name" through the function.
Comment #2
Christoph C. Cemper commentedsames troubles here
Comment #3
Christoph C. Cemper commentedWell, after setting $SMTPDebug = 2
I see the problem is, that
if the header has a
in there it in fact does talk to the SMTP and passes in
and we get an
SMTP -> ERROR: MAIL not accepted from server: 501 <"myfirst mylast4"
>: "@" or "." expected after ""myfirst mylast4""
SMTP -> FROM SERVER
:
This MUST fail.
Now that I understand that smtp.module parses the headers falsly,
I understand the reason for this weird setting called "E-mail from Name:"
which overrides all From-Names with the Site-Name or some hardcoded crap from that parameter...
now that's what I call symptom-fixing-becauseof-lackofdebuggingskills
Comment #4
Christoph C. Cemper commentedstill trying to find out if this 4.7.x problem was fixed in the HEAD versions
Comment #5
Christoph C. Cemper commentedOk, that required me some debugging.
There was some dead code in the module, where it should actually handle addresses of that sytnax,
and it appears trailing characters (like space or \n or \r) made the reg'ex fail
I simply added a (.*) to the regex so changing
$regexp="/^From: (.*) <([a-z0-9]+([_\\.-][a-z0-9]+)*@([a-z0-9]+([\.-][a-z0-9]+)*)+\\.[a-z]{2,})>$/i"
to
$regexp="/^From: (.*) <([a-z0-9]+([_\\.-][a-z0-9]+)*@([a-z0-9]+([\.-][a-z0-9]+)*)+\\.[a-z]{2,})>(.*)$/i"
and it worked by just capturing the stuff behind the last > into a variable we never use...
Comment #6
Christoph C. Cemper commentedComment #7
scott.mclewin commentedWe appear to be chasing down similar problems but with differing solutions. I too get the badly formatted from header, but I resolved it differently.
http://drupal.org/node/195622
Which do you think is more appropriate? Or are they solving two truly independent problems?
Comment #8
oadaeh commentedCode in the comment does not qualify as a patch. See http://drupal.org/patch for more information.
Edit: I should mention that I will be working on correcting this, so sending a patch is not necessary.
Comment #9
oadaeh commentedThe fix for the from field problem has been committed here: http://drupal.org/cvs?commit=90638
I'm not sure if this corrects the problem Christoph C. Cemper is having, so if it doesn't please open a new issue.
Comment #10
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.