]>
diplodocus.org Git - nmh/blob - test/post/test-post-envelope
3 # Test the setting of the envelope-from address for SMTP
5 # Note here we use multiple From: addresses for some tests so we pick up
6 # some cases skipped in other tests.
11 if test -z "${MH_OBJ_DIR}"; then
12 srcdir
=`dirname "$0"`/..
/..
13 MH_OBJ_DIR
=`cd "$srcdir" && pwd`; export MH_OBJ_DIR
16 .
"${srcdir}/test/post/test-post-common.sh"
22 cat > "${MH_TEST_DIR}/Mail/draft" <<EOF
23 From: Mr Nobody One <nobody1@example.com>,
24 Mr Nobody Two <nobody2@example.com>
25 Sender: Mr Nobody Three <nobody3@example.com>
26 To: Somebody Else <somebody@example.com>
29 This is a test of the Sender header.
32 cat > "${testname}.0.expected" <<EOF
33 EHLO nosuchhost.example.com
34 MAIL FROM:<nobody3@example.com>
35 RCPT TO:<somebody@example.com>
37 From: Mr Nobody One <nobody1@example.com>,
38 Mr Nobody Two <nobody2@example.com>
39 Sender: Mr Nobody Three <nobody3@example.com>
40 To: Somebody Else <somebody@example.com>
43 Content-Type: text/plain; charset="us-ascii"
46 This is a test of the Sender header.
51 test_post
"${testname}.0.actual" "${testname}.0.expected"
54 # Check to see if Envelope-From overrides Sender
57 cat > "${MH_TEST_DIR}/Mail/draft" <<EOF
58 From: Mr Nobody One <nobody1@example.com>,
59 Mr Nobody Two <nobody2@example.com>
60 Sender: Mr Nobody Three <nobody3@example.com>
61 Envelope-From: Mr Nobody Four <nobody4@example.com>
62 To: Somebody Else <somebody@example.com>
63 Subject: Envelope-From test
65 This is a test of the Envelope-From header.
68 cat > "${testname}.1.expected" <<EOF
69 EHLO nosuchhost.example.com
70 MAIL FROM:<nobody4@example.com>
71 RCPT TO:<somebody@example.com>
73 From: Mr Nobody One <nobody1@example.com>,
74 Mr Nobody Two <nobody2@example.com>
75 Sender: Mr Nobody Three <nobody3@example.com>
76 To: Somebody Else <somebody@example.com>
77 Subject: Envelope-From test
79 Content-Type: text/plain; charset="us-ascii"
82 This is a test of the Envelope-From header.
87 test_post
"${testname}.1.actual" "${testname}.1.expected"
90 # See if Envelope-From will generate a Sender: header with multiple From:
94 cat > "${MH_TEST_DIR}/Mail/draft" <<EOF
95 From: Mr Nobody One <nobody1@example.com>,
96 Mr Nobody Two <nobody2@example.com>
97 Envelope-From: Mr Nobody Four <nobody4@example.com>
98 To: Somebody Else <somebody@example.com>
99 Subject: Envelope-From and Sender test
101 This is a test of the Envelope-From and Sender headers.
104 cat > "${testname}.2.expected" <<EOF
105 EHLO nosuchhost.example.com
106 MAIL FROM:<nobody4@example.com>
107 RCPT TO:<somebody@example.com>
109 From: Mr Nobody One <nobody1@example.com>,
110 Mr Nobody Two <nobody2@example.com>
111 To: Somebody Else <somebody@example.com>
112 Subject: Envelope-From and Sender test
114 Content-Type: text/plain; charset="us-ascii"
116 Sender: nobody4@example.com
118 This is a test of the Envelope-From and Sender headers.
123 test_post
"${testname}.2.actual" "${testname}.2.expected"
126 # And make sure we do NOT get a Sender with only one From:
129 cat > "${MH_TEST_DIR}/Mail/draft" <<EOF
130 From: Mr Nobody One <nobody1@example.com>
131 Envelope-From: Mr Nobody Five <nobody5@example.com>
132 To: Somebody Else <somebody@example.com>
133 Subject: Solo Envelope-From test
135 This is a solo test of the Envelope-From header.
138 cat > "${testname}.3.expected" <<EOF
139 EHLO nosuchhost.example.com
140 MAIL FROM:<nobody5@example.com>
141 RCPT TO:<somebody@example.com>
143 From: Mr Nobody One <nobody1@example.com>
144 To: Somebody Else <somebody@example.com>
145 Subject: Solo Envelope-From test
147 Content-Type: text/plain; charset="us-ascii"
150 This is a solo test of the Envelope-From header.
155 test_post
"${testname}.3.actual" "${testname}.3.expected"
158 # Make sure blank Envelope-From does what we expect it to
161 cat > "${MH_TEST_DIR}/Mail/draft" <<EOF
162 From: Mr Nobody One <nobody1@example.com>
164 To: Somebody Else <somebody@example.com>
165 Subject: Blank Envelope-From test
167 This is a blank test of the Envelope-From header.
170 cat > "${testname}.4.expected" <<EOF
171 EHLO nosuchhost.example.com
173 RCPT TO:<somebody@example.com>
175 From: Mr Nobody One <nobody1@example.com>
176 To: Somebody Else <somebody@example.com>
177 Subject: Blank Envelope-From test
179 Content-Type: text/plain; charset="us-ascii"
182 This is a blank test of the Envelope-From header.
187 test_post
"${testname}.4.actual" "${testname}.4.expected"