#33946 closed enhancement (invalid)
Add pointy brackets to recipient adress of email notifications
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.3.1 |
Component: | 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)
Note: See
TracTickets for help on using
tickets.
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 beJohn Doe <test@example.com>
ortest@example.com <test@example.com>
. Either formatted email address can be passed towp_mail()
.Related: #17305