mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-25 16:22:43 +01:00
Remove PHPMailer code which generates bogus "Message-ID" email headers
Summary: See <https://discourse.phabricator-community.org/t/how-to-override-localhost-localdomain-in-email-message-id/3876/>. Currently, Phabricator generates a "Message-ID" only in a subset of cases (roughly: when the message is first-in-thread and we expect the thread may have more than one message). In cases where it does not generate a message ID, it expects the SMTP server to generate one for it. Servers will generally do this, and some ONLY do this (that is, they ignore IDs from Phabricator and replace them). Thus, several pieces of configuration control whether Phabricator attempts to generate a "Message-ID" at all. The PHPMailer code has fallback behavior which generates a "<random>@localhost.localdomain" message ID. This is never desirable and ignores Phabricator-level configuration that Message IDs should not be generated. For now, remove this code: it is never the desired behavior and sometimes explicitly contradicts the intent of configuration. Possibly, a better change may be to make Phabricator always generate a message ID in cases where it isn't forbidden from doing so by configuration. However, that's a more complicated change and it's not clear if/when it would produce better behavior, so start here for now. Test Plan: Confirmed by affected user (see linked thread). Differential Revision: https://secure.phabricator.com/D21272
This commit is contained in:
parent
4257b26abc
commit
9d5b8bd14a
1 changed files with 0 additions and 2 deletions
2
externals/phpmailer/class.phpmailer.php
vendored
2
externals/phpmailer/class.phpmailer.php
vendored
|
@ -1110,8 +1110,6 @@ class PHPMailer {
|
|||
|
||||
if($this->MessageID != '') {
|
||||
$result .= $this->HeaderLine('Message-ID',$this->MessageID);
|
||||
} else {
|
||||
$result .= sprintf("Message-ID: <%s@%s>%s", $uniq_id, $this->ServerHostname(), $this->LE);
|
||||
}
|
||||
$result .= $this->HeaderLine('X-Priority', $this->Priority);
|
||||
$result .= $this->HeaderLine('X-Mailer', 'PHPMailer '.$this->Version.' (phpmailer.sourceforge.net)');
|
||||
|
|
Loading…
Reference in a new issue