Fixed the export of LC_ALL so that it work with old Bourne shell.
[mmh] / test / post / test-post-fcc
1 #!/bin/sh
2 #
3 # Test the Fcc: feature of post
4 #
5
6 set -e
7
8 if test -z "${MH_OBJ_DIR}"; then
9     srcdir=`dirname "$0"`/../..
10     MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR
11 fi
12
13 . "${srcdir}/test/post/test-post-common.sh"
14
15 #
16 # Basic test - Simple message, single user, single recipient.  Note that
17 # we test dot-stuffing here as well.
18 #
19
20 cat > "${MH_TEST_DIR}/Mail/draft" <<EOF
21 From: Mr Nobody <nobody@example.com>
22 To: Somebody Else <somebody@example.com>
23 Subject: Fcc test
24 Fcc: +inbox
25
26 This is a fcc test
27 EOF
28
29 cat > "${testname}.expected" <<EOF
30 EHLO nosuchhost.example.com
31 MAIL FROM:<nobody@example.com>
32 RCPT TO:<somebody@example.com>
33 DATA
34 From: Mr Nobody <nobody@example.com>
35 To: Somebody Else <somebody@example.com>
36 Subject: Fcc test
37 Date:
38
39 This is a fcc test
40 .
41 QUIT
42 EOF
43
44 test_post "${testname}.actual" "${testname}.expected"
45
46 cat > "${testname}.msg.expected" <<EOF
47 From: Mr Nobody <nobody@example.com>
48 To: Somebody Else <somebody@example.com>
49 Subject: Fcc test
50 Date:
51
52 This is a fcc test
53 EOF
54
55 msgname=`mhpath +inbox 11`
56
57 sed -e 's/^Date:.*/Date:/' "${msgname}" > "${msgname}".nodate
58
59 check "${testname}.msg.expected" "${msgname}".nodate
60
61 exit ${failed:-0}