Ticket #618 (new Defect)

Opened 3 months ago

Last modified 3 months ago

Inconsistency between EMAIL_FROM and EMAIL_FROM_NAME in email.inc

Reported by: tstrunk Assigned to: davea
Priority: Trivial Milestone: Undetermined
Component: Web - Project Version:
Keywords: patch Cc:

Description

In WebConfig the documentation states:

EMAIL_FROM 
    'from' address for emails 
EMAIL_FROM_NAME 
    'from' name for emails 

PHP-Mailer respects these options; the internal php mail command does not:
email.inc (49-50):

        if (defined('EMAIL_FROM')) {
            $headers = "From: ". EMAIL_FROM;

should be:

        if ( defined('EMAIL_FROM') && defined('EMAIL_FROM_NAME') ) {
            $headers = "From: ".EMAIL_FROM_NAME."@".EMAIL_FROM;

Otherwise by specifying for example on host: "hostnumber1.com":
EMAIL_FROM - "hostnumber2.de"
EMAIL_FROM_NAME - "correct_username"

a password retrieval mail would be mailed to: hostnumber2.de@hostnumber1.com

Revision is 14746

Change History

04/09/08 08:01:06 changed by Nicolas

EMAIL_FROM is the full email address, not the hostname. EMAIL_FROM_NAME is the "displayed" name.

It should be:

        if ( defined('EMAIL_FROM') && defined('EMAIL_FROM_NAME') ) {
            $headers = "From: ".EMAIL_FROM_NAME." <".EMAIL_FROM.">";

So that with:

EMAIL_FROM - "fooproject@hostnumber2.de"
EMAIL_FROM_NAME - "Foo project admin" 

It gets sent with:

From: Foo project admin <foohome@hostnumber2.de>

I'm not too sure if EMAIL_FROM_NAME would work correctly if it had an @ sign, as would be common to use "Foo@Home admin"...

04/10/08 04:30:22 changed by tstrunk

Ah, yes - I misunderstood the documentation there. Thanks for clearing it up.

04/18/08 16:58:36 changed by Nicolas

  • keywords set to patch.

There is still a bug; although the fix is not what you initially suggested.


If this page is incomplete or incorrect, please edit it or add it to the wiki to-do list. To do this, you must be logged in; click Login or Register above.