Erik Osterman wrote:
> Hi,
> 
> I'm looking for a way to keep all email ever received whether deleted or
> not. As it stands, I don't see that this is possible with dbmail. The
> reason is two fold: users frequently delete messages that need to be
> restored; we're legally required to maintain a copy of all email.
> Storing a copy of all email is not an alternative. There's just too much
> data (several TB).
> 
> My current solution is to add a column 'deleted_at' to the tables
> dbmail_mailboxes, dbmail_users, dbmail_subscriptions, dbmail_messages.
> Then modify the any statements which execute DELETEs on these tables to
> instead execute UPDATEs setting the 'deleted_at' timestamp. Similarly,
> modify all SELECT statements which operate on these tables with an
> additional condition "deleted_at IS NULL".
> 
> My prior experience with dbmail is nil. Is it really as easy as this? Or
> is there more to the problem that I'm missing.

There are two things that need to be considered:

- message deletion
- mailbox deletion

message deletion can be dealt with by *not* running 'dbmail-util -py'. In that
case message status will be kept at 2, being invisible to the daemons, but still
there in the database.

mailbox deletion is slightly more difficult. I would probably make sure that
deleted mailboxes are not deleted as such, but renamed to something like:

some/mailbox -> '#Deleted/<owner>/<owner>/some/mailbox/<timestamp>'

check imapcommands.c,_ic_delete where at the end you find a call
'db_delete_mailbox'.  That would be your starting point. Or even better, change
the behaviour of 'db_delete_mailbox'.

-- 
  ________________________________________________________________
  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