changeset 602:0b274cc500de

modnonsubposts
author mmj
date Tue, 05 Dec 2006 04:24:27 +1100
parents f98f595b77b6
children fe965a712a36
files ChangeLog TUNABLES src/mlmmj-process.c
diffstat 3 files changed, 19 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Nov 15 00:15:54 2006 +1100
+++ b/ChangeLog	Tue Dec 05 04:24:27 2006 +1100
@@ -1,3 +1,5 @@
+ o Add 'modnonsubposts' tunable that when set will moderate all posts
+   from non subscribers
  o Fixed requeue for lists with noarchive enabled
 1.2.12
  o Fixed memory corruption in cleanquotedp()
--- a/TUNABLES	Wed Nov 15 00:15:54 2006 +1100
+++ b/TUNABLES	Tue Dec 05 04:24:27 2006 +1100
@@ -44,6 +44,11 @@
    When this file is present, only people who are subscribed to the list,
    are allowed to post to it. The check is made against the "From:" header.
 
+ · modnonsubposts		(boolean)
+
+   When this file is present, all postings from people who are not subscribed
+   to the list will be moderated.
+
  · prefix			(normal)
 
    The prefix for the Subject: line of mails to the list. This will alter the
--- a/src/mlmmj-process.c	Wed Nov 15 00:15:54 2006 +1100
+++ b/src/mlmmj-process.c	Tue Dec 05 04:24:27 2006 +1100
@@ -347,7 +347,7 @@
 {
 	int i, j, opt, noprocess = 0, moderated = 0;
 	int hdrfd, footfd, rawmailfd, donemailfd;
-	int subonlypost = 0, addrtocc = 1, intocc = 0;
+	int subonlypost = 0, addrtocc = 1, intocc = 0, modnonsubposts = 0;
 	int notoccdenymails = 0, noaccessdenymails = 0, nosubonlydenymails = 0;
 	char *listdir = NULL, *mailfile = NULL, *headerfilename = NULL;
 	char *footerfilename = NULL, *donemailname = NULL;
@@ -742,8 +742,6 @@
 		exit(EXIT_FAILURE);
 	}
 
-	nosubonlydenymails = statctrl(listdir, "nosubonlydenymails");
-
 	subonlypost = statctrl(listdir, "subonlypost");
 	if(subonlypost) {
 		/* Don't send a mail about denial to the list, but silently
@@ -759,6 +757,16 @@
 			exit(EXIT_SUCCESS);
 		}
 		if(is_subbed(listdir, fromemails.emaillist[0]) != 0) {
+			modnonsubposts = statctrl(listdir,
+					"modnonsubposts");
+			if(modnonsubposts) {
+				moderated = 1;
+				goto startaccess;
+			}
+			
+			nosubonlydenymails = statctrl(listdir,
+					"nosubonlydenymails");
+
 			if(nosubonlydenymails) {
 				log_error(LOG_ARGS, "Discarding %s because"
 						" subonlypost and"
@@ -796,6 +804,7 @@
 		}
 	}
 
+startaccess:
 	noaccessdenymails = statctrl(listdir, "noaccessdenymails");
 
 	access_rules = ctrlvalues(listdir, "access");