]> git.ipfire.org Git - thirdparty/mlmmj.git/commitdiff
Bouncelife and crontab entry fix and a commented out genmsgid() function
authormmj <none@none>
Tue, 7 Sep 2004 11:49:11 +0000 (21:49 +1000)
committermmj <none@none>
Tue, 7 Sep 2004 11:49:11 +0000 (21:49 +1000)
ChangeLog
TUNABLES
contrib/web/perl-admin/conf/tunables.pl
contrib/web/php-admin/conf/tunables.php
include/mlmmj.h
src/Makefile.am
src/mlmmj-maintd.c
src/mlmmj-make-ml.sh
src/strgen.c

index 0d30a37e581ddfa1dce62055a19529bfc895cf41..58897bd9e203494190284af128693dbeaf32452b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+ o Make the time an address can bounce before unsubscribed configurable with
+   listdir/control/bouncelife
+ o Correct mlmmj-make-ml.sh cronentry line to include -F
  o Add manual pages. Thanks Soeren Boll for the initial ones
  o Make random numbers lowercase hex since gmail is lowercasing the address
    it replies to.
index e3eec3d8aeed1fce6cafeb1dc5cc3a21f150c1ae..f6e090fd42a3cc2cb6a495817e79a6e623f37eed 100644 (file)
--- a/TUNABLES
+++ b/TUNABLES
@@ -77,3 +77,8 @@ to specify several entries (one pr. line), it's marked "list".
 
    If this file is present, the owner(s) will get a mail with the address of
    someone sub/unsubscribing to a mailinglist.
+
+ ยท 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.
index 1fba5713abe44e83b76819558bdc581cd32ac738..3a0cdbf7e30dcafd506187ba0e87bd1ed5f9f297 100644 (file)
@@ -59,3 +59,7 @@ mlmmj_string("relayhost",
 mlmmj_boolean("notifysub",
                          "Notify subscribers",
                          "If this option is set, the owner(s) will get a mail with the address of someone sub/unsubscribing to a mailinglist.");
+mlmmj_string("bouncelife",
+                         "Bouncing lifetime",
+                         "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.");
index 8ed23a5c5663d8c502fd12b72e623b571f246df9..d9809e92998cd15f5ebece2e756e0b9aa439e9fe 100644 (file)
@@ -62,4 +62,9 @@ mlmmj_boolean("notifysub",
                          "Notify subscribers",
                          "If this option is set, the owner(s) will get a mail with the address of someone sub/unsubscribing to a mailinglist.");
 
+mlmmj_string("bouncelife",
+                         "Bouncing lifetime",
+                         "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.");
+
 ?>
index 022eeb1a5c1fc2165adfd0784dc8d244ac3ea30b..b7b539dd05b24c3d6169caa937676bdcca0bb5a9 100644 (file)
@@ -36,7 +36,8 @@
 #define CONFIRMLIFE 604800 /* How long time will (un)sub confirmations be kept?
                            * 604800s is 7 days */
 #define BOUNCELIFE 432000 /* How long time can addresses bounce before
-                            unsubscription happens? 432000s is 5 days */
+                            unsubscription happens? 432000s is 5 days
+                            Tweakable with control/bouncelife */
 #define WAITPROBE 43200   /* How long do we wait for a bounce of the probe
                             mail before concluding the address is no longer
                             bouncing? 43200 is 12 hours */
index 13468cf04cbb34f10946d45165db95f247a7c62d..a8a5a16596d479d8826658eaccb6b19469228190 100644 (file)
@@ -46,4 +46,5 @@ mlmmj_bounce_SOURCES = mlmmj-bounce.c print-version.c log_error.c \
                       memory.c
 
 mlmmj_maintd_SOURCES = mlmmj-maintd.c print-version.c log_error.c mygetline.c \
-                      strgen.c random-int.c chomp.c writen.c memory.c
+                      strgen.c random-int.c chomp.c writen.c memory.c \
+                      ctrlvalue.c
index ac330eed023c6a6739f5e7ee2af7b5e77da921ba..8dc65809a9ae8fd866d87166becc3bd2f635598c 100644 (file)
@@ -41,6 +41,7 @@
 #include "mygetline.h"
 #include "wrappers.h"
 #include "memory.h"
+#include "ctrlvalue.h"
 
 static int maintdlogfd = -1;
 
@@ -603,12 +604,12 @@ int unsub_bouncers(const char *listdir, const char *mlmmjunsub)
        DIR *bouncedir;
        char *dirname = concatstr(2, listdir, "/bounce/");
        char *probefile, *address, *a, *firstbounce, *bouncedata;
-       char *logstr;
+       char *logstr, *bouncelifestr;
        struct dirent *dp;
        struct stat st;
        pid_t pid, childpid;
        int status, fd;
-       time_t bouncetime, t;
+       time_t bouncetime, t, bouncelife = 0;
        
        if(chdir(dirname) < 0) {
                log_error(LOG_ARGS, "Could not chdir(%s)", dirname);
@@ -624,6 +625,15 @@ int unsub_bouncers(const char *listdir, const char *mlmmjunsub)
 
        myfree(dirname);
 
+       bouncelifestr = ctrlvalue(listdir, "bouncelife");
+       if(bouncelifestr) {
+               bouncelife = atol(bouncelifestr);
+               myfree(bouncelifestr);
+       }
+       
+       if(bouncelife == 0)
+               bouncelife = BOUNCELIFE;
+
        while((dp = readdir(bouncedir)) != NULL) {
                if((strcmp(dp->d_name, "..") == 0) ||
                   (strcmp(dp->d_name, ".") == 0))
@@ -682,7 +692,7 @@ int unsub_bouncers(const char *listdir, const char *mlmmjunsub)
                bouncetime = (time_t)strtol(a, NULL, 10);
                myfree(firstbounce);
                t = time(NULL);
-               if(t - bouncetime < BOUNCELIFE + WAITPROBE)
+               if(t - bouncetime < bouncelife + WAITPROBE)
                        continue; /* ok, don't unsub this one */
                
                /* Ok, go ahead and unsubscribe the address */
index 3aae0cf2f5df3f2dcd8cf9def7095b497edcc3ff..83185c25354c2c149ea7b40538cf12cf46713adf 100755 (executable)
@@ -106,7 +106,7 @@ if [ -z "$MLMMJRECIEVE" ]; then
 fi
 
 ALIAS="$LISTNAME:  \"|$MLMMJRECIEVE -L $SPOOLDIR/$LISTNAME/\""
-CRONENTRY="0 */2 * * * \"$MLMMJMAINTD -L $SPOOLDIR/$LISTNAME/\""
+CRONENTRY="0 */2 * * * \"$MLMMJMAINTD -F -L $SPOOLDIR/$LISTNAME/\""
 
 if [ -n "$A_CREATE" ]; then
        echo "I want to add the following to your /etc/aliases file:"
index d3412f1228424d9f5cb5ac8c5bc8330b90a7016f..0d46dce4a1a26c2b881ec018158675e7a66b99e4 100644 (file)
@@ -28,6 +28,7 @@
 #include <unistd.h>
 #include <netdb.h>
 #include <libgen.h>
+#include <time.h>
 
 #include "strgen.h"
 #include "wrappers.h"
@@ -212,3 +213,23 @@ char *cleanquotedp(char *qpstr)
 
        return retstr;
 }
+
+/* Unused for now, but lets keep it for later
+
+char *genmsgid()
+{
+       size_t len = 128;
+       char *s = mymalloc(len), *retstr;
+       time_t t;
+
+       t = time(NULL);
+
+       snprintf(s, len-1, "<%ld-%x-mlmmj-%x@%x.plonk", t, random_int(),
+                               random_int(), random_int());
+
+       retstr = concatstr(3, "Message-ID: ", s, ">\n");
+       myfree(s);
+       
+       return retstr;
+}
+*/