From: Jim W. <spi...@us...> - 2007-01-06 06:11:16
|
Update of /cvsroot/moregroupware/mgw/modules/webmail2/inc/imap In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv20326 Modified Files: imap_mailbox.php Log Message: Fix a bug with imap accounts where adding a New Folder and moving a message to it causes an error or moves an email from the wrong email. The underlying cause is the INBOX folder "id" number is dynamic and was being assigned to a value one higher than the highest "id" of all the other folders for the email account. This was particularly noticable with the wu-imap server that doesn't automatically list an "inbox" folder. Adding a folder causes the tree to refresh (for obvious reasons) but doing so made the mailbox id of the messages in the Maillist out of sync. One solution would have been to refresh the Maillist, but that would have just made Webmail2 less buggy and harder to use. Instead I'm just forcing the inbox to have an id of 32767 so that it becomes unlikely it would be increased by a new folder addition. BTW, the selection of the number 32767 has nothing to do with 16 bit signed integers. Index: imap_mailbox.php =================================================================== RCS file: /cvsroot/moregroupware/mgw/modules/webmail2/inc/imap/imap_mailbox.php,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** imap_mailbox.php 24 Apr 2005 05:42:04 -0000 1.20 --- imap_mailbox.php 6 Jan 2007 06:11:13 -0000 1.21 *************** *** 505,508 **** --- 505,512 ---- $boxesall[$g]['id'] = $g; + if (strtoupper($boxesall[$g]['unformatted']) == 'INBOX') { + $boxesall[$g]['id'] = 32767; + } + $boxesall[$g]['flags'] = array(); if (isset($line[$g])) { |