From: Erwan MAS Date: Mon, 23 Jun 2025 18:40:09 +0000 (-0400) Subject: add more unit tests to delheaders feature X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f9f3a128c6d49b81b65b0a9be2157398867d3c3;p=thirdparty%2Fmlmmj.git add more unit tests to delheaders feature --- diff --git a/tests/mlmmj-receive.in b/tests/mlmmj-receive.in index 01685217..d90727e3 100644 --- a/tests/mlmmj-receive.in +++ b/tests/mlmmj-receive.in @@ -25,6 +25,7 @@ tests_init \ maxmailsize0 \ normal_email \ delheaders \ + delheaders_extras \ customheaders \ customheaders_blanks \ customheaders_with_subst \ @@ -2743,6 +2744,80 @@ EOF atf_check -o file:expected-1.txt sed -e "/^Message-ID:/d; /^Date:/d;" mail-1.txt } +delheaders_extras_body() +{ + atf_check $top_builddir/tests/fakesmtpd + trap kill_fakesmtp EXIT TERM + init_ml list + rmdir list/text + ln -s ${top_srcdir}/listtexts/en list/text + echo test@mlmmjtest > list/control/listaddress + echo "25678" > list/control/smtpport + echo "heloname" > list/control/smtphelo + printf "X-k3\nx-h1\nx-L\n\n\n \n\t\nplop\nNope\n" > list/control/delheaders + + printf "user@test\nuser2@test" > list/subscribers.d/u +cat > first <; Sat, 10 May 2025 17:17:17 +0000 (UTC) +Received: from int.test.com ( mail.int.test.com [10.0.0.1]) + by 192.168.168.1 with ESMTP id 0A41D900249 + for ; Sat, 10 May 2025 17:16:17 +0000 (UTC) +Return-path: bob@test +Subject: yeah + +Let's go, first email +EOF + + atf_check -s exit:0 $mlmmjreceive -L list -F > expected-1.txt < +RCPT TO: +DATA +From: bob@test +To: test@mlmmjtest +X-H2: plop +Received: from test.com ( mail.test.com [192.168.168.1]) + by 192.168.168.168 with ESMTP id 0A21C400643 + for ; Sat, 10 May 2025 17:17:17 +0000 (UTC) +Received: from int.test.com ( mail.int.test.com [10.0.0.1]) + by 192.168.168.1 with ESMTP id 0A41D900249 + for ; Sat, 10 May 2025 17:16:17 +0000 (UTC) +Subject: yeah + +Let's go, first email + +. +MAIL FROM: +RCPT TO: +DATA +From: bob@test +To: test@mlmmjtest +X-H2: plop +Received: from test.com ( mail.test.com [192.168.168.1]) + by 192.168.168.168 with ESMTP id 0A21C400643 + for ; Sat, 10 May 2025 17:17:17 +0000 (UTC) +Received: from int.test.com ( mail.int.test.com [10.0.0.1]) + by 192.168.168.1 with ESMTP id 0A41D900249 + for ; Sat, 10 May 2025 17:16:17 +0000 (UTC) +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 $top_builddir/tests/fakesmtpd