From fafbf7096bd6d891baa2588d514de209d09f89e6 Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Wed, 12 Apr 2023 15:25:56 +0200 Subject: [PATCH] mailing+help: add testcase --- src/listcontrol.c | 2 +- tests/mlmmj-receive.sh | 71 +++++++++++++++++++++++++++++++++++++++++- 2 files changed, 71 insertions(+), 2 deletions(-) diff --git a/src/listcontrol.c b/src/listcontrol.c index 22453219..ce755b4f 100644 --- a/src/listcontrol.c +++ b/src/listcontrol.c @@ -268,7 +268,7 @@ int listcontrol(strlist *fromemails, struct ml *ml, log_error(LOG_ARGS, "A subscribe-both request was" " denied"); txt = open_text(ml->fd, "deny", "sub", "disabled", - "both", "sub-deny-digest"); + "both", "sub-deny-digest"); MY_ASSERT(txt); register_default_unformatted(txt, ml); register_unformatted(txt, "subaddr", diff --git a/tests/mlmmj-receive.sh b/tests/mlmmj-receive.sh index 38000388..16713a50 100755 --- a/tests/mlmmj-receive.sh +++ b/tests/mlmmj-receive.sh @@ -11,7 +11,8 @@ tests_init \ subscribe_nomail_confunsub \ subscribe_digest_confunsub \ subscribe_both \ - ctrl_list + ctrl_list \ + ctrl_help mlmmjreceive=$(command -v mlmmj-receive) @@ -1453,3 +1454,71 @@ EOF atf_check $mlmmjreceive -L list -F list/control/listaddress + echo "25678" > list/control/smtpport + echo "heloname" > list/control/smtphelo + + cat > ctrlhelp << EOF +From: bob@test +To: test+help@mlmmjtest +Return-Path: jane@test +EOF + +cat > expected-1.txt << EOF +EHLO heloname +MAIL FROM: +RCPT TO: +DATA +Subject: =?utf-8?q?Information_for_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 some information about the list. + +You can subscribe to the following versions: + +- The normal version: Every time a post is sent to the list, subscribers + receive a copy of it. Subscribe by emailing . + +- The digest version: Subscribers receive multiple posts in a single mail + message, at regular intervals, or when a lot of posts have accumulated. + Subscribe by emailing . + +- The no-mail version: Subscribers do not receive any posts to the list. + This means, though, they are able to post to a list which only + subscribers may post to, while they follow the list using a web archive + or another subscribed email address. Subscribe by emailing + . + +Unsubscribe by emailing . + +Posts are made by emailing . + +Subscribers can retrieve message number N from the list's archive by +sending a message to (change the N to the number of +the desired message). + +You can retrieve the frequently asked questions document for the list by +sending a message to . + +To contact the list owner, send a message to . + + +. +QUIT +EOF + atf_check $mlmmjreceive -L list -F