Workaround for Courier when sending mixed messages with nested multipart/alternative...
authorpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 13 Apr 2005 23:22:53 +0000 (23:22 +0000)
committerpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 13 Apr 2005 23:22:53 +0000 (23:22 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@9260 7612ce4b-ef26-0410-bec9-ea0150e637f0

class/deliver/Deliver.class.php

index bd09a4d..b05f20c 100644 (file)
@@ -76,8 +76,17 @@ class Deliver {
         if ($boundary && $message->entity_id && count($message->entities)) {
             if (strpos($boundary,'_part_')) {
                 $boundary = substr($boundary,0,strpos($boundary,'_part_'));
+
+            // the next four lines use strrev to reverse any nested boundaries 
+            // as a workaround for Courier-IMAP, which will stop parsing 
+            // when it sees the original outer boundary string and ignore
+            // our "_part_..." addition to that string.  a bug report has been
+            // made, but in the meantime...
+            //
+            } else if (strpos($boundary,'_trap_')) {
+                $boundary = substr(strrev($boundary),0,strpos(strrev($boundary),'_part_'));
             }
-            $boundary_new = $boundary . '_part_'.$message->entity_id;
+            $boundary_new = strrev($boundary . '_part_'.$message->entity_id);
         } else {
             $boundary_new = $boundary;
         }