From 9780b7769672b0e35b75322685619c2a7561ad84 Mon Sep 17 00:00:00 2001 From: Ben Schmidt Date: Tue, 4 Feb 2014 09:06:05 +1100 Subject: [PATCH] Add a tunable for moderation request lifetime. --HG-- extra : rebase_source : f31a9d0c0c9875f7fc860fd654c9a4520343c9ee --- TUNABLES | 13 +++++++++---- src/mlmmj-maintd.c | 14 +++++++++++++- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/TUNABLES b/TUNABLES index ba5c67cc..749ff702 100644 --- a/TUNABLES +++ b/TUNABLES @@ -50,6 +50,11 @@ entire content is used as value, it's marked "text". 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 @@ entire content is used as value, it's marked "text". · 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 @@ entire content is used as value, it's marked "text". · 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) diff --git a/src/mlmmj-maintd.c b/src/mlmmj-maintd.c index 66297219..99ea01a7 100644 --- a/src/mlmmj-maintd.c +++ b/src/mlmmj-maintd.c @@ -137,8 +137,20 @@ int delolder(const char *dirname, time_t than) 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); -- 2.47.3