#33946 closed enhancement (invalid)
Add pointy brackets to recipient adress of email notifications
| Reported by: | mnaef | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Version: | 4.3.1 | |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
It should be noted that
PHPMaileris an external class, so we can't simply change things there.TO_NO_BRKTS_HTML_ONLYmeans: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.comit should beJohn Doe <test@example.com>ortest@example.com <test@example.com>. Either formatted email address can be passed towp_mail().Related: #17305