ff8399fd64eea3270690decb4337f657e0ab81a0
[mmh] / test / tests / spost / test-spost
1 # test spost: sender header
2
3 . "$MH_TEST_COMMON"
4
5 profile="$MMH/profile-spost"
6 cd "$MMH"
7 cat "`mhparam profile`" - >"$profile" <<!
8 default-from: Bob <bob@example.org>
9 alternate-mailboxes: ziggy@example.net, walther@example.net
10 !
11 cd -
12 export MMHP="$profile"
13
14 draft="$MH_TEST_DIR/spost-$$.draft"
15
16
17
18 # no from header
19
20 cat >"$draft" <<!
21 To: alice
22 Date: Sun, 25 Oct 2015 18:59:56 +0100
23 Subject: no from header
24 ----------------
25 foo
26 !
27
28 runandcheck 'spost -debug "$draft"' <<!
29 To: alice
30 Date: Sun, 25 Oct 2015 18:59:56 +0100
31 Subject: no from header
32 From: Bob <bob@example.org>
33
34 foo
35 ----EOM----
36 alice
37 !
38
39
40
41 # single from addr (my default one)
42
43 cat >"$draft" <<!
44 From: bob@example.org
45 To: alice
46 Date: Sun, 25 Oct 2015 18:59:56 +0100
47 Subject: single from addr (my default one)
48 ----------------
49 foo
50 !
51
52 runandcheck 'spost -debug "$draft"' <<!
53 From: bob@example.org
54 To: alice
55 Date: Sun, 25 Oct 2015 18:59:56 +0100
56 Subject: single from addr (my default one)
57
58 foo
59 ----EOM----
60 alice
61 !
62
63
64
65 # single from addr (my alternate one)
66
67 cat >"$draft" <<!
68 From: walther@example.net
69 To: alice
70 Date: Sun, 25 Oct 2015 18:59:56 +0100
71 Subject: single from addr (my alternate one)
72 ----------------
73 foo
74 !
75
76 runandcheck 'spost -debug "$draft"' <<!
77 From: walther@example.net
78 To: alice
79 Date: Sun, 25 Oct 2015 18:59:56 +0100
80 Subject: single from addr (my alternate one)
81
82 foo
83 ----EOM----
84 alice
85 !
86
87
88
89 # single from addr (a foreign one)
90
91 cat >"$draft" <<!
92 From: charly
93 To: alice
94 Date: Sun, 25 Oct 2015 18:59:56 +0100
95 Subject: single from addr (a foreign one)
96 ----------------
97 foo
98 !
99
100 runandcheck 'spost -debug "$draft"' <<!
101 From: charly
102 To: alice
103 Date: Sun, 25 Oct 2015 18:59:56 +0100
104 Subject: single from addr (a foreign one)
105 Sender: Bob <bob@example.org>
106
107 foo
108 ----EOM----
109 alice
110 !
111
112
113
114 # multiple from addrs (including my default addr)
115
116 cat >"$draft" <<!
117 From: bob@example.org, charly, jack
118 To: alice
119 Date: Sun, 25 Oct 2015 18:59:56 +0100
120 Subject: multiple from addrs (including my default addr)
121 ----------------
122 foo
123 !
124
125 runandcheck 'spost -debug "$draft"' <<!
126 From: bob@example.org, charly, jack
127 To: alice
128 Date: Sun, 25 Oct 2015 18:59:56 +0100
129 Subject: multiple from addrs (including my default addr)
130 Sender: Bob <bob@example.org>
131
132 foo
133 ----EOM----
134 alice
135 !
136
137
138
139 # multiple from addrs (including my alternate addr)
140
141 cat >"$draft" <<!
142 From: charly, jack, walther@example.net
143 To: alice
144 Date: Sun, 25 Oct 2015 18:59:56 +0100
145 Subject: multiple from addrs (including my alternate addr)
146 ----------------
147 foo
148 !
149
150 runandcheck 'spost -debug "$draft"' <<!
151 From: charly, jack, walther@example.net
152 To: alice
153 Date: Sun, 25 Oct 2015 18:59:56 +0100
154 Subject: multiple from addrs (including my alternate addr)
155 Sender: walther@example.net
156
157 foo
158 ----EOM----
159 alice
160 !
161
162
163
164 # multiple from addrs (all foreign)
165
166 cat >"$draft" <<!
167 From: charly, jack, gill
168 To: alice
169 Date: Sun, 25 Oct 2015 18:59:56 +0100
170 Subject: multiple from addrs (all foreign)
171 ----------------
172 foo
173 !
174
175 runandcheck 'spost -debug "$draft"' <<!
176 From: charly, jack, gill
177 To: alice
178 Date: Sun, 25 Oct 2015 18:59:56 +0100
179 Subject: multiple from addrs (all foreign)
180 Sender: Bob <bob@example.org>
181
182 foo
183 ----EOM----
184 alice
185 !
186
187