# HG changeset patch # User Ben Schmidt # Date 1280498431 -36000 # Node ID e5286b45f9ca495962c3ad2aa7e00eb0bcec9192 # Parent 4575d3181ca14e77498f8e8012731d5e90bd4e7a Fixed documentation regarding silent subscription, and added ability to silently subscribe. diff -r 4575d3181ca1 -r e5286b45f9ca ChangeLog --- a/ChangeLog Fri Jul 30 23:54:56 2010 +1000 +++ b/ChangeLog Sat Jul 31 00:00:31 2010 +1000 @@ -1,3 +1,5 @@ + o Fixed documentation regarding silent subscription, and added + ability to silently subscribe o Added notmetoo feature where posts are not mirrored to their senders o Check return status in mlmmj-perl-admin when adding subscribers (Florian Streibelt, Bitmand) diff -r 4575d3181ca1 -r e5286b45f9ca TUNABLES --- a/TUNABLES Fri Jul 30 23:54:56 2010 +1000 +++ b/TUNABLES Sat Jul 31 00:00:31 2010 +1000 @@ -158,6 +158,12 @@ when it was rejected due to an access rule (see 'access') or whether it's a subscribers only posting list (see 'subonlypost'). + · nosubmodmails (boolean) + + This switch turns off whether mlmmj sends out notification about + subscription being moderated to the person requesting subscription + (see 'submod'). + · smtpport (normal) In this file a port other than port 25 for connecting to the relayhost diff -r 4575d3181ca1 -r e5286b45f9ca contrib/web/perl-admin/conf/tunables.pl --- a/contrib/web/perl-admin/conf/tunables.pl Fri Jul 30 23:54:56 2010 +1000 +++ b/contrib/web/perl-admin/conf/tunables.pl Sat Jul 31 00:00:31 2010 +1000 @@ -156,6 +156,12 @@ "This switch turns off whether mlmmj sends out notification about postings ". "being rejected due to a subscribers only posting list (see 'subonlypost')."); +mlmmj_boolean("nosubmodmails", + "No subscription moderated mails", + "This switch turns off whether mlmmj sends out notification about ". + "subscription being moderated to the person requesting subscription". + "(see 'submod')."); + mlmmj_boolean("nodigesttext", "No digest text summary", "This switch turns off whether digest mails will have a text part with a thread ". diff -r 4575d3181ca1 -r e5286b45f9ca contrib/web/php-admin/conf/tunables.pl --- a/contrib/web/php-admin/conf/tunables.pl Fri Jul 30 23:54:56 2010 +1000 +++ b/contrib/web/php-admin/conf/tunables.pl Sat Jul 31 00:00:31 2010 +1000 @@ -156,6 +156,12 @@ "This switch turns off whether mlmmj sends out notification about postings ". "being rejected due to a subscribers only posting list (see 'subonlypost')."); +mlmmj_boolean("nosubmodmails", + "No subscription moderated mails", + "This switch turns off whether mlmmj sends out notification about ". + "subscription being moderated to the person requesting subscription". + "(see 'submod')."); + mlmmj_boolean("nodigesttext", "No digest text summary", "This switch turns off whether digest mails will have a text part with a thread ". diff -r 4575d3181ca1 -r e5286b45f9ca man/mlmmj-sub.1 --- a/man/mlmmj-sub.1 Fri Jul 30 23:54:56 2010 +1000 +++ b/man/mlmmj-sub.1 Sat Jul 31 00:00:31 2010 +1000 @@ -1,18 +1,20 @@ -.TH mlmmj-sub "1" "September 2004" mlmmj-sub +.TH mlmmj-sub "1" "January 2010" mlmmj-sub .SH NAME mlmmj-sub \- subscribe address to a mailinglist run by mlmmj .SH SYNOPSIS .B mlmmj-sub \fI-L /path/to/list -a john@doe.org \fR[\fI-c\fR | \fI-C\fR] \fR[\fI-d\fR | \fI-n\fR] -[\fI-h\fR] [\fI-U\fR] [\fI-V\fR] +[\fI-f\fR] [\fI-h\fR] [\fI-U\fR] [\fI-V\fR] .HP \fB\-a\fR: Email address to subscribe .HP \fB\-c\fR: Send welcome mail .HP +\fB\-C\fR: Request mail confirmation +.HP \fB\-d\fR: Subscribe to digest version of the list .HP -\fB\-C\fR: Request mail confirmation +\fB\-f\fR: Force subscription (do not moderate) .HP \fB\-h\fR: This help .HP @@ -44,8 +46,11 @@ Normally a mail is sent to the subscriber if the address is already subscribed to the list. If the \fB\-s\fR switch is used such a mail will not be sent. -When neither \fB\-c\fR nor \fB\-C\fR are specified, subscription silently -happens. +Subscription may be moderated (if /control/submod exists) unless the +\fB\-f\fR switch is given. + +To ensure a silent subscription, use \fB\-f\fR, but neither \fB\-c\fR +nor \fB\-C\fR. .SH "SEE ALSO" mlmmj-unsub(1), setuid(2) .SH AUTHORS diff -r 4575d3181ca1 -r e5286b45f9ca src/mlmmj-sub.c --- a/src/mlmmj-sub.c Fri Jul 30 23:54:56 2010 +1000 +++ b/src/mlmmj-sub.c Sat Jul 31 00:00:31 2010 +1000 @@ -54,12 +54,12 @@ const char *listdelim, const char *subaddr, const char *mlmmjsend, enum subtype typesub) { - int i, fd; + int i, fd, status, nosubmodmails = 0; char *a = NULL, *queuefilename, *from, *listname, *listfqdn, *str; char *modfilename, *randomstr, *mods, *to, *replyto, *moderators = NULL; char *modfilebase; struct strlist *submods; - pid_t pid; + pid_t childpid, pid; char *maildata[6] = { "subaddr", NULL, "moderateaddr", NULL, "moderators", NULL }; @@ -151,16 +151,24 @@ myfree(maildata[1]); - /* we need to exec more than one mlmmj-send */ + /* we might need to exec more than one mlmmj-send */ - pid = fork(); + nosubmodmails = statctrl(listdir,"nosubmodmails"); - if(pid < 0) { - log_error(LOG_ARGS, "Could not fork for mlmmj-send" - "Request in %s not served", modfilename); - exit(EXIT_FAILURE); + if (nosubmodmails) + childpid = -1; + else { + childpid = fork(); + if(childpid < 0) + log_error(LOG_ARGS, "Could not fork; requester not notified"); } - if(pid == 0) { + + if(childpid != 0) { + if(childpid > 0) { + do /* Parent waits for the child */ + pid = waitpid(childpid, &status, 0); + while(pid == -1 && errno == EINTR); + } execl(mlmmjsend, mlmmjsend, "-a", "-l", "4", @@ -428,12 +436,13 @@ static void print_help(const char *prg) { - printf("Usage: %s -L /path/to/list [-a john@doe.org | -m str]" - "[-c] [-C] [-h]\n [-L] [-d | -n] [-s] [-U] [-V]\n" + printf("Usage: %s -L /path/to/list [-a john@doe.org | -m str]\n" + " [-c] [-C] [-f] [-h] [-L] [-d | -n] [-s] [-U] [-V]\n" " -a: Email address to subscribe \n" " -c: Send welcome mail\n" " -C: Request mail confirmation\n" " -d: Subscribe to digest of list\n" + " -f: Force subscription (do not moderate)\n" " -h: This help\n" " -L: Full path to list directory\n" " -m: moderation string\n" @@ -441,8 +450,8 @@ printf(" -s: Don't send a mail to subscriber if already subscribed\n" " -U: Don't switch to the user id of the listdir owner\n" " -V: Print version\n" - "When no options are specified, subscription silently " - "happens\n"); + "When no options are specified, subscription may be " + "moderated;\nto ensure a silent subscription, use -f\n"); exit(EXIT_SUCCESS); } @@ -487,6 +496,7 @@ int subconfirm = 0, confirmsub = 0, opt, subfilefd, lock, notifysub; int changeuid = 1, status, digest = 0, nomail = 0, i = 0, submod = 0; int groupwritable = 0, sublock, sublockfd, nogensubscribed = 0, subbed; + int force = 0; size_t len; struct stat st; pid_t pid, childpid; @@ -501,7 +511,7 @@ mlmmjsend = concatstr(2, bindir, "/mlmmj-send"); myfree(bindir); - while ((opt = getopt(argc, argv, "hcCdm:nsVUL:a:")) != -1) { + while ((opt = getopt(argc, argv, "hcCdfm:nsVUL:a:")) != -1) { switch(opt) { case 'a': address = optarg; @@ -515,6 +525,9 @@ case 'd': digest = 1; break; + case 'f': + force = 1; + break; case 'h': print_help(argv[0]); break; @@ -670,7 +683,7 @@ subbed = is_subbed_in(subddirname, address); listdelim = getlistdelim(listdir); if(modstr == NULL) - submod = statctrl(listdir, "submod"); + submod = !force && statctrl(listdir, "submod"); if(subbed) { if(subconfirm) { @@ -719,7 +732,7 @@ childpid = fork(); if(childpid < 0) { - log_error(LOG_ARGS, "Could not fork"); + log_error(LOG_ARGS, "Could not fork; owner not notified"); confirm_sub(listdir, listaddr, listdelim, address, mlmmjsend, typesub); } diff -r 4575d3181ca1 -r e5286b45f9ca src/mlmmj-unsub.c --- a/src/mlmmj-unsub.c Fri Jul 30 23:54:56 2010 +1000 +++ b/src/mlmmj-unsub.c Sat Jul 31 00:00:31 2010 +1000 @@ -274,7 +274,7 @@ static void print_help(const char *prg) { - printf("Usage: %s -L /path/to/list -a john@doe.org " + printf("Usage: %s -L /path/to/list -a john@doe.org\n" "[-c] [-C] [-h] [-L] [-d | -n] [-s] [-V]\n" " -a: Email address to unsubscribe \n" " -c: Send goodbye mail\n"