mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-20 02:42:23 +09:00
Reset Message-ID in case send() is called multiple times
This commit is contained in:
parent
bdd00fe6b7
commit
0b20f3f5c7
1 changed files with 6 additions and 0 deletions
|
|
@ -542,6 +542,12 @@ class Mail
|
|||
*/
|
||||
public function send()
|
||||
{
|
||||
// Reset Message-ID in case send() is called multiple times.
|
||||
$random = substr(hash('sha256', mt_rand() . microtime() . getmypid()), 0, 32);
|
||||
$sender = $this->message->getFrom(); reset($sender);
|
||||
$id = $random . '@' . (preg_match('/^(.+)@([^@]+)$/', key($sender), $matches) ? $matches[2] : 'swift.generated');
|
||||
$this->message->getHeaders()->get('Message-ID')->setId($id);
|
||||
|
||||
$output = \ModuleHandler::triggerCall('mail.send', 'before', $this);
|
||||
if(!$output->toBool())
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue