changeset 890:49efd4fe7557

Add a tunable for moderation request lifetime.
author Ben Schmidt
date Tue, 04 Feb 2014 09:06:05 +1100
parents aa9e8d93c782
children 4dd2c703e917
files TUNABLES src/mlmmj-maintd.c
diffstat 2 files changed, 22 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/TUNABLES	Fri Jan 10 22:25:49 2014 +1100
+++ b/TUNABLES	Tue Feb 04 09:06:05 2014 +1100
@@ -50,6 +50,11 @@
    When this file is present, all postings from people who are not subscribed
    to the list will be moderated.
 
+ · modreqlife			(normal)
+
+   This specifies how long in seconds a mail awaits moderation before it's
+   discarded. Defaults to 604800 seconds, which is 7 days.
+
  · prefix			(normal)
 
    The prefix for the Subject: line of mails to the list. This will alter the
@@ -121,8 +126,8 @@
 
  · bouncelife			(normal)
 
-   Here is specified for how long time in seconds an address can bounce before
-   it's unsubscribed. Defaults to 432000 seconds, which is 5 days.
+   This specifies how long in seconds an address can bounce before it's
+   unsubscribed. Defaults to 432000 seconds, which is 5 days.
 
  · noarchive			(boolean)
 
@@ -132,12 +137,12 @@
  · nosubconfirm			(boolean)
 
    If this file exists, no mail confirmation is needed to subscribe to the
-   list. This should in principle never ever be used, but there is times
+   list. This should in principle never ever be used, but there are times
    on local lists etc. where this is useful. HANDLE WITH CARE!
 
  · noget			(boolean)
 
-   If this file exists, then retrieving old posts with +get-N is disabled
+   If this file exists, then retrieving old posts with +get-N is disabled.
 
  · subonlyget			(boolean)
 
--- a/src/mlmmj-maintd.c	Fri Jan 10 22:25:49 2014 +1100
+++ b/src/mlmmj-maintd.c	Tue Feb 04 09:06:05 2014 +1100
@@ -137,8 +137,20 @@
 
 int clean_moderation(const char *listdir)
 {
+
+	time_t modreqlife = 0;
+	char *modreqlifestr;
+
+	modreqlifestr = ctrlvalue(listdir, "modreqlife");
+	if(modreqlifestr) {
+		modreqlife = atol(modreqlifestr);
+		myfree(modreqlifestr);
+	}
+	if(modreqlife == 0)
+		modreqlife = MODREQLIFE;
+
 	char *moddirname = concatstr(2, listdir, "/moderation");
-	int ret = delolder(moddirname, MODREQLIFE);	
+	int ret = delolder(moddirname, modreqlife);
 		
 	myfree(moddirname);