A.L.E.C wrote:
An expensive workaround. Perfect opportunity to use COPYUID feature from UIDPLUS extension, also id-to-uid conversion could be done in one FETCH command. Does gmail support UIDPLUS?
I've found an explanation about gmail issue: "The problem is that gmail only keeps a single copy of a message with multiple labels. If you apply the Trash label by placing the message in the [Gmail]/Trash folder, you are telling GMail to remove the message from all labels". So, we should use an optional hack for gmail, e.g.:
$rcmail_config['imap_hacks'] = array('gmail-trash');
... or recognize gmail on login if possible.