From: pdontthink Date: Wed, 13 Apr 2005 23:22:53 +0000 (+0000) Subject: Workaround for Courier when sending mixed messages with nested multipart/alternative... X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=commitdiff_plain;h=ba86230eddc54d92e7ab27ed9a41ff8466c656cc Workaround for Courier when sending mixed messages with nested multipart/alternative parts git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@9260 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/class/deliver/Deliver.class.php b/class/deliver/Deliver.class.php index bd09a4d7..b05f20cf 100644 --- a/class/deliver/Deliver.class.php +++ b/class/deliver/Deliver.class.php @@ -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; }