modxcms / revolution

MODX Revolution - Content Management Framework
https://modx.com/
GNU General Public License v2.0
1.36k stars 528 forks source link

to/from in mailheader empty MODX 2.4.2/PHPMailer 5.2.13 #12756

Closed weitblick closed 7 years ago

weitblick commented 8 years ago

Since update PHPMailer to v5.2.13 "to:" and "from:" are not set in mailheader if set mail_use_smtp=true

cut out from mailheader (MODX 2.4.2): ... Received: from 46.252.18.127 by smtprelay04.ispgateway.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.84) (envelope-from noreply@weitblick.de) id 1ZuGgX-00048d-5a for kontakt@bienenkiste.de; Thu, 05 Nov 2015 10:18:21 +0100 Date: Thu, 5 Nov 2015 10:18:20 +0100 From: Reply-To: emk@weitblick.de Subject: [Test fiar] Kontaktformular Message-ID: 86e0bf3bef846a5150257ac372eee367@weitblick.de X-Mailer: PHPMailer 5.2.13 (https://github.com/PHPMailer/PHPMailer/) ...

cut out from mailheader (MODX 2.4.0): ... Received: from unknown (HELO scrat.ispgateway.de) (127.0.0.1) by localhost with SMTP; 5 Nov 2015 09:10:35 -0000 Received: (from u303766@localhost) by scrat.ispgateway.de (8.14.9/8.13.6/Submit) id tA59ASg8020778; Thu, 5 Nov 2015 10:10:28 +0100 From: noreply@weitblick.de To: kontakt@bienenkiste.de Subject: [Test fiar] Kontaktformular X-DFOptimize: BUFfRE5PRAUZGhkdHBx1GBgdHBsFXU9IWU9DXk9EBUdLWENLB0ZLS0lCBUlFWE8FR0VOT0YFR0VOUgVHS0NGBVpCWkdLQ0ZPWAVJRktZWQRaQlpHS0NGT1gEWkJa Date: Thu, 5 Nov 2015 10:10:28 +0100 Reply-To: emk@weitblick.de Message-ID: 69b39d7999552463a2a5755d66589e8d@weitblick.de X-Priority: 3 X-Mailer: PHPMailer 5.2.8 (https://github.com/PHPMailer/PHPMailer/) ...

pixelchutes commented 8 years ago

I cannot reproduce. Tested to:, from:, and replyto: in MODX 2.4.3-dev:

From: Test User user@gmail.com X-Google-Original-From: Test User user@gmail.com Date: Sat, 14 Nov 2015 07:20:18 -0700 To: user@gmail.com Reply-To: Test User user@gmail.com Subject: Testing PHPMailer from FormIt Message-ID: 59d1c22a7f0f7d213c63adcd65b89abc@www.gmail.com X-Mailer: PHPMailer 5.2.13 (https://github.com/PHPMailer/PHPMailer/) MIME-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

Are you using a particular snippet to handle sending the mail? (Looks like FormIt AutoResponder?) Is it using modMail?

weitblick commented 8 years ago

Yes, it is simple FormIt and it happens even if you create a new user and select "password via email": the system mail of modx looks the same. It happens at every website after the update to MODX 2.4.2. Before ist works, after there is no to/from anymore.

I use mail_smtp_prefix=ssl, mail_smtp_port=465 (smtp config see attachment). If you are interested I send you a test user account on this server.

screenshot

weitblick commented 8 years ago

new test after update to MODX 2.5.0 (PHPMailer 5.2.14) with two different mailproviders and with/without ssl: the same! To try, I use the "send new password" button at manager. The "to" field stays always empty.

pixelchutes commented 8 years ago

What version of PHP?

weitblick commented 8 years ago

I tested on php 5.5.3 and 5.6.12 When I copy manually back an older version (5.2.8) of core/model/modx/mail/phpmailer/class.phpmailer.php into the not correct working version of MODX 2.4.2 (and higher), the mails are sent correct again.

weitblick commented 7 years ago

I tested with MODX 2.5.4: the same (empty "To:" in header). And finally I found the solution/reason: The systemsetting "mail_smtp_single_to" must be "no". If you use smtp AND mail_smtp_single_to=yes it causes an empty "To:" in mailheader.