]> git.ipfire.org Git - thirdparty/mlmmj.git/commitdiff
Added "send" keyword to control/access handling (Ben Schmidt)
authormortenp <none@none>
Sat, 10 Apr 2010 19:51:39 +0000 (05:51 +1000)
committermortenp <none@none>
Sat, 10 Apr 2010 19:51:39 +0000 (05:51 +1000)
ChangeLog
README.access
src/mlmmj-process.c

index f03209cf7f0145bd373848f5b32813f08cbc9dcb..85eaf7c77f688030adb74378f944b2cefe72336e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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)
index 8086c26ee742a8e54d109c17aec0e87ea73805f6..dd16653a03f05ed61e00e3532de64cc9449b9597 100644 (file)
@@ -17,7 +17,7 @@ The first rule to match a header decides which action to take - allow, deny,
 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 @@ The action "allow" will pass the mail on to the next step in processing. The
 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 @@ IMPORTANT: if "moderate" is used then don't forget to add people who should
            function as moderators in listdir/control/moderators
 
 
-The flow out of the access system is like this:
-
-                      |
-                      v
-+--------+   deny +--------+ discard   +---------+
-| reject |<-------| access |---------->| discard |
-+--------+        +--------+           +---------+
-               allow |  | moderate
-                     |  +-----------+
-                     v              v
-               +------------+    +------+
-               | moderation |--->| hold |
-               +------------+    +------+
-                     |              |
-                     v              |
-                  +------+          |
-                  | send |<---------+
-                  +------+
+The flow through the access system is like this:
+
+               deny       +------+
+       +----------------->| deny |
+       |                  +------+
+       |
+       |       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
index bccd3e44519461abcf279742534338e943db355b..d0df126c8e02ded32a77006e61d0247fe7b60e23 100644 (file)
@@ -55,6 +55,7 @@
 
 enum action {
        ALLOW,
+       SEND,
        DENY,
        MODERATE,
        DISCARD
@@ -173,6 +174,9 @@ static enum action do_access(struct strlist *rule_strs, struct strlist *hdrs,
                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 @@ int main(int argc, char **argv)
        }
 
 startaccess:
+       if(!moderated)
+               moderated = statctrl(listdir, "moderated");
+
        noaccessdenymails = statctrl(listdir, "noaccessdenymails");
 
        access_rules = ctrlvalues(listdir, "access");
@@ -917,11 +924,13 @@ startaccess:
                        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);