Attached is a patch to sort.c to make sorting configurable.
If sortdriver in dbmail.conf is given a value, the sorting module is
called.
As I read from the code, a sorting module should return the mailbox, and
user in which the email should be inserted. But how should it behave if
it must deliver to more than 1 mailbox? i.e. a rule setup by a user
matches, and the user configured to let the message process further?
/Marc
Index: sort.c
===================================================================
--- sort.c (revision 1970)
+++ sort.c (working copy)
@@ -11,6 +11,7 @@
#include "dbmail.h"
+extern db_param_t _db_params;
/* Figure out where to deliver the message, then deliver it.
* */
dsn_class_t sort_and_deliver(struct DbmailMessage *message,
@@ -43,7 +44,7 @@
}
/* Sieve. */
- if (0) { // FIXME: I think this should be configurable.
+ if (strlen(_db_params.sortdriver) > 0) {
sort_connect();
// FIXME: This doesn't translate correctly to DSN's.