From: Tim Düsterhus Date: Mon, 15 Feb 2021 14:04:57 +0000 (+0100) Subject: Use stable Message-ID in MailWorker X-Git-Tag: 5.4.0_Alpha_1~252^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4e69d6c3ac67713ffc722d3cc0fa1e1b8a48c276;p=GitHub%2FWoltLab%2FWCF.git Use stable Message-ID in MailWorker --- diff --git a/wcfsetup/install/files/lib/system/worker/MailWorker.class.php b/wcfsetup/install/files/lib/system/worker/MailWorker.class.php index b1fa466c31..87112ff34c 100644 --- a/wcfsetup/install/files/lib/system/worker/MailWorker.class.php +++ b/wcfsetup/install/files/lib/system/worker/MailWorker.class.php @@ -59,6 +59,15 @@ class MailWorker extends AbstractWorker } $this->mailData = $userMailData[$this->parameters['mailID']]; + if (!isset($this->mailData['message-id'])) { + $this->mailData['message-id'] = \sprintf( + 'com.woltlab.wcf.mailWorker/%d/%s', + TIME_NOW, + \bin2hex(\random_bytes(8)) + ); + $userMailData[$this->parameters['mailID']] = $this->mailData; + WCF::getSession()->register('userMailData', $userMailData); + } } /** @@ -121,6 +130,7 @@ class MailWorker extends AbstractWorker public function execute() { $email = new Email(); + $email->setMessageID($this->mailData['message-id']); $email->setSubject($this->mailData['subject']); $from = new Mailbox( $this->mailData['from'],