From 4e69d6c3ac67713ffc722d3cc0fa1e1b8a48c276 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Mon, 15 Feb 2021 15:04:57 +0100 Subject: [PATCH] Use stable Message-ID in MailWorker --- .../files/lib/system/worker/MailWorker.class.php | 10 ++++++++++ 1 file changed, 10 insertions(+) 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'], -- 2.20.1