On 10/31/2010 08:09 PM, Jorge Bastos wrote:
> Hi Paul,
> 
>> You can't do this in one query (at least not on mysql).
>>
>> You'll need to fetch a list of message_idnr to delete (1) and then
>> delete the messages (2).
>>
>> 1)
>> 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='testuser1' and
>>    b.name='INBOX' and
>>    p.internal_date < '2011-01-01';
>>
>> 2)
>> delete from dbmail_messages where message_idnr in (xxx);
>>
> 
> I'm testing dbmail-export, I think I'll go for that solution, what do you
> say? It's better than messing with the database, no?

Depends on what you need. I can't read your mind. If your not
comfortable writing sql and scripts, use dbmail-export.



-- 
  ________________________________________________________________
  Paul Stevens                                      paul at nfg.nl
  NET FACILITIES GROUP                     GPG/PGP: 1024D/11F8CD31
  The Netherlands________________________________http://www.nfg.nl
_______________________________________________
Dbmail-dev mailing list
Dbmail-dev@dbmail.org
http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail-dev

Reply via email to