]> git.ipfire.org Git - thirdparty/mlmmj.git/commitdiff
mlmmj-maintd: extend the test to cover addtohdr
authorBaptiste Daroussin <bapt@FreeBSD.org>
Wed, 8 Mar 2023 11:03:34 +0000 (12:03 +0100)
committerBaptiste Daroussin <bapt@FreeBSD.org>
Wed, 8 Mar 2023 11:03:34 +0000 (12:03 +0100)
tests/mlmmj-maintd.sh

index 54fd4598351e3c718788cb8091557006f81de482..cc89cf68e9b78dcdf81a89392ade685a3ec143b7 100755 (executable)
@@ -839,6 +839,62 @@ QUIT
 EOF
        atf_check $mlmmjmaintd -L list -F
        atf_check -o file:expect2.txt sed -e "/^Message-ID:/d; /^Date:/d; s/bounces-.*-/bounces-/g" mail-2.txt
-       atf_check -s exit:1 test -f mail-4.txt
+       atf_check -s exit:1 test -f mail-3.txt
        atf_check -s exit:0 test -f list/archive/1
+       atf_check -s exit:1 test -f lists/requeue/1/subscribers
+       atf_check -s exit:1 test -f list/requeue/3/mailfile
+       mkdir lists/requeue/1
+cat > list/archive/1 <<EOF
+From: plop
+To: bla
+Subject: test
+
+body
+EOF
+       cat >> list/requeue/1/subscribers <<EOF
+user1@test1
+user2@test2
+user3@test3
+EOF
+       cat > expect3.txt <<EOF
+EHLO heloname\r
+MAIL FROM:<test+bounces-user1=test1@test>\r
+RCPT TO:<user1@test1>\r
+DATA\r
+From: plop\r
+To: bla\r
+Subject: test\r
+To: user1@test1\r
+\r
+body\r
+\r
+.\r
+MAIL FROM:<test+bounces-user2=test2@test>\r
+RCPT TO:<user2@test2>\r
+DATA\r
+From: plop\r
+To: bla\r
+Subject: test\r
+To: user2@test2\r
+\r
+body\r
+\r
+.\r
+MAIL FROM:<test+bounces-user3=test3@test>\r
+RCPT TO:<user3@test3>\r
+DATA\r
+From: plop\r
+To: bla\r
+Subject: test\r
+To: user3@test3\r
+\r
+body\r
+\r
+.\r
+QUIT\r
+EOF
+       touch list/control/addtohdr
+       atf_check $mlmmjmaintd -L list -F
+       atf_check -o file:expect3.txt sed -e "/^Message-ID:/d; /^Date:/d; s/bounces-.*-/bounces-/g" mail-3.txt
+       atf_check -s exit:1 test -f mail-4.txt
 }