Erik Osterman wrote:

> This was a good suggestion, but after some research/attempts, I am not
> able to get the triggers working in MySQL to accomplish it. It all boils
> down to this error:
> "Can't update table 'dbmail_mailboxes' in stored function/trigger
> because it is already used by statement"
> 
> In MySQL 5.0 it seems that you can not issue INSERT/DELETE/UPDATE
> statements that operate on the current table from within a trigger that
> is executed on the that table. So, the best I can come up with is to
> create "recovery" tables that backup this information. Upon recovery,
> new mailboxes would be created and FKs updated respectively.

I suspected as much :-(

In that case, I propose we add a new dbmail.conf option: archive_mode=yes

in which case the imap command 'DELETE <mailbox>' will not actually delete
mailboxes but update the mailbox by setting a 'deleted_time' field.

if archive_mode=yes:

- never delete messages. dbmail-util -py will do nothing.
- expose the #archive namespace (read-only) and make things visible to the
  owner (and manager?) showing *all* messages (read, unread, deleted and purged)

  #archive/username/mailbox
    (active mailbox: deleted_time=0)

  #archive/username/mailbox.timestamp
    (archive box: deleted_time=timestamp)

- make sure subscriptions are cancelled when a mailbox is archived.
- make sure mailboxes are re-assigned when a user is deleted (trigger)




-- 
  ________________________________________________________________
  Paul Stevens                                      paul at nfg.nl
  NET FACILITIES GROUP                     GPG/PGP: 1024D/11F8CD31
  The Netherlands________________________________http://www.nfg.nl
_______________________________________________
Dbmail-dev mailing list
[email protected]
http://twister.fastxs.net/mailman/listinfo/dbmail-dev

Reply via email to