Peter Rabbitson wrote: > I am using latest dbmail 2.2.15. I just realized that *any* sieve > rule present for an account (even if the rule is disabled), implicitly > disabels any support for addr+folder@ type of address expansion routing.
I assume you mean that having an active sieve-script will disable subaddress delivery. That is correct. The default-mailbox, derived from the subaddress does not propagate into the sieve layer. > The way things are now, if a user wants to take advantage of sieve, > they will have to populate the sieve rulebook with *all* + extensions > used so far, so the mail delivery will continue as before. This is... > suboptimal :) I've just pushed a fix for this. Try the patch attached plz. -- ________________________________________________________________ Paul Stevens paul at nfg.nl NET FACILITIES GROUP GPG/PGP: 1024D/11F8CD31 The Netherlands________________________________http://www.nfg.nl
>From 6f3460e66ab58859e381a145979a46effad0bf53 Mon Sep 17 00:00:00 2001 From: Paul J Stevens <[email protected]> Date: Sun, 2 May 2010 15:20:44 +0200 Subject: propagate sub-address into sieve handler --- modules/sortnull.c | 2 +- modules/sortsieve.c | 5 ++++- sort.c | 2 +- sort.h | 2 +- sortmodule.c | 4 ++-- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/modules/sortnull.c b/modules/sortnull.c index 59cefe1..6ef5980 100644 --- a/modules/sortnull.c +++ b/modules/sortnull.c @@ -40,7 +40,7 @@ sort_result_t *sort_validate(u64_t user_idnr UNUSED, char *scriptname UNUSED) return NULL; } -sort_result_t *sort_process(u64_t user_idnr UNUSED, struct DbmailMessage *message UNUSED) +sort_result_t *sort_process(u64_t user_idnr UNUSED, struct DbmailMessage *message UNUSED, const char *mailbox) { TRACE(TRACE_WARNING, "SIEVE sorting enabled in DELIVERY section of dbmail.conf," " but this build of DBMail was statically configured without Sieve."); diff --git a/modules/sortsieve.c b/modules/sortsieve.c index 1d3173c..3b2e064 100644 --- a/modules/sortsieve.c +++ b/modules/sortsieve.c @@ -799,7 +799,7 @@ freesieve: * such as dbmail-lmtpd, the daemon should * finish storing the message and restart. * */ -sort_result_t *sort_process(u64_t user_idnr, struct DbmailMessage *message) +sort_result_t *sort_process(u64_t user_idnr, struct DbmailMessage *message, const char *mailbox) { int res, exitnull = 0; struct sort_result *result = NULL; @@ -822,6 +822,9 @@ sort_result_t *sort_process(u64_t user_idnr, struct DbmailMessage *message) exitnull = 1; goto freesieve; } + if (mailbox) + sort_context->result->mailbox = mailbox; + sort_context->result->errormsg = g_string_new(""); res = db_get_sievescript_active(user_idnr, &sort_context->script); diff --git a/sort.c b/sort.c index 8359e9e..e68baa3 100644 --- a/sort.c +++ b/sort.c @@ -83,7 +83,7 @@ dsn_class_t sort_and_deliver(struct DbmailMessage *message, && db_check_sievescript_active(useridnr) == 0) { TRACE(TRACE_INFO, "Calling for a Sieve sort"); sort_result_t *sort_result; - sort_result = sort_process(useridnr, message); + sort_result = sort_process(useridnr, message, mailbox); if (sort_result) { cancelkeep = sort_get_cancelkeep(sort_result); reject = sort_get_reject(sort_result); diff --git a/sort.h b/sort.h index 9123f9e..8641591 100644 --- a/sort.h +++ b/sort.h @@ -35,7 +35,7 @@ dsn_class_t sort_deliver_to_mailbox(struct DbmailMessage *message, u64_t useridnr, const char *mailbox, mailbox_source_t source, int *msgflags); -sort_result_t *sort_process(u64_t user_idnr, struct DbmailMessage *message); +sort_result_t *sort_process(u64_t user_idnr, struct DbmailMessage *message, const char *mailbox); sort_result_t *sort_validate(u64_t user_idnr, char *scriptname); const char *sort_listextensions(void); void sort_free_result(sort_result_t *sort_result); diff --git a/sortmodule.c b/sortmodule.c index cc72063..23f0e98 100644 --- a/sortmodule.c +++ b/sortmodule.c @@ -93,7 +93,7 @@ int sort_load_driver(void) return 0; } -sort_result_t *sort_process(u64_t user_idnr, struct DbmailMessage *message) +sort_result_t *sort_process(u64_t user_idnr, struct DbmailMessage *message, const char *mailbox) { if (!sort) sort_load_driver(); @@ -101,7 +101,7 @@ sort_result_t *sort_process(u64_t user_idnr, struct DbmailMessage *message) TRACE(TRACE_ERROR, "Error loading sort driver"); return NULL; } - return sort->process(user_idnr, message); + return sort->process(user_idnr, message, mailbox); } sort_result_t *sort_validate(u64_t user_idnr, char *scriptname) -- 1.6.3.3
_______________________________________________ DBmail mailing list [email protected] http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail
