WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 5 years ago

Last modified 5 years ago

#33946 closed enhancement (invalid)

Add pointy brackets to recipient adress of email notifications

Reported by: mnaef Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.3.1
Component: Mail Keywords:
Focuses: Cc:

Description

HTML emails trigger the TO_NO_BRKTS_HTML_ONLY (To: misformatted and HTML only) Spamassassin rule which scores 2 points.

Solution for mails being sent via php mail function:

--- ./wp-includes/class-phpmailer.old.php       2015-09-21 17:10:09.019559000 +0200
+++ ./wp-includes/class-phpmailer.php   2015-09-21 17:10:39.257980000 +0200
@@ -647,9 +647,9 @@
             $subject = $this->encodeHeader($this->secureHeader($subject));
         }
         if (ini_get('safe_mode') || !($this->UseSendmailOptions)) {
-            $result = @mail($to, $subject, $body, $header);
+            $result = @mail('<'.$to.'>', $subject, $body, $header);
         } else {
-            $result = @mail($to, $subject, $body, $header, $params);
+            $result = @mail('<'.$to.'>', $subject, $body, $header, $params);
         }
         return $result;
     }

Change History (3)

#1 @swissspidy
5 years ago

It should be noted that PHPMailer is an external class, so we can't simply change things there.

TO_NO_BRKTS_HTML_ONLY means: To: misformatted and HTML only.

So one problem is that you're sending HTML emails without a text fallback and you're passing misformatted addresses. Instead of test@example.com it should be John Doe <test@example.com> or test@example.com <test@example.com>. Either formatted email address can be passed to wp_mail().

Related: #17305

#2 @cbutlerjr
5 years ago

  • Resolution set to invalid
  • Status changed from new to closed

It should be noted that PHPMailer is an external class, so we can't simply change things there.

Based on that and the fact that this is due to passing misformatted addresses, should this be closed?

#3 @SergeyBiryukov
5 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.