]> git.ipfire.org Git - thirdparty/mlmmj.git/commitdiff
subrelease: if there are moderator defined, then deactivate subrelease
authorBaptiste Daroussin <bapt@FreeBSD.org>
Fri, 17 Apr 2026 07:44:52 +0000 (09:44 +0200)
committerBaptiste Daroussin <bapt@FreeBSD.org>
Fri, 17 Apr 2026 08:19:10 +0000 (10:19 +0200)
23 files changed:
listtexts/ast/deny-post
listtexts/ast/wait-post
listtexts/cs/deny-post
listtexts/cs/wait-post
listtexts/de/deny-post
listtexts/de/wait-post
listtexts/en/deny-post
listtexts/fi/deny-post
listtexts/fi/wait-post
listtexts/fr/deny-post
listtexts/fr/wait-post
listtexts/gr/deny-post
listtexts/gr/wait-post
listtexts/it/deny-post
listtexts/it/wait-post
listtexts/pt/deny-post
listtexts/pt/wait-post
listtexts/sk/deny-post
listtexts/sk/wait-post
listtexts/zh-cn/deny-post
listtexts/zh-cn/wait-post
src/mlmmj-process.c
tests/mlmmj-receive.sh

index e23ab8189964f8911c3ff4089995695a51709c25..5158e9c6bece98d4e3adf1ce1a65acd0c110ec74 100644 (file)
@@ -30,9 +30,9 @@ entregar a la llista
 %ifreason subonlypost%
   porque nun yes suscriptor de la llista.
 
-  %ifncontrol closedlist%%ifncontrol closedlistsub%
+  %ifncontrol closedlist%%ifncontrol closedlistsub%%ifncontrol moderators%
     %^%%text subrelease%
-  %endif%%endif%
+  %endif%%endif%%endif%
 
   %ifcontrol closedlist closedlistsub%
     %^%%wrap%Si quies suscribite, tendrás de comunicate con un alministrador
index 6c871818d3c79b147cbdba27b2f460997490f808..7702b783facbd86539484ed3913b3d435401f0c2 100644 (file)
@@ -22,9 +22,9 @@ a la llista
 %ifreason modnonsubposts%
   porque nun yes suscriptor.
 
-  %ifncontrol closedlist%%ifncontrol closedlistsub%
+  %ifncontrol closedlist%%ifncontrol closedlistsub%%ifncontrol moderators%
     %^%%text subrelease%
-  %endif%%endif%
+  %endif%%endif%%endif%
 %endif%
 
 (El mensaxe ta más abaxo.)
index 97e2af51d671cc4ab8938a63262951f5a967d471..14bb82708459f5e08608b3a97bf68501618c5320 100644 (file)
@@ -29,9 +29,9 @@ Zpráva byla zamítnuta moderátorem konference.
 %ifreason subonlypost%
   Adresa, ze které byla zpráva zaslána, není v seznamu členů konference.
 
-  %ifncontrol closedlist%%ifncontrol closedlistsub%
+  %ifncontrol closedlist%%ifncontrol closedlistsub%%ifncontrol moderators%
     %^%%text subrelease%
-  %endif%%endif%
+  %endif%%endif%%endif%
 
   %ifcontrol closedlist closedlistsub%
     %^%%wrap%Pokud si přejete být členem konference kontaktujte správce.
index 5401bc5c1bac90f2dbedffaab4d990c2e4aeef87..a3a93ae87ff97f4f445a74f9662adfb58fbd24da 100644 (file)
@@ -21,9 +21,9 @@ Moderátoři konference byli kontaktováni, aby tuto zprávu schválili před za
 %ifreason modnonsubposts%
   Důvodem je, že nejste členem konference (nebo píšete zprávu z adresy, se kterou nejste v konferenci přihlášen).
 
-  %ifncontrol closedlist%%ifncontrol closedlistsub%
+  %ifncontrol closedlist%%ifncontrol closedlistsub%%ifncontrol moderators%
     %^%%text subrelease%
-  %endif%%endif%
+  %endif%%endif%%endif%
 %endif%
 
 (Zpráva je uvedena níže.)
index 88a7d695c9461fa3817951a5a44fb32ce08a4128..09e734864818de27fe897916977f24a592d4c53d 100644 (file)
@@ -32,9 +32,9 @@ nicht über die Liste verteilt werden,
 %ifreason subonlypost%
   weil Sie die Liste nicht abonniert haben.
 
-  %ifncontrol closedlist%%ifncontrol closedlistsub%
+  %ifncontrol closedlist%%ifncontrol closedlistsub%%ifncontrol moderators%
     %^%%text subrelease%
-  %endif%%endif%
+  %endif%%endif%%endif%
 
   %ifcontrol closedlist closedlistsub%
     %^%%wrap%Wenn Sie die Liste abonnieren möchten, kontaktieren Sie einen
index b53a23baa9fe34d7003681a918c6d628362a7804..29c76d8916e606a637d547babf9e2be172341ed2 100644 (file)
@@ -22,9 +22,9 @@ erforderlich,
 %ifreason modnonsubposts%
   weil Sie nicht auf der Liste eingeschrieben sind.
 
-  %ifncontrol closedlist%%ifncontrol closedlistsub%
+  %ifncontrol closedlist%%ifncontrol closedlistsub%%ifncontrol moderators%
     %^%%text subrelease%
-  %endif%%endif%
+  %endif%%endif%%endif%
 %endif%
 
 (Die ist unten angefügt.)
index 183814c29f073c9b052a76f556917f210c0ee04e..e9b1f2edf465b26ccc5346527dd8ec034f34236a 100644 (file)
@@ -31,9 +31,9 @@ be delivered to the list
 %ifreason subonlypost%
   because you are not a list subscriber.
 
-  %ifncontrol closedlist%%ifncontrol closedlistsub%
+  %ifncontrol closedlist%%ifncontrol closedlistsub%%ifncontrol moderators%
     %^%%text subrelease%
-  %endif%%endif%
+  %endif%%endif%%endif%
 
   %ifcontrol closedlist closedlistsub%
     %^%%wrap%If you wish to become a subscriber, you will need to contact a
index ff9924116be457f569b2e9d731e8ef012c699a63..be11d559510a54705c4e963027a38fd8b58b1091 100644 (file)
@@ -33,9 +33,9 @@ välittää postituslistalle,
 %ifreason subonlypost%
   koska et ole postituslistan tilaaja.
 
-  %ifncontrol closedlist%%ifncontrol closedlistsub%
+  %ifncontrol closedlist%%ifncontrol closedlistsub%%ifncontrol moderators%
     %^%%text subrelease%
-  %endif%%endif%
+  %endif%%endif%%endif%
 
   %ifcontrol closedlist closedlistsub%
     %^%%wrap%Jos haluta liittyä postituslistalle, ota yhteyttä listan
index 0c6c86737817453cb192d97b03d0b863756667f3..0e07b41de5c32a9ba2adbfe38b633adbe2be612f 100644 (file)
@@ -22,9 +22,9 @@ on hyväksyttävä se,
 %ifreason modnonsubposts%
   koska et ole postituslistan tilaaja.
 
-  %ifncontrol closedlist%%ifncontrol closedlistsub%
+  %ifncontrol closedlist%%ifncontrol closedlistsub%%ifncontrol moderators%
     %^%%text subrelease%
-  %endif%%endif%
+  %endif%%endif%%endif%
 %endif%
 
 (Lähetetty viesti on alla.)
index 2f05687d37a5c6f819b614cc6f638e38f04ba6a8..86057dc3990e0341a7b43b0610400901439f565b 100644 (file)
@@ -33,9 +33,9 @@ Content-Transfer-Encoding: 8bit
 %ifreason subonlypost%
   parce que vous n'êtes pas un inscrit de la liste.
 
-  %ifncontrol closedlist%%ifncontrol closedlistsub%
+  %ifncontrol closedlist%%ifncontrol closedlistsub%%ifncontrol moderators%
     %^%%text subrelease%
-  %endif%%endif%
+  %endif%%endif%%endif%
 
   %ifcontrol closedlist closedlistsub%
     %^%%wrap%Si vous souhaitez vous inscrire, vous devez contacter un
index abc878fe54bdccaf74c932024d9649ac7c81b601..d4211add074a2c270555b07536c79cd60fb9b5a3 100644 (file)
@@ -22,9 +22,9 @@ de le délivrer à la liste
 %ifreason modnonsubposts%
   parce que vous n'êtes pas inscrit.
 
-  %ifncontrol closedlist%%ifncontrol closedlistsub%
+  %ifncontrol closedlist%%ifncontrol closedlistsub%%ifncontrol moderators%
     %^%%text subrelease%
-  %endif%%endif%
+  %endif%%endif%%endif%
 %endif%
 
 (Le message apparaît ci-dessous.)
index 74375804da56be6f3910f740de39334ea225f4ca..c97409a614e963c89aceee775c984191a5957f57 100644 (file)
@@ -32,9 +32,9 @@ Content-Transfer-Encoding: 8bit
 %ifreason subonlypost%
   καθώς δεν είστε εγγεγραμμένος στη λίστα.
 
-  %ifncontrol closedlist%%ifncontrol closedlistsub%
+  %ifncontrol closedlist%%ifncontrol closedlistsub%%ifncontrol moderators%
     %^%%text subrelease%
-  %endif%%endif%
+  %endif%%endif%%endif%
 
   %ifcontrol closedlist closedlistsub%
     %^%%wrap%Αν επιθυμείτε να εγγραφείτε στη λίστα ταχυδρομείου, αρκεί να
index 60f36571a3e79fc2eb754f08d0ae0281c5a86ab4..23eeb6f92af913569bcbe3910018d4da7047df00 100644 (file)
@@ -22,9 +22,9 @@ Content-Transfer-Encoding: 8bit
 %ifreason modnonsubposts%
   καθώς δεν είστε εγγεγραμμένος χρήστης.
 
-  %ifncontrol closedlist%%ifncontrol closedlistsub%
+  %ifncontrol closedlist%%ifncontrol closedlistsub%%ifncontrol moderators%
     %^%%text subrelease%
-  %endif%%endif%
+  %endif%%endif%%endif%
 %endif%
 
 (Παρακάτω ακολουθεί το μήνυμα.)
index 07fff12cd22dd73ddb3701c080b5591f82abc257..cb293a372652a9189c0a941faf742fe310c542ea 100644 (file)
@@ -33,9 +33,9 @@ Content-Transfer-Encoding: 8bit
 %ifreason subonlypost%
   perché non sei iscritto/a alla lista.
 
-  %ifncontrol closedlist%%ifncontrol closedlistsub%
+  %ifncontrol closedlist%%ifncontrol closedlistsub%%ifncontrol moderators%
     %^%%text subrelease%
-  %endif%%endif%
+  %endif%%endif%%endif%
 
   %ifcontrol closedlist closedlistsub%
     %^%%wrap%Se desideri iscriverti, devi contattare l'amministratore della
index a1540a493f74aa7d037359114b4efdbacffddf6c..438e4550290b0e32d3e61cd95bff71a11f09c360 100644 (file)
@@ -22,9 +22,9 @@ di rilasciarlo,
 %ifreason modnonsubposts%
   perché non sei iscritto/a.
 
-  %ifncontrol closedlist%%ifncontrol closedlistsub%
+  %ifncontrol closedlist%%ifncontrol closedlistsub%%ifncontrol moderators%
     %^%%text subrelease%
-  %endif%%endif%
+  %endif%%endif%%endif%
 %endif%
 
 (Il messaggio è riportato sotto.)
index d281af01cc8ce9897446b3ee88d4695f02949edf..4eb9729913ae5baa51f87fc88ddcc42c4487ac1c 100644 (file)
@@ -30,9 +30,9 @@ entregue na lista
 %ifreason subonlypost%
   porque você não faz parte da lista.
 
-  %ifncontrol closedlist%%ifncontrol closedlistsub%
+  %ifncontrol closedlist%%ifncontrol closedlistsub%%ifncontrol moderators%
     %^%%text subrelease%
-  %endif%%endif%
+  %endif%%endif%%endif%
 
   %ifcontrol closedlist closedlistsub%
     %^%%wrap%Se pretender subscrever a lista, tem que contactar um
index be343ac5fc79f0fb468019136b33ec48d48a780c..276eee0b9f347d3aa7d301d74d3b98151263c07d 100644 (file)
@@ -22,9 +22,9 @@ lista de espera para revisão
 %ifreason modnonsubposts%
   porque você não é um subscritor.
 
-  %ifncontrol closedlist%%ifncontrol closedlistsub%
+  %ifncontrol closedlist%%ifncontrol closedlistsub%%ifncontrol moderators%
     %^%%text subrelease%
-  %endif%%endif%
+  %endif%%endif%%endif%
 %endif%
 
 (Mensagem segue em baixo.)
index ef9c1e173d6e1a9662f299216b06342685748f18..023393e4f92a2c7e9615a2574adab2623e248d9d 100644 (file)
@@ -31,9 +31,9 @@ do mailovej diskusie
 %ifreason subonlypost%
   lebo nie ste abonentom diskusie.
 
-  %ifncontrol closedlist%%ifncontrol closedlistsub%
+  %ifncontrol closedlist%%ifncontrol closedlistsub%%ifncontrol moderators%
     %^%%text subrelease%
-  %endif%%endif%
+  %endif%%endif%%endif%
 
   %ifcontrol closedlist closedlistsub%
     %^%%wrap%Ak sa chcete stať abonentom, kontaktujte administrátora
index fcdd7b75f5a16cafce580d34c49ca08a8a1ba572..12842fc62a7b9189b848a1f25b66a137e6e0de0d 100644 (file)
@@ -22,9 +22,9 @@ odsúhlasenie, lebo
 %ifreason modnonsubposts%
   nie ste jej abonentom.
 
-  %ifncontrol closedlist%%ifncontrol closedlistsub%
+  %ifncontrol closedlist%%ifncontrol closedlistsub%%ifncontrol moderators%
     %^%%text subrelease%
-  %endif%%endif%
+  %endif%%endif%%endif%
 %endif%
 
 (Správa je pripojená.)
index e5c4959f22cf58a81b8d969635ee0e87b44b298c..25d54abd819ed628d0388fd0af77bd6a07ebb7ff 100644 (file)
@@ -29,9 +29,9 @@ Content-Transfer-Encoding: 8bit
 %ifreason subonlypost%
   因为您不是列表订户\=。
 
-  %ifncontrol closedlist%%ifncontrol closedlistsub%
+  %ifncontrol closedlist%%ifncontrol closedlistsub%%ifncontrol moderators%
     %text subrelease%
-  %endif%%endif%
+  %endif%%endif%%endif%
 
   %ifcontrol closedlist closedlistsub%
     %^%%wrap%如果您打算成为订户\=,需要联系列表管理员\=。您可以发送邮件
index 4934cb4db5ec2dc0fb1e10a4f88f165810d3bd4c..ea8024733a637803eea1ea8c73cb841019b3d59f 100644 (file)
@@ -24,9 +24,9 @@ Content-Transfer-Encoding: 8bit
 需要版主审核后才能发布到该列表\=。
 
 %ifreason modnonsubposts%
-  %ifncontrol closedlist%%ifncontrol closedlistsub%
+  %ifncontrol closedlist%%ifncontrol closedlistsub%%ifncontrol moderators%
     %^%%text subrelease%
-  %endif%%endif%
+  %endif%%endif%%endif%
 %endif%
 
 (\=下为邮件\=。\=)
index fb7d7fbcbc7b7cd6826b807f72342847bdc75b25..7e6dae18486ea25c83c2f7c3c07f2715fac783b1 100644 (file)
@@ -218,7 +218,8 @@ static void newmoderated(struct ml *ml, const char *mailfilename,
                char *subreplyto = NULL;
                if (modreason == MODNONSUBPOSTS &&
                    !statctrl(ml->ctrlfd, "closedlist") &&
-                   !statctrl(ml->ctrlfd, "closedlistsub")) {
+                   !statctrl(ml->ctrlfd, "closedlistsub") &&
+                   !statctrl(ml->ctrlfd, "moderators")) {
                        char *listsubreleaseaddr;
                        char *digestsubreleaseaddr;
                        char *nomailsubreleaseaddr;
@@ -839,7 +840,10 @@ int main(int argc, char **argv)
                            bool closedlistsub = statctrl(ml.ctrlfd, "closedlistsub");
                            char *subreplyto = NULL;
 
-                           if (subonlypost && !closedlist && !closedlistsub) {
+                           bool hasmoderators = statctrl(ml.ctrlfd, "moderators");
+
+                           if (subonlypost && !closedlist && !closedlistsub &&
+                               !hasmoderators) {
                                char *modname;
                                char *listsubreleaseaddr;
                                char *digestsubreleaseaddr;
index 1996b973b37792ddacfece318cf2d2c3872ebfc2..518370a38ca8b9c58a7dd184fba8c0ba488fce12 100644 (file)
@@ -33,7 +33,8 @@ tests_init \
        verp \
        normal_email_with_dot \
        multi_line_headers \
-       subrelease
+       subrelease \
+       subrelease_with_moderators
 
 mlmmjreceive=$(command -v mlmmj-receive)
 
@@ -134,7 +135,7 @@ DATA
 Subject: =?utf-8?q?Post_to_test=40mlmmjtest_denied:_subscribe?=\r
 MIME-Version: 1.0\r
 Content-Type: multipart/mixed;\r
- boundary
+ boundary\r
 Content-Transfer-Encoding: 8bit\r
 From: test+owner@mlmmjtest\r
 To: bob@test\r
@@ -3128,9 +3129,9 @@ EOF
 
        atf_check -s exit:0 $mlmmjreceive -L list -F <first
        cat >> expected-1.txt <<EOF
-EHLO heloname\r
-MAIL FROM:<test+bounces-1@mlmmjtest> XVERP=-=\r
-QUIT\r
+EHLO heloname
+MAIL FROM:<test+bounces-1@mlmmjtest> XVERP=-=
+QUIT
 EOF
        atf_check -o file:expected-1.txt sed -e "/^Message-ID:/d; /^Date:/d;" mail-1.txt
 cat > second <<EOF
@@ -3405,3 +3406,36 @@ EOF
        atf_check -o match:"Let's go, first email" cat mail-2.txt
        atf_check -o match:"QUIT" cat mail-2.txt
 }
+
+subrelease_with_moderators_body()
+{
+       init_ml list
+       rmdir list/text
+       ln -s ${top_srcdir}/listtexts/en list/text
+       echo test@mlmmjtest > list/control/listaddress
+       start_fakesmtp list
+       echo "heloname" > list/control/smtphelo
+
+       touch list/control/subonlypost
+       echo "mod@test" > list/control/moderators
+       printf "user@test\nuser2@test" > list/subscribers.d/u
+
+cat > first <<EOF
+From: bob@test
+To: test@mlmmjtest
+Return-path: bob@test
+Subject: yeah
+
+Let's go, first email
+EOF
+       atf_check -s exit:0 $mlmmjreceive -L list -F <first
+
+       # Verify the deny-post mail does NOT contain subrelease addresses
+       atf_check -o not-match:"subrelease" cat mail-1.txt
+
+       # Verify the mail was NOT held in moderation (no subrelease path)
+       atf_check -s exit:0 test -z "$(ls list/moderation/ 2>/dev/null)"
+
+       # Verify the deny mail was sent to the poster
+       atf_check -o match:"RCPT TO:<bob@test>" cat mail-1.txt
+}