From: mmj Date: Mon, 24 Jan 2005 15:24:17 +0000 (+1100) Subject: Add switches to control whether or not mlmmj sends out mails explaining X-Git-Tag: RELEASE_1_2_12_RC1~140 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=80cce404e5710fbd968d3c17bc521c59beecb03f;p=thirdparty%2Fmlmmj.git Add switches to control whether or not mlmmj sends out mails explaining that posts got denied. --- diff --git a/ChangeLog b/ChangeLog index 5294636c..1dfe2939 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,5 @@ +1.2.1 + o Introduce switches to turn off mails about posts being denied. 1.2.0 o Remove debug info printing 1.2.0-RC2 diff --git a/TUNABLES b/TUNABLES index 4f070fc4..424136a8 100644 --- a/TUNABLES +++ b/TUNABLES @@ -119,3 +119,12 @@ to specify several entries (one pr. line), it's marked "list". · maxverprecips (normal) How many recipients pr. mail delivered to the smtp server. Defaults to 100. + + · notoccdenymails (boolean) + · noaccessdenymails (boolean) + · nosubonlydenymails (boolean) + + These switches turns off whether mlmmj sends out notification about postings + being denied due to the listaddress not being in To: or Cc: (see 'tocc'), + when it was rejected due to an access rule (see 'access') or whether it's a + subscribers only posting list (see 'subonlypost'). diff --git a/src/mlmmj-process.c b/src/mlmmj-process.c index 6362be33..e0d756e5 100644 --- a/src/mlmmj-process.c +++ b/src/mlmmj-process.c @@ -312,6 +312,7 @@ int main(int argc, char **argv) int i, opt, noprocess = 0, moderated = 0; int hdrfd, footfd, rawmailfd, donemailfd; int subonlypost = 0, addrtocc = 1, intocc = 0; + int notoccdenymails = 0, noaccessdenymails = 0, nosubonlydenymails = 0; char *listdir = NULL, *mailfile = NULL, *headerfilename = NULL; char *footerfilename = NULL, *donemailname = NULL; char *randomstr = NULL, *mqueuename; @@ -611,10 +612,14 @@ int main(int argc, char **argv) intocc = 1; } + notoccdenymails = statctrl(listdir, "notoccdenymails"); + if(addrtocc && !intocc) { /* Don't send a mail about denial to the list, but silently - * discard and exit */ - if (strcasecmp(listaddr, fromemails.emaillist[0]) == 0) { + * discard and exit. Also don't in case of it being turned off + */ + if ((strcasecmp(listaddr, fromemails.emaillist[0]) == 0) || + notoccdenymails) { myfree(listaddr); unlink(donemailname); myfree(donemailname); @@ -641,11 +646,14 @@ int main(int argc, char **argv) exit(EXIT_FAILURE); } + nosubonlydenymails = statctrl(listdir, "nosubonlydenymails"); + subonlypost = statctrl(listdir, "subonlypost"); if(subonlypost) { /* Don't send a mail about denial to the list, but silently - * discard and exit */ - if (strcasecmp(listaddr, fromemails.emaillist[0]) == 0) { + * discard and exit. Do the same if it's turned off */ + if ((strcasecmp(listaddr, fromemails.emaillist[0]) == 0) + || nosubonlydenymails) { myfree(listaddr); unlink(donemailname); myfree(donemailname); @@ -677,12 +685,15 @@ int main(int argc, char **argv) } } + noaccessdenymails = statctrl(listdir, "noaccessdenymails"); + access_rules = ctrlvalues(listdir, "access"); if (access_rules) { enum action accret; /* Don't send a mail about denial to the list, but silently - * discard and exit */ - if (strcasecmp(listaddr, fromemails.emaillist[0]) == 0) { + * discard and exit. Also do this in case it's turned off */ + if ((strcasecmp(listaddr, fromemails.emaillist[0]) == 0) + || noaccessdenymails) { myfree(listaddr); unlink(donemailname); myfree(donemailname);