this is becoming a faq :-)

DELETE FROM dbmail_physmessage WHERE id NOT IN (
 SELECT physmessage_id FROM dbmail_messages
);

will clean out all physmessages and per cascade messageblks that are
unconnected to any messages.

Above query (or something similar) will be added to the dbmail-util
cleaup run before 2.2.6-final.


Aaron Stone wrote:
> When a folder is deleted, all of the messages within it are removed
> immediately without a \Deleted flag / expunge cycle. Now the question of
> whether we get those physmessage entries and messageblks out of the
> database is another one entirely. There appear to be a few paths that
> allow the message blocks themselves to hang around.
> 
> Aaron
> 
> On Wed, Jul 18, 2007, Jeff Brenton <[EMAIL PROTECTED]> said:
> 
>> Hello Stephen,
>>
>> Generally speaking, if you're using IMAP access, "deleting" means
>> "move to trash folder", so they're not quite gone yet. You still have
>> to "empty the trash" before the storage engine will be told to mark
>> the messages as deleted.
>>
>> SL> I just deleted an IMAP folder with 7000+ messages in it (archive
>> SL> from old company) and then ran dbmail-util on it and it said that
>> SL> it found 2 messages marked for deletion, ran it again, it deleted
>> SL> those 2 messages and then found no more for deletion. Where are
>> SL> these emails?
>>
>> SL> I'm terrified if DBMA now since I ran a cleanup through there and
>> SL> it wiped EVERY email I ever imported with any imap client whether
>> SL> it was kmail, outlook or thunderbird...
>>
>> SL> What should I do to keep my DB clean?
>>
>> -- 
>> Best regards,
>>  Jeff                            mailto:[EMAIL PROTECTED]
>>
>> _______________________________________________
>> DBmail mailing list
>> [email protected]
>> https://mailman.fastxs.nl/mailman/listinfo/dbmail
>>
> 


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

Reply via email to