ZF-8513: copying many messages is slow: copy() in Zend_Mail_Protocol_Imap should support array of message ids

Description

If I want to copy 1000 messages, I have to call the copyMessage() method in Zend_Mail_Storage_Imap 1000 times. This is really slow. The same applies to moveMessage().

Both methods internally use the copy() method of Zend_Mail_Protocol_Imap. This method supports a single id or a range of ids, but this is not used. So it would be nice if copy() would support an array of ids (which is then joined to a comma-separated string), because this is supported by IMAP.

This functionality is already supported by fetch(), and I provided a patch for store() in ZF-8488 . I will attach a patch for the copy() method (which is the same as in fetch() or store()).

Then it is easy to create a function in Zend_Mail_Storage_Imap which supports copying or moving of many messages with one IMAP command, which is very fast then.

The $from ist also missing in phpDoc comment for copy() method.

Comments

Correct component