Hi all,
I'm using gmail like imap server with RC and I find a bug (I think gMail bug). Seems related the open tiket 1485746.
RC use the message position for deleting and not it's UID. When a message was copy in the trash folder google expunge it automatically. Than RC set the flag /deleted at the message that was just expunged and it flag the previous message that now have the same position. RC in this way delete 2 messages.
This is my workorund. I've modify the imap.inc in the program/lib folder in this way:
function iil_C_Move(&$conn, $messages, $from, $to) { $fp = $conn->fp;
if (!$from || !$to) {
return -1;
}
/*
IDWEB START Modify
*/
// Check for GMail auto expunge messages when copied in trash folder
$a_messages = explode(',', $messages);
$a_oldmessagesuid = array();
foreach ($a_messages as $uid)
$a_oldmessagesuid[] = iil_C_ID2UID($conn, $from, $uid);
$oldmessagesuid = join(',', $a_oldmessagesuid);
/*
IDWEB STOP Modify
*/
$r = iil_C_Copy($conn, $messages, $from,$to);
if ($r==0) {
/*
IDWEB START Modify
*/
$a_newmessagesuid = array();
foreach ($a_messages as $uid)
$a_newmessagesuid[] = iil_C_ID2UID($conn, $from, $uid);
$newmessagesuid = join(',', $a_newmessagesuid);
if($newmessagesuid == $oldmessagesuid)
// Delete only if there is not autoexpunge action by IMAP server
/*
IDWEB STOP Modify
*/
return iil_C_Delete($conn, $from, $messages);
}
return $r;
}
I can't open directly a tiket becouse I can't create a new account. I hope that u can include a workaround like this in the next release.
Thanks all
Sandro Pazzi wrote:
I'm using gmail like imap server with RC and I find a bug (I think gMail bug). Seems related the open tiket 1485746.
RC use the message position for deleting and not it's UID. When a message was copy in the trash folder google expunge it automatically. Than RC set the flag /deleted at the message that was just expunged and it flag the previous message that now have the same position. RC in this way delete 2 messages.
This is my workorund.
foreach ($a_messages as $uid) $a_oldmessagesuid[] = iil_C_ID2UID($conn, $from, $uid);
...
$r = iil_C_Copy($conn, $messages, $from,$to);
...
foreach ($a_messages as $uid) $a_newmessagesuid[] = iil_C_ID2UID($conn, $from, $uid);
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?
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.