# HG changeset patch # User mortenp # Date 1270929099 -36000 # Node ID 30e6e309891d6a214f57a39e4c176c6306f638eb # Parent edfd37c7ec4cd755605caf30cbddcc0d8ecc0c87 Added "send" keyword to control/access handling (Ben Schmidt) diff -r edfd37c7ec4c -r 30e6e309891d ChangeLog --- a/ChangeLog Fri Feb 19 03:21:55 2010 +1100 +++ b/ChangeLog Sun Apr 11 05:51:39 2010 +1000 @@ -1,3 +1,4 @@ + o Added "send" keyword to control/access handling (Ben Schmidt) o Added contrib/amime-receive (Gerd v. Egidy) o Fixed memory leak in substitute_one() (Ben Schmidt) o Updated German listtexts (Christoph Wilke) diff -r edfd37c7ec4c -r 30e6e309891d README.access --- a/README.access Fri Feb 19 03:21:55 2010 +1100 +++ b/README.access Sun Apr 11 05:51:39 2010 +1000 @@ -17,7 +17,7 @@ discard or moderate the post. The syntax is quite simple: action[ [!]regexp] -- "Action" can be "allow", "deny", "discard" or "moderate". +- "Action" can be "allow", "send", "deny", "discard" or "moderate". - The optional "!" makes the rule a match, if NO header matches the regular expression. - "Regexp" is a POSIX.2 extended regular expression. Matching is done case @@ -27,6 +27,9 @@ mail may still be held for moderation, if it would have been so without access rules. +The action "send" will send the mail unconditionally. It will not be +moderated. + The action "deny" will not send the mail to the mailing list, but will send a rejection mail to the sender. @@ -39,24 +42,27 @@ function as moderators in listdir/control/moderators -The flow out of the access system is like this: +The flow through the access system is like this: + deny +------+ + +----------------->| deny | + | +------+ | - v -+--------+ deny +--------+ discard +---------+ -| reject |<-------| access |---------->| discard | -+--------+ +--------+ +---------+ - allow | | moderate - | +-----------+ - v v - +------------+ +------+ - | moderation |--->| hold | - +------------+ +------+ - | | - v | - +------+ | - | send |<---------+ - +------+ + | discard +---------+ + | +-------------->| discard | + | | +---------+ + | | ^ + | | | expire + +--------+ moderate +------+ +------+ +--->| access |----------->| hold |---------->| send |---> + +--------+ +------+ confirm +------+ + | | ^ ^ ^ + | | | yes | | + | | allow +------------+ no | | + | +-------------->| moderation |-------+ | + | +------------+ | + | send | + +------------------------------------------+ First a simple example. This rule set will reject any mail that is NOT plain diff -r edfd37c7ec4c -r 30e6e309891d src/mlmmj-process.c --- a/src/mlmmj-process.c Fri Feb 19 03:21:55 2010 +1100 +++ b/src/mlmmj-process.c Sun Apr 11 05:51:39 2010 +1000 @@ -55,6 +55,7 @@ enum action { ALLOW, + SEND, DENY, MODERATE, DISCARD @@ -173,6 +174,9 @@ if (strncmp(rule_ptr, "allow", 5) == 0) { rule_ptr += 5; act = ALLOW; + } else if (strncmp(rule_ptr, "send", 4) == 0) { + rule_ptr += 4; + act = SEND; } else if (strncmp(rule_ptr, "deny", 4) == 0) { rule_ptr += 4; act = DENY; @@ -851,6 +855,9 @@ } startaccess: + if(!moderated) + moderated = statctrl(listdir, "moderated"); + noaccessdenymails = statctrl(listdir, "noaccessdenymails"); access_rules = ctrlvalues(listdir, "access"); @@ -917,11 +924,13 @@ myfree(donemailname); myfree(discardname); exit(EXIT_SUCCESS); + } else if (accret == SEND) { + moderated = 0; + } else if (accret == ALLOW) { + /* continue processing as normal */ } } - if(!moderated) - moderated = statctrl(listdir, "moderated"); if(moderated) { mqueuename = concatstr(3, listdir, "/moderation/", randomstr);