DCC contains invisible (not visible) recipients
authormarkus schnalke <meillo@marmaro.de>
Sun, 25 Oct 2015 19:00:50 +0000 (20:00 +0100)
committermarkus schnalke <meillo@marmaro.de>
Sun, 25 Oct 2015 19:00:50 +0000 (20:00 +0100)
Added new test for BCC and DCC headers, which discovered the bug.

test/tests/spost/test-bcc-dcc [new file with mode: 0644]
test/tests/spost/test-sender-header [moved from test/tests/spost/test-spost with 100% similarity]
uip/spost.c

diff --git a/test/tests/spost/test-bcc-dcc b/test/tests/spost/test-bcc-dcc
new file mode 100644 (file)
index 0000000..cafddaf
--- /dev/null
@@ -0,0 +1,145 @@
+# test spost: bcc and dcc headers
+
+. "$MH_TEST_COMMON"
+
+
+draft="$MH_TEST_DIR/spost-$$.draft"
+
+profile="$MMH/profile-spost"
+cd "$MMH"
+cat "`mhparam profile`" - >"$profile" <<!
+default-from: Bob <bob@example.org>
+!
+cd -
+export MMHP="$profile"
+
+
+# to + cc headers
+
+cat >"$draft" <<!
+To: alice, gill
+Cc: jack, charly
+Date: Sun, 25 Oct 2015 18:59:56 +0100
+Subject: to and cc
+----------------
+foo
+!
+
+runandcheck 'spost -debug "$draft"' <<!
+To: alice, gill
+Cc: jack, charly
+Date: Sun, 25 Oct 2015 18:59:56 +0100
+Subject: to and cc
+From: Bob <bob@example.org>
+
+foo
+----EOM----
+jack
+charly
+alice
+gill
+!
+
+
+
+# to + bcc headers
+
+cat >"$draft" <<!
+To: alice
+Bcc: john, paul, george, ringo
+Date: Sun, 25 Oct 2015 18:59:56 +0100
+Subject: to and bcc
+----------------
+foo
+!
+
+runandcheck 'spost -debug "$draft"' <<!
+To: alice
+Date: Sun, 25 Oct 2015 18:59:56 +0100
+Subject: to and bcc
+From: Bob <bob@example.org>
+
+foo
+----EOM----
+alice
+!
+
+
+
+
+
+# only bcc headers
+
+cat >"$draft" <<!
+Bcc: john, paul, george, ringo
+Date: Sun, 25 Oct 2015 18:59:56 +0100
+Subject: only bcc
+----------------
+foo
+!
+
+runandcheck 'spost -debug "$draft"' <<!
+Date: Sun, 25 Oct 2015 18:59:56 +0100
+Subject: only bcc
+From: Bob <bob@example.org>
+Bcc: undisclosed-recipients:;
+
+foo
+----EOM----
+!
+
+
+
+
+# to + dcc headers
+
+cat >"$draft" <<!
+To: alice
+Dcc: john, paul, george, ringo
+Date: Sun, 25 Oct 2015 18:59:56 +0100
+Subject: to and dcc
+----------------
+foo
+!
+
+runandcheck 'spost -debug "$draft"' <<!
+To: alice
+Date: Sun, 25 Oct 2015 18:59:56 +0100
+Subject: to and dcc
+From: Bob <bob@example.org>
+
+foo
+----EOM----
+john
+paul
+george
+ringo
+alice
+!
+
+
+
+# only dcc headers
+
+cat >"$draft" <<!
+Dcc: john, paul, george, ringo
+Date: Sun, 25 Oct 2015 18:59:56 +0100
+Subject: only dcc
+----------------
+foo
+!
+
+runandcheck 'spost -debug "$draft"' <<!
+Date: Sun, 25 Oct 2015 18:59:56 +0100
+Subject: only dcc
+From: Bob <bob@example.org>
+Bcc: undisclosed-recipients:;
+
+foo
+----EOM----
+john
+paul
+george
+ringo
+!
+
index 96ca14d..f755a16 100644 (file)
@@ -76,7 +76,7 @@ static struct headers NHeaders[] = {
        { "Subject", HSUB, 0 },
        { "To", HADR|HTRY, MVIS },
        { "Cc", HADR|HTRY, MVIS },
-       { "Dcc", HADR|HTRY|HDCC, MVIS },
+       { "Dcc", HADR|HTRY|HDCC, MINV },
        { "Bcc", HADR|HTRY|HBCC, MINV },
        { "Message-Id", HBAD, 0 },
        { "Fcc", HFCC, 0 },
@@ -92,7 +92,7 @@ static struct headers RHeaders[] = {
        { "Resent-Subject", HSUB, 0 },
        { "Resent-To", HADR|HTRY, MVIS },
        { "Resent-Cc", HADR|HTRY, MVIS },
-       { "Resent-Dcc", HADR|HTRY|HDCC, MVIS },
+       { "Resent-Dcc", HADR|HTRY|HDCC, MINV },
        { "Resent-Bcc", HADR|HTRY|HBCC, MINV },
        { "Resent-Message-Id", HBAD, 0 },
        { "Resent-Fcc", HFCC, 0 },