From: Baptiste Daroussin Date: Wed, 12 Apr 2023 12:11:23 +0000 (+0200) Subject: listcontrol: add test for mailinglist+list@ X-Git-Tag: RELEASE_1_4_0b1~52 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2e39b5218bb74003cc025ac7afd39feaf133d939;p=thirdparty%2Fmlmmj.git listcontrol: add test for mailinglist+list@ --- diff --git a/src/listcontrol.c b/src/listcontrol.c index 3fcdc030..fa01058a 100644 --- a/src/listcontrol.c +++ b/src/listcontrol.c @@ -662,7 +662,7 @@ permit: } } } - if (owner != NULL) { + if (owner == NULL) { errno = 0; log_error(LOG_ARGS, "A list request was sent to the" " list from a non-owner address." diff --git a/tests/mlmmj-receive.sh b/tests/mlmmj-receive.sh index b17b7ed1..38000388 100755 --- a/tests/mlmmj-receive.sh +++ b/tests/mlmmj-receive.sh @@ -10,7 +10,8 @@ tests_init \ subscribe_nomail \ subscribe_nomail_confunsub \ subscribe_digest_confunsub \ - subscribe_both + subscribe_both \ + ctrl_list mlmmjreceive=$(command -v mlmmj-receive) @@ -1371,3 +1372,84 @@ QUIT EOF atf_check -o file:expected-5.txt sed -e "/^Message-ID:/d; /^Date:/d" mail-5.txt } + +ctrl_list_body() { + atf_check $srcdir/fakesmtpd + trap kill_fakesmtp EXIT TERM + init_ml list + rmdir list/text + ln -s ${srcdir}/../listtexts/en list/text + echo test@mlmmjtest > list/control/listaddress + echo "25678" > list/control/smtpport + echo "heloname" > list/control/smtphelo + + cat > ctrllist << EOF +From: bob@test +To: test+list@mlmmjtest +Return-Path: jane@test +EOF + + atf_check $mlmmjreceive -L list -F list/control/owner + atf_check $mlmmjreceive -L list -F expected-1.txt << EOF +EHLO heloname +MAIL FROM: +RCPT TO: +DATA +Subject: =?utf-8?q?Subscribers_to_test=40mlmmjtest?= +From: test+owner@mlmmjtest +To: bob@test +MIME-Version: 1.0 +Content-Type: text/plain; charset=utf-8 +Content-Transfer-Encoding: 8bit + +Hi, this is the Mlmmj program managing the mailing list. + +Here is the list of subscribers (to all versions of the list): + + + +. +QUIT +EOF + atf_check -o file:expected-1.txt sed -e "/^Message-ID:/d; /^Date:/d" mail-1.txt + + printf "bob@test" > list/control/owner + printf "jane@doe.org\njo@bob.org\n" > list/subscribers.d/j + printf "jane@doe.org\n" > list/digesters.d/j + printf "bob@doe.org" > list/nomailsubs.d/b +cat > expected-2.txt << EOF +EHLO heloname +MAIL FROM: +RCPT TO: +DATA +Subject: =?utf-8?q?Subscribers_to_test=40mlmmjtest?= +From: test+owner@mlmmjtest +To: bob@test +MIME-Version: 1.0 +Content-Type: text/plain; charset=utf-8 +Content-Transfer-Encoding: 8bit + +Hi, this is the Mlmmj program managing the mailing list. + +Here is the list of subscribers (to all versions of the list): + +- jane@doe.org +- jo@bob.org +- jane@doe.org +- bob@doe.org + + +. +QUIT +EOF + atf_check $mlmmjreceive -L list -F