Paul J Stevens wrote:
the basic query for getting the message_idnrs involved is:
select message_idnr from dbmail_messages m join dbmail_mailboxes b ON
m.mailbox_idnr=b.mailbox_idnr JOIN dbmail_physmessage p ON
p.id=m.physmessage_id WHERE p.internal_date < 'NOW - 30 days' AND b.name
LIKE "spam";
Thanks, this select looks good. The 'NOW - 30 days' didn't really work
though, I've come up with this select query:
mysql> select count(message_idnr) from dbmail_messages m join
dbmail_mailboxes b ON m.mailbox_idnr=b.mailbox_idnr JOIN
dbmail_physmessage p ON p.id=m.physmessage_id WHERE p.internal_date <
date_sub(now(), interval 30 day) AND b.name LIKE "spam";
+---------------------+
| count(message_idnr) |
+---------------------+
| 46133 |
+---------------------+
1 row in set (0.50 sec)
Double checked everything and it does look good.
> Michael Luich wrote:
>> try this:
>
> Please don't!
No worries, I first checked the select query Michael proposed so no
mails were deleted by accident.
About finally deleting the mails. The deleted_flag is IMAP only --
whether the user can see the email in his mailbox or not. status=2 on
the other hand is used by dbmail util to set the email for deletion.
So I think the correct thing to do would be to set deleted_flag=1 AND
status=2. Agreed?
On another note.
When investigating this I realised that when I click Delete in the TB's
Trash folder only "deleted_flag" is set to 1, status is not touched.
When I finally close TB, the status is also set to 2.
How and by whom is the status modified? If I leave TB open indefinitely
will my emails never be really deleted?
Thanks,
--
Aleksander Kamenik
system administrator
+372 6659 649
[EMAIL PROTECTED]
Krediidiinfo AS
http://www.krediidiinfo.ee/
_______________________________________________
DBmail mailing list
[email protected]
https://mailman.fastxs.nl/mailman/listinfo/dbmail