Daniel Urstöger wrote:
Hi there,

I have one more question:

the webmail system I wrote is almost done but at the moment I have
something that is not really working as I would like it too: checking for
new messages. I do that by polling the database for it, but I suppose
you guys have a nice way to fix that via a trigger within the mysql db?

Not. I also use polling for the IDLE feature. The way I've solved that in the 2.3 tree is by adding a datetime field called 'mtime' on dbmail_mailboxes.

First off, I tried using triggers to update that field whenever a record in dbmail_messages was changed, but this created trigger-storms that were unacceptable. So now I'm using manually setup queries to update it whenever a message is inserted or a (set of) message(s) is/are updated.

This makes checking for mailbox changes cheap as hell.


Like having a table called: new_mail and update/insert entries there
based on a MySQL trigger? I have no idea where and how I  could
put that into the current db scheme of dbmail without breaking/
generating other problems ...

Using triggers is possible, but like I described, you would have to make pretty damn sure you test for update storms that may bring your database to its knees. And I'm not well-versed enough in trigger semantics to conceive a sensible setup that will work for all supported backends.


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