﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
14888	PHPMailer class uses wrong/no sender for mail envelope	gkusardi		"As an result following SMTP envelope and ""Return-Path"" email address can occur:

{{{apache@localhost.localdomain}}}

This will lead some mail servers to reject mails because of the not valid fqdn ""localhost.localdomain"".

Correctly the defined FROM address should be used, usually:

{{{'wordpress@'.$_SERVER['SERVER_NAME']}}}

In PHPMailer::CreateHeader() it is checked for

{{{if($this->Sender == '')}}}

The following will set the ""Return-Path"" in the mail headers, but NOT the envelope email address used in the SMTP handshake:

{{{$result .= $this->HeaderLine('Return-Path', trim($this->From));}}}

I fixed it by adding the following line after the mentioned one, setting the ""Return-Path"" in the mail header:
{{{$this->Sender = $this->From;}}}

So my condition looks like:
{{{
    if($this->Sender == '') {
      $result .= $this->HeaderLine('Return-Path', trim($this->From));
      $this->Sender = $this->From;
    } else {
      $result .= $this->HeaderLine('Return-Path', trim($this->Sender));
    }
}}}"	defect (bug)	new	normal	Future Release	External Libraries	3.0	normal		reporter-feedback has-patch close	westi Whissi bpetty knut@… ian_dunn@…
