> In that case, do not delete the messages but set their status to 2,
> just
> like when you delete a message using POP3. That way dbmail-util will
> take care of the actual deletions. That will take two separate
> dbmail-util runs, so you can check for problems in between.

Just to finish, just two more things, I'll use the folowing query then to
update the messages status, and then dbmail-util will take care of the rest,
I prefer that way.
So the query will be:

--
drop table if exists tmp;
create temporary table tmp (id bigint(16) not null);
insert into tmp select message_idnr from dbmail_messages m
   join dbmail_physmessage p on m.physmessage_id=p.id
   join dbmail_mailboxes b on m.mailbox_idnr=b.mailbox_idnr
   join dbmail_users u on b.owner_idnr=u.user_idnr where
    userid='myuser' and
    b.name='INBOX' and
    p.internal_date < '2010-10-31';
update dbmail_messages as t1,tmp as t2 set deleted_flag=2 where
t2.id=t1.message_idnr ;
--


Now, one thing I've noticed is, when running the dbmail-util commands, it
takes about one hour, to delete 196 mimeparts or 2000.

Maybe there's some adjust that needs to be done on that query?
I said one hour for my case, I have 52GB database.

On the part:
Repairing DBMAIL mimeparts integrity...
Ok. Found [196] unconnected mimeparts.
Ok. Orphaned mimeparts deleted.

It takes the times:

Repairing DBMAIL mimeparts integrity...
Ok. Found [196] unconnected mimeparts. <= +- half hour to appear this
Ok. Orphaned mimeparts deleted. <= +- half hour to appear this

Maybe there's some duplicated operations? Or maybe you could dismiss the
could and show the total only on the end and this way this will get faster?


---
/usr/local/sbin/dbmail-util -d -y
/usr/local/sbin/dbmail-util -p -y
/usr/local/sbin/dbmail-util -ty



Setting DELETE status for deleted messages...
Ok. Messages set for deletion.
Re-calculating used quota for all users...
Ok. Used quota updated for all users.

Maintenance done. No errors found.

Deleting messages with DELETE status...
Ok. Messages deleted.

Maintenance done. No errors found.

Repairing DBMAIL message integrity...

Repairing DBMAIL physmessage integrity...
Ok. Found [56] unconnected physmessages.
Ok. Orphaned physmessages deleted.

Repairing DBMAIL partlists integrity...
Ok. Found [0] unconnected partlists.

Repairing DBMAIL mimeparts integrity...
Ok. Found [196] unconnected mimeparts.
Ok. Orphaned mimeparts deleted.

Maintenance done. No errors found.
---

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

Reply via email to