changeset 513:cbcbd99cef84

subonlyget and confirmation possible with closedlist
author mmj
date Tue, 19 Jul 2005 19:10:04 +1000
parents 9d7d41368743
children f69f9ad26365
files ChangeLog TUNABLES VERSION src/listcontrol.c
diffstat 4 files changed, 16 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Jun 21 00:02:22 2005 +1000
+++ b/ChangeLog	Tue Jul 19 19:10:04 2005 +1000
@@ -1,3 +1,7 @@
+ o Make it possible to confirm subscription even though it's a closedlist.
+   It makes sense to be able to confirm a request submitted by the sysadmin
+   on the commandline
+ o Add 'subonlyget' tunable which makes +get-N only work for subscribers
 1.2.8
  o Don't closedir() before done (GOOD spotting Christian Laursen)
  o Make sure the resend of queue files will not loop indefinately
--- a/TUNABLES	Tue Jun 21 00:02:22 2005 +1000
+++ b/TUNABLES	Tue Jul 19 19:10:04 2005 +1000
@@ -120,6 +120,11 @@
 
    If this file exists, then retrieving old posts with +get-N is disabled
 
+ · subonlyget			(boolean)
+
+   If this file exists, then retrieving old posts with +get-N is only
+   possible for subscribers. The above mentioned 'noget' have precedence.
+
  · verp				(normal)
 
    Enable VERP support. Anything added in this variable will be appended the
--- a/VERSION	Tue Jun 21 00:02:22 2005 +1000
+++ b/VERSION	Tue Jul 19 19:10:04 2005 +1000
@@ -1,1 +1,1 @@
-1.2.8
+1.2.9
--- a/src/listcontrol.c	Tue Jun 21 00:02:22 2005 +1000
+++ b/src/listcontrol.c	Tue Jul 19 19:10:04 2005 +1000
@@ -44,6 +44,7 @@
 #include "memory.h"
 #include "log_oper.h"
 #include "ctrlvalues.h"
+#include "subscriberfuncs.h"
 
 enum ctrl_e {
 	CTRL_SUBSCRIBE_DIGEST,
@@ -106,7 +107,7 @@
 	const char *subswitch;
 	size_t len;
 	struct stat stbuf;
-	int closedlist, nosubconfirm, tmpfd, noget, i;
+	int closedlist, nosubconfirm, tmpfd, noget, i, subonlyget = 0;
 	size_t cmdlen;
 	unsigned int ctrl;
 	struct strlist *owners;
@@ -241,8 +242,6 @@
 	/* listname+subconf-digest-COOKIE@domain.tld */
 	case CTRL_CONFSUB_DIGEST:
 		unlink(mailname);
-		if (closedlist)
-			exit(EXIT_SUCCESS);
 		conffilename = concatstr(3, listdir, "/subconf/", param);
 		myfree(param);
 		if((tmpfd = open(conffilename, O_RDONLY)) < 0) {
@@ -268,8 +267,6 @@
 	/* listname+subconf-nomail-COOKIE@domain.tld */
 	case CTRL_CONFSUB_NOMAIL:
 		unlink(mailname);
-		if (closedlist)
-			exit(EXIT_SUCCESS);
 		conffilename = concatstr(3, listdir, "/subconf/", param);
 		myfree(param);
 		if((tmpfd = open(conffilename, O_RDONLY)) < 0) {
@@ -295,8 +292,6 @@
 	/* listname+subconf-COOKIE@domain.tld */
 	case CTRL_CONFSUB:
 		unlink(mailname);
-		if (closedlist)
-			exit(EXIT_SUCCESS);
 		conffilename = concatstr(3, listdir, "/subconf/", param);
 		myfree(param);
 		if((tmpfd = open(conffilename, O_RDONLY)) < 0) {
@@ -532,6 +527,10 @@
 		noget = statctrl(listdir, "noget");
 		if(noget)
 			exit(EXIT_SUCCESS);
+		subonlyget = statctrl(listdir, "subonlyget");
+		if(subonlyget)
+			if(is_subbed(listdir, fromemails->emaillist[0]) != 0)
+				exit(EXIT_SUCCESS);
 		/* sanity check--is it all digits? */
 		for(c = param; *c != '\0'; c++) {
 			if(!isdigit((int)*c))