+ 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.
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.
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.");
"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.");
+
?>
#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 */
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
#include "mygetline.h"
#include "wrappers.h"
#include "memory.h"
+#include "ctrlvalue.h"
static int maintdlogfd = -1;
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);
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))
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 */
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:"
#include <unistd.h>
#include <netdb.h>
#include <libgen.h>
+#include <time.h>
#include "strgen.h"
#include "wrappers.h"
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;
+}
+*/