From: Baptiste Daroussin Date: Sat, 15 Apr 2023 19:46:34 +0000 (+0200) Subject: mlmmj-process: add tests for customheaders X-Git-Tag: RELEASE_1_4_0b1~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9d9c4dc0b5cdc018ed175f97a0e689b8a2dcd49e;p=thirdparty%2Fmlmmj.git mlmmj-process: add tests for customheaders --- diff --git a/tests/mlmmj-receive.sh b/tests/mlmmj-receive.sh index 646e7cc9..ef6b3163 100755 --- a/tests/mlmmj-receive.sh +++ b/tests/mlmmj-receive.sh @@ -22,7 +22,8 @@ tests_init \ maxmailsize \ maxmailsize0 \ normail_email \ - delheaders + delheaders \ + customheaders mlmmjreceive=$(command -v mlmmj-receive) @@ -2485,13 +2486,56 @@ Subject: yeah Let's go, first email EOF -cat > nosubject <> expected-1.txt < +RCPT TO: +DATA +From: bob@test +To: test@mlmmjtest +Subject: yeah + +Let's go, first email + +. +MAIL FROM: +RCPT TO: +DATA +From: bob@test +To: test@mlmmjtest +Subject: yeah + +Let's go, first email + +. +QUIT +EOF + atf_check -o file:expected-1.txt sed -e "/^Message-ID:/d; /^Date:/d;" mail-1.txt +} + +customheaders_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 + printf "X-H1: test\nNope: really not\n" > list/control/customheaders + + printf "user@test\nuser2@test" > list/subscribers.d/u +cat > first <> expected-1.txt < second <> expected-2.txt < +RCPT TO: +DATA +From: bob@test +To: test@mlmmjtest +X-H1: test +Nope: really not +Mime: really +Subject: yeah + +Let's go, first email + +. +MAIL FROM: +RCPT TO: +DATA +From: bob@test +To: test@mlmmjtest +X-H1: test +Nope: really not +Mime: really +Subject: yeah + +Let's go, first email + +. +QUIT +EOF + atf_check -o file:expected-2.txt sed -e "/^Message-ID:/d; /^Date:/d;" mail-2.txt }