Am 06.02.2015 um 21:31 schrieb Paul J Stevens:
It is used to track changes, like a mailbox version. The new imap
features use those. If you modify the state of a mailbox, you need to
bump the version

hm - if i get that correctly that means bump that number for every move/delete action like cleanup trash folders with a' update table set seq=seq+1 where mailboxid=y'?

good to know - we have webui actions to move mails between folders and even users like 'move all messages from user1.inbox to user2.archive' which needs in that case a update for dbmail 3.2

well, and the trash cleanup below too

 $dbmail->log('Trash: Cleanup started');
 $trash_folders = array
 (
  'TRASH',
  'DELETED MESSAGES',
  'DELETED ITEMS',
  'DELETED MAILS',
  'REMOVED MESSAGES',
  'REMOVED ITEMS',
  'REMOVED MAILS',
  'PAPIERKORB',
  'GEL&APY-SCHTE ELEMENTE',
 );
 $total_size = 0;
 foreach($trash_folders as $cur_folder)
 {
$result = $dbmail->db->query_fetch_all('select' . SQL_BIG_NO_CACHE . ' id,messagesize,internal_date from `dbmail_physmessage` where id in (select physmessage_id from `dbmail_messages` where mailbox_idnr in (select mailbox_idnr from `dbmail_mailboxes` where `name` like \'' . $dbmail->db->addslashes($cur_folder) . '%\')) and internal_date < date_sub(now(), interval 1 month);');
  if(count($result) > 5)
  {
   foreach($result as $row)
   {
    $total_size += $row['messagesize'];
$dbmail->db->query('delete from dbmail_messages where physmessage_id=' . (int)$row['id'], 1, 1);
   }
echo utf8_encode(strtoupper(mb_convert_encoding($cur_folder, 'ISO-8859-1', 'UTF7-IMAP'))) . ': ' . count($result) . MY_LE;
  }
 }
 if($total_size > 0)
 {
  echo MY_LE . 'SIZE: ' . GetSizeString('', $total_size) . MY_LE;
 }

Andrea Brancatelli <abrancate...@schema31.it> schreef op 6 februari 2015
09:24:48 CET:

    Can anyone spend a few words for me on the new "seq" column?

    What's it's main purpose?

    Is it functionally relevant or it something like a cache that can be
    reset, modified or whatever with no big issues?

    I'm used to move messages between mailboxes with queries like UPDATE
    dbmail_messages SET mailbox_idnr = 89 WHERE mailbox_idnr = 47981;
    but the seq column would be no more monotonically increasing in such
    case. Is it a problem?

    Futhermore in a dual master scenario the column doesn't seem really
    replication-aware, so I was curious if having duplicates in it may
    be problematic

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
DBmail mailing list
DBmail@dbmail.org
http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail

Reply via email to