> My filtering algorithm:
> 
> 1) Read all filtering rules for current user with "SELECT filter_field, 
> filter_value, mailbox FROM dbmail_filters WHERE user_id = '%llu' ORDER 
> BY filter_id"
> 
> 2) For every record read all mail headers and compare it with current 
> record in dbmail_filters.
> 
> 3) Apply destionation mailbox on founding first matching

  One thing that comes to mind that would be nice (if not absolutely
required) is the ability to order the filters, which from a cursory
look over the table setup, I don't think exists.  I guess if you wanted
to reorder 2 filters, you could delete the first and add it in again
with a higher filter_id, but it seems a bit awkward; just have an
adjustable sort priority and order by that.

  A couple other ideas that would be nice, but might complicate things,
are:  allow multiple entries with the same filter_id and a flag for
matching "all" or "any" (might need to add a unique index on the
filter_id and mailbox to make sure they're always consistent?).  Also
adding in a layer to pick your filtering type (eg. from dbmail.conf),
so you could choose simple dbmail_filter now, and later sieve or
others could be added (but that could be added later, when sieve is
ready, too).

  Not being familiar with the code, does sort_and_deliver() get
called during IMAP APPEND's too, or just during smtp/lmtp?



-- 
Jesse Norell - [EMAIL PROTECTED]
Kentec Communications, Inc.

Reply via email to