All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Schmidt <mail_ben_schmidt@yahoo.com.au>
To: mlmmj@mlmmj.org
Subject: Re: PATCH: Access priority
Date: Thu, 18 Feb 2010 14:27:55 +0000	[thread overview]
Message-ID: <4B7D4E6B.4030901@yahoo.com.au> (raw)
In-Reply-To: <4B5D7A55.4090302@yahoo.com.au>

[-- Attachment #1: Type: text/plain, Size: 1210 bytes --]

>>> One possible solution - at least to the bypass moderation problem -
>>> might be to add another keyword. We could add "send" to force the mail
>>> past normal moderation procedures.
>>
>> Exactly what I was thinking after reading the issues you raised above.
> ...
>> Shall I put together a new patch?
>
> Yes, that would be nice.

Attached. It applies on top of the ASCII art patch.

Mind you, it changes the ASCII art to something different...I found it
pretty impossible to try to incorporate the 'send' into the existing
picture, and ended up turning the whole thing around. I don't think it's
as good that way around, but at least it fits. Maybe you can do a better
job incorporating it into the old one, Morten.

The patch has not been tested yet, though it builds OK. But definitely
don't commit it until at least someone has tested it. I will try to give
it a whirl early next week.

>> - if the third flow is choosen, don't call the new keyword plain
>>    "send", call it eg. "force-send" or "bypass-mod" or so. People tend
>>    to like descriptive keywords :-)
>
> Why break a tradition of choosing ambiguous keywords? ;-)

I don't think it's too ambiguous, so have stuck with 'send'.

Ben.




[-- Attachment #2: mlmmj-access-3.patch --]
[-- Type: text/x-patch, Size: 3771 bytes --]

diff -r 490e905b4aca README.access
--- a/README.access	Thu Feb 18 18:28:52 2010 +1100
+++ b/README.access	Thu Feb 18 19:00:24 2010 +1100
@@ -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:
 
-                      |
-                      v
-+--------+   deny +--------+ discard   +---------+
-| reject |<-------| access |---------->| discard |
-+--------+        +--------+           +---------+
-               allow |  | moderate
-                     |  +-----------+
-                     v              v
-               +------------+    +------+
-               | moderation |--->| hold |
-               +------------+    +------+
-                     |              |
-                     v              |
-                  +------+          |
-                  | send |<---------+
-                  +------+
+               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
diff -r 490e905b4aca src/mlmmj-process.c
--- a/src/mlmmj-process.c	Thu Feb 18 18:28:52 2010 +1100
+++ b/src/mlmmj-process.c	Thu Feb 18 19:00:24 2010 +1100
@@ -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;
@@ -852,6 +856,9 @@
 	}
 
 startaccess:
+	if(!moderated)
+		moderated = statctrl(listdir, "moderated");
+
 	noaccessdenymails = statctrl(listdir, "noaccessdenymails");
 
 	access_rules = ctrlvalues(listdir, "access");
@@ -918,13 +925,15 @@
 			myfree(donemailname);
 			myfree(discardname);
                 	exit(EXIT_SUCCESS);
+		} else if (accret == SEND) {
+			moderated = 0;
+		} else if (accret == ALLOW) {
+			/* continue processing as normal */
 		}
 	}
 
 	notmetoo = statctrl(listdir, "notmetoo");
 
-	if(!moderated)
-		moderated = statctrl(listdir, "moderated");
 	if(moderated) {
 		mqueuename = concatstr(3, listdir, "/moderation/",
 				       randomstr);

  parent reply	other threads:[~2010-02-18 14:27 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-25 11:02 PATCH: Access priority Ben Schmidt
2010-01-25 13:41 ` Ben Schmidt
2010-02-16 16:52 ` Morten Shearman Kirkegaard
2010-02-16 21:40 ` Ben Schmidt
2010-02-16 22:03 ` Franky Van Liedekerke
2010-02-17  8:21 ` Mads Martin Jørgensen
2010-02-17 21:40 ` Morten Shearman Kirkegaard
2010-02-17 22:56 ` Franky Van Liedekerke
2010-02-18 10:39 ` Morten Shearman Kirkegaard
2010-02-18 14:27 ` Ben Schmidt [this message]
2010-02-18 15:15 ` Morten Shearman Kirkegaard
2010-03-09 22:32 ` [mlmmj] " Ben Schmidt
2010-04-10 19:52 ` Morten Shearman Kirkegaard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B7D4E6B.4030901@yahoo.com.au \
    --to=mail_ben_schmidt@yahoo.com.au \
    --cc=mlmmj@mlmmj.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.