]> git.ipfire.org Git - thirdparty/mlmmj.git/commitdiff
Add a "send" tunable
authorBaptiste Daroussin <bapt@FreeBSD.org>
Thu, 20 Oct 2022 11:03:18 +0000 (13:03 +0200)
committerBaptiste Daroussin <bapt@FreeBSD.org>
Thu, 20 Oct 2022 11:03:18 +0000 (13:03 +0200)
The "send" tunable corresponding to a list for emails from which
mails will sent unconditionally. It will not be moderated, nor subject
to subonlypost, nor modnonsubposts.

TUNABLES
src/mlmmj-process.c

index c42fbe33948ee0d690781947fcee00280a62290c..16195e9d2c7c42d44a11cbd8a1d935520ceb2df8 100644 (file)
--- a/TUNABLES
+++ b/TUNABLES
@@ -263,3 +263,10 @@ entire content is used as value, it's marked "text".
 
    When this file is present, mlmmj will stop issueing bounce probes. It is
    intended to temporary disable the bounce probe for debugging purpose.
+
+
+ ยท send                       (list)
+
+   The file contains a list of email address for which the mail will be sent
+   unconditionally. It will not be moderated, nor subject to subonlypost, nor
+   modnonsubposts.
index ce30e96b03a7a9a1cfe972a44b2578a62c6fcfa3..2917aea64e186f8d3b94c4a01e9e19345fc32db0 100644 (file)
@@ -477,6 +477,7 @@ int main(int argc, char **argv)
        struct email_container rpemails = { 0, NULL };
        struct email_container dtemails = { 0, NULL };
        struct strlist *access_rules = NULL;
+       struct strlist *list_rules = NULL;
        struct strlist *delheaders = NULL;
        struct strlist allheaders;
        struct strlist *listaddrs = NULL;
@@ -1023,6 +1024,16 @@ int main(int argc, char **argv)
                }
        }
 
+       list_rules = ctrlvalues(listdir, "send");
+       if (list_rules != NULL) {
+               for (i = 0; i < list_rules->count; i++) {
+                       if (strcasecmp(posteraddr, list_rules->strs[i]) == 0) {
+                               send = 1;
+                               break;
+                       }
+               }
+       }
+
        subonlypost = statctrl(listdir, "subonlypost");
        modonlypost = statctrl(listdir, "modonlypost");
        modnonsubposts = statctrl(listdir, "modnonsubposts");