0012436: message-id is not valid because of double brackets
authorsstamer <s.stamer@metaways.de>
Thu, 15 Dec 2016 10:41:07 +0000 (11:41 +0100)
committerPhilipp Schüle <p.schuele@metaways.de>
Mon, 19 Dec 2016 16:16:56 +0000 (17:16 +0100)
https://forge.tine20.org/view.php?id=12436

Change-Id: Ifab85e19d54002a3879b2d57301032121a45ddfa
Reviewed-on: http://gerrit.tine20.com/customers/3968
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tests/tine20/Felamimail/Frontend/JsonTest.php
tine20/Felamimail/Controller/Message/Send.php

index 77f7d27..b0c3aa8 100644 (file)
@@ -607,6 +607,7 @@ class Felamimail_Frontend_JsonTest extends TestCase
      * try to get a message from imap server (with complete body, attachments, etc)
      *
      * @see 0006300: add unique message-id header to new messages (for message-id check)
+     * @see 0012436: message-id is not valid because of double brackets
      */
     public function testGetMessage()
     {
@@ -618,6 +619,8 @@ class Felamimail_Frontend_JsonTest extends TestCase
         // check
         $this->assertTrue(isset($message['headers']) && $message['headers']['message-id']);
         $this->assertContains('@' . $this->_mailDomain, $message['headers']['message-id']);
+        $this->assertNotContains('<<', $message['headers']['message-id']);
+        $this->assertNotContains('>>', $message['headers']['message-id']);
         $this->assertGreaterThan(0, preg_match('/aaaaaä/', $message['body']));
         
         // delete message on imap server and check if correct exception is thrown when trying to get it
index 8639ad3..61e85a6 100644 (file)
@@ -518,7 +518,7 @@ class Felamimail_Controller_Message_Send extends Felamimail_Controller_Message
         if ($_mail->getMessageId() === NULL) {
             $domainPart = substr($_account->email, strpos($_account->email, '@'));
             $uid = Tinebase_Record_Abstract::generateUID();
-            $_mail->setMessageId('<' . $uid . $domainPart . '>');
+            $_mail->setMessageId($uid . $domainPart);
         }
         
         if ($_message !== NULL) {