Teach spost to handle address groups
[mmh] / test / tests / spost / test-group
index 13c3bf1..c65e58c 100644 (file)
@@ -14,10 +14,12 @@ cd - >/dev/null
 export MMHP="$profile"
 
 
+
 # Group Recipients
 
 cat >"$draft" <<!
-To: Undisclosed recipients: Alice <alice@example.org>, Gill <gill@example.org>;
+To: Undisclosed recipients: Alice <alice@example.org>,
+       Gill <gill@example.org>;
 Date: Sun, 25 Oct 2015 18:59:56 +0100
 Subject: Group Recipients
 ----------------
@@ -35,3 +37,146 @@ foo
 alice@example.org
 gill@example.org
 !
+
+
+
+cat >"$draft" <<!
+To: charly@example.net
+Cc: friends: alice@example.org, Gill <gill@example.org>;
+Date: Sun, 25 Oct 2015 18:59:56 +0100
+Subject: Group in CC
+----------------
+foo
+!
+
+runandcheck 'spost -debug "$draft"' <<!
+To: charly@example.net
+Cc: friends: ;
+Date: Sun, 25 Oct 2015 18:59:56 +0100
+Subject: Group in CC
+From: Bob <bob@example.org>
+
+foo
+----EOM----
+alice@example.org
+gill@example.org
+charly@example.net
+!
+
+
+
+cat >"$draft" <<!
+To: charly@example.net
+Cc: friends: alice@example.org, Gill <gill@example.org>
+Date: Sun, 25 Oct 2015 18:59:56 +0100
+Subject: No semicolon at the end of the group
+----------------
+foo
+!
+
+runandcheck 'spost -debug "$draft"' <<!
+To: charly@example.net
+Cc: friends: ;
+Date: Sun, 25 Oct 2015 18:59:56 +0100
+Subject: No semicolon at the end of the group
+From: Bob <bob@example.org>
+
+foo
+----EOM----
+alice@example.org
+gill@example.org
+charly@example.net
+!
+
+
+
+cat >"$draft" <<!
+To: friends: Alice <alice@example.org>, Gill <gill@example.org>;,
+       charly@example.net
+Date: Sun, 25 Oct 2015 18:59:56 +0100
+Subject: Group plus address with comma
+----------------
+foo
+!
+
+runandcheck 'spost -debug "$draft"' <<!
+To: friends: ;, charly@example.net
+Date: Sun, 25 Oct 2015 18:59:56 +0100
+Subject: Group plus address with comma
+From: Bob <bob@example.org>
+
+foo
+----EOM----
+alice@example.org
+gill@example.org
+charly@example.net
+!
+
+
+
+cat >"$draft" <<!
+To: friends: Alice <alice@example.org>, Gill <gill@example.org>;
+       charly@example.net
+Date: Sun, 25 Oct 2015 18:59:56 +0100
+Subject: Group plus address, no comma
+----------------
+foo
+!
+
+runandcheck 'spost -debug "$draft"' <<!
+To: friends: ;, charly@example.net
+Date: Sun, 25 Oct 2015 18:59:56 +0100
+Subject: Group plus address, no comma
+From: Bob <bob@example.org>
+
+foo
+----EOM----
+alice@example.org
+gill@example.org
+charly@example.net
+!
+
+
+
+cat >"$draft" <<!
+To: abc:alice
+Date: Sun, 25 Oct 2015 18:59:56 +0100
+Subject: One word with a colon inside
+----------------
+foo
+!
+
+runandcheck 'spost -debug "$draft"' <<!
+To: abc: ;
+Date: Sun, 25 Oct 2015 18:59:56 +0100
+Subject: One word with a colon inside
+From: Bob <bob@example.org>
+
+foo
+----EOM----
+alice
+!
+
+
+
+cat >"$draft" <<!
+To: charly
+Dcc: friends: Alice <alice@example.org>, Gill <gill@example.org>;
+Date: Sun, 25 Oct 2015 18:59:56 +0100
+Subject: Group in Dcc
+----------------
+foo
+!
+
+runandcheck 'spost -debug "$draft"' <<!
+To: charly
+Date: Sun, 25 Oct 2015 18:59:56 +0100
+Subject: Group in Dcc
+From: Bob <bob@example.org>
+
+foo
+----EOM----
+alice@example.org
+gill@example.org
+charly
+!