changeset 527:4030f2232cb2

New tunable - closedlistsub
author mmj
date Thu, 05 Jan 2006 06:10:24 +1100
parents 02d43c78db9b
children 97fc5e75e1ff
files src/listcontrol.c
diffstat 1 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/listcontrol.c	Tue Dec 20 20:54:12 2005 +1100
+++ b/src/listcontrol.c	Thu Jan 05 06:10:24 2006 +1100
@@ -108,7 +108,8 @@
 	const char *subswitch;
 	size_t len;
 	struct stat stbuf;
-	int closedlist, nosubconfirm, tmpfd, noget, i, subonlyget = 0;
+	int closedlist, nosubconfirm, tmpfd, noget, i, closedlistsub,
+	    subonlyget = 0;
 	size_t cmdlen;
 	unsigned int ctrl;
 	struct strlist *owners;
@@ -116,6 +117,9 @@
 	/* A closed list doesn't allow subscribtion and unsubscription */
 	closedlist = statctrl(listdir, "closedlist");
 
+	/* A closed list "sub" only dissallows subscription, not unsub. */
+	closedlistsub = statctrl(listdir, "closedlistsub");
+
 	nosubconfirm = statctrl(listdir, "nosubconfirm");
 	if(nosubconfirm)
 		subswitch = "-c";
@@ -183,7 +187,7 @@
 	/* listname+subscribe-digest@domain.tld */
 	case CTRL_SUBSCRIBE_DIGEST:
 		unlink(mailname);
-		if (closedlist)
+		if (closedlist || closedlistsub)
 			exit(EXIT_SUCCESS);
 		if (!strchr(fromemails->emaillist[0], '@'))
 			/* Not a valid From: address, silently ignore */
@@ -204,7 +208,7 @@
 	/* listname+subscribe-nomail@domain.tld */
 	case CTRL_SUBSCRIBE_NOMAIL:
 		unlink(mailname);
-		if (closedlist)
+		if (closedlist || closedlistsub)
 			exit(EXIT_SUCCESS);
 		if (!strchr(fromemails->emaillist[0], '@'))
 			/* Not a valid From: address, silently ignore */
@@ -225,7 +229,7 @@
 	/* listname+subscribe@domain.tld */
 	case CTRL_SUBSCRIBE:
 		unlink(mailname);
-		if (closedlist)
+		if (closedlist || closedlistsub)
 			exit(EXIT_SUCCESS);
 		if (!strchr(fromemails->emaillist[0], '@'))
 			/* Not a valid From: address, silently ignore */