diff --git a/library/Zend/Mail/Protocol/Imap.php b/library/Zend/Mail/Protocol/Imap.php index 90cc258..8c2a7b5 100644 --- a/library/Zend/Mail/Protocol/Imap.php +++ b/library/Zend/Mail/Protocol/Imap.php @@ -738,17 +738,23 @@ class Zend_Mail_Protocol_Imap /** * copy message set from current folder to other folder * - * @param string $folder destination folder - * @param int|null $to if null only one message ($from) is fetched, else it's the - * last message, INF means last message avaible + * @param string $folder destination folder + * @param int|array $from message for items or start message if $to !== null + * @param int|null $to if null only one message ($from) is fetched, else it's the + * last message, INF means last message avaible * @return bool success * @throws Zend_Mail_Protocol_Exception */ public function copy($folder, $from, $to = null) { - $set = (int)$from; - if ($to != null) { - $set .= ':' . ($to == INF ? '*' : (int)$to); + if (is_array($from)) { + $set = implode(',', $from); + } else if ($to === null) { + $set = (int)$from; + } else if ($to === INF) { + $set = (int)$from . ':*'; + } else { + $set = (int)$from . ':' . (int)$to; } return $this->requestAndResponse('COPY', array($set, $this->escapeString($folder)), true);