Jesse Norell wrote:
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.

This idea is already implemented :)

Filter records are ordered by filter_id during mail scan. You can change value of this field and so filters will be reordered.


  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).

Yes, this things are more complicated, so they will implemented than I need them.

I hope my code will merged with mail DBMail source tree so anybody will can use my code or change it. But I haven't answer in dbmail-dev maillist about my patch.

I know that adding new features in stable version is not good idea, but this feature is very needed for me and for other people which can't migrate to unstable DBMail version.

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

I don't know :) I even don't know what is IMAP APPEND :) Can I do this operation in mail client?


--
Regards,
Eugene Prokopiev

Reply via email to