diff options
author | cos <cos> | 2020-10-20 11:08:47 +0200 |
---|---|---|
committer | cos <cos> | 2020-10-20 21:03:16 +0200 |
commit | 14e4700127a5b2dee88ae7324bc90a7c6db011a9 (patch) | |
tree | f0f96a2467a5fcd656e5b62a0fb0f19d4c9e8c3a /Postman/PostmanWpMail.php | |
parent | 828e184e5db05d9ea1a5d2928e1b68f561822701 (diff) | |
download | Post-SMTP-fix/allow_setting_msgid.zip |
Fix bug overwriting message-idfix/allow_setting_msgid
In case a message-id is already set, postman should not touch it. This
commit also checks for existing brackets before adding them, due to
inconsistence in function usage.
Diffstat (limited to 'Postman/PostmanWpMail.php')
-rw-r--r-- | Postman/PostmanWpMail.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Postman/PostmanWpMail.php b/Postman/PostmanWpMail.php index c108cce..7cd0596 100644 --- a/Postman/PostmanWpMail.php +++ b/Postman/PostmanWpMail.php @@ -65,8 +65,10 @@ if ( ! class_exists( 'PostmanWpMail' ) ) { * @return PostmanMessage */ private function apply_default_headers( $message ) { - $headers[] = 'Message-ID: ' . $this->createMessageId(); - $message->addHeaders($headers); + if(! $message->getMessageId()) { + $headers[] = 'Message-ID: ' . $this->createMessageId(); + $message->addHeaders($headers); + } } /** |