1# test spost: Group Addresses
2
3. "$MH_TEST_COMMON"
4
5
6draft="$MH_TEST_DIR/spost-$$.draft"
7
8profile="$MMH/profile-spost"
9cd "$MMH"
10cat "`mhparam profile`" - >"$profile" <<!
11default-from: Bob <bob@example.org>
12!
13cd - >/dev/null
14export MMHP="$profile"
15
16
17
18# Group Recipients
19
20cat >"$draft" <<!
21To: Undisclosed recipients: Alice <alice@example.org>,
22	Gill <gill@example.org>;
23Date: Sun, 25 Oct 2015 18:59:56 +0100
24Subject: Group Recipients
25----------------
26foo
27!
28
29runandcheck 'spost -debug "$draft"' <<!
30To: Undisclosed recipients: ;
31Date: Sun, 25 Oct 2015 18:59:56 +0100
32Subject: Group Recipients
33From: Bob <bob@example.org>
34
35foo
36----EOM----
37alice@example.org
38gill@example.org
39!
40
41
42
43cat >"$draft" <<!
44To: charly@example.net
45Cc: friends: alice@example.org, Gill <gill@example.org>;
46Date: Sun, 25 Oct 2015 18:59:56 +0100
47Subject: Group in CC
48----------------
49foo
50!
51
52runandcheck 'spost -debug "$draft"' <<!
53To: charly@example.net
54Cc: friends: ;
55Date: Sun, 25 Oct 2015 18:59:56 +0100
56Subject: Group in CC
57From: Bob <bob@example.org>
58
59foo
60----EOM----
61alice@example.org
62gill@example.org
63charly@example.net
64!
65
66
67
68cat >"$draft" <<!
69To: charly@example.net
70Cc: friends: alice@example.org, Gill <gill@example.org>
71Date: Sun, 25 Oct 2015 18:59:56 +0100
72Subject: No semicolon at the end of the group
73----------------
74foo
75!
76
77runandcheck 'spost -debug "$draft"' <<!
78To: charly@example.net
79Cc: friends: ;
80Date: Sun, 25 Oct 2015 18:59:56 +0100
81Subject: No semicolon at the end of the group
82From: Bob <bob@example.org>
83
84foo
85----EOM----
86alice@example.org
87gill@example.org
88charly@example.net
89!
90
91
92
93cat >"$draft" <<!
94To: friends: Alice <alice@example.org>, Gill <gill@example.org>;,
95	charly@example.net
96Date: Sun, 25 Oct 2015 18:59:56 +0100
97Subject: Group plus address with comma
98----------------
99foo
100!
101
102runandcheck 'spost -debug "$draft"' <<!
103To: friends: ;, charly@example.net
104Date: Sun, 25 Oct 2015 18:59:56 +0100
105Subject: Group plus address with comma
106From: Bob <bob@example.org>
107
108foo
109----EOM----
110alice@example.org
111gill@example.org
112charly@example.net
113!
114
115
116
117cat >"$draft" <<!
118To: friends: Alice <alice@example.org>, Gill <gill@example.org>;
119	charly@example.net
120Date: Sun, 25 Oct 2015 18:59:56 +0100
121Subject: Group plus address, no comma
122----------------
123foo
124!
125
126runandcheck 'spost -debug "$draft"' <<!
127To: friends: ;, charly@example.net
128Date: Sun, 25 Oct 2015 18:59:56 +0100
129Subject: Group plus address, no comma
130From: Bob <bob@example.org>
131
132foo
133----EOM----
134alice@example.org
135gill@example.org
136charly@example.net
137!
138
139
140
141cat >"$draft" <<!
142To: abc:alice
143Date: Sun, 25 Oct 2015 18:59:56 +0100
144Subject: One word with a colon inside
145----------------
146foo
147!
148
149runandcheck 'spost -debug "$draft"' <<!
150To: abc: ;
151Date: Sun, 25 Oct 2015 18:59:56 +0100
152Subject: One word with a colon inside
153From: Bob <bob@example.org>
154
155foo
156----EOM----
157alice
158!
159
160
161
162cat >"$draft" <<!
163To: charly
164Dcc: friends: Alice <alice@example.org>, Gill <gill@example.org>;
165Date: Sun, 25 Oct 2015 18:59:56 +0100
166Subject: Group in Dcc
167----------------
168foo
169!
170
171runandcheck 'spost -debug "$draft"' <<!
172To: charly
173Date: Sun, 25 Oct 2015 18:59:56 +0100
174Subject: Group in Dcc
175From: Bob <bob@example.org>
176
177foo
178----EOM----
179alice@example.org
180gill@example.org
181charly
182!
183