| 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 <[email protected]> |
| 22 |
To: Somebody Else <[email protected]> |
| 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:<[email protected]> |
| 32 |
RCPT TO:<[email protected]> |
| 33 |
DATA |
| 34 |
From: Mr Nobody <[email protected]> |
| 35 |
To: Somebody Else <[email protected]> |
| 36 |
Subject: Fcc test |
| 37 |
MIME-Version: 1.0 |
| 38 |
Content-Type: text/plain; charset="us-ascii" |
| 39 |
Date: |
| 40 |
|
| 41 |
This is a fcc test |
| 42 |
. |
| 43 |
QUIT |
| 44 |
EOF |
| 45 |
|
| 46 |
test_post "${testname}.actual" "${testname}.expected" |
| 47 |
|
| 48 |
cat > "${testname}.msg.expected" <<EOF |
| 49 |
From: Mr Nobody <[email protected]> |
| 50 |
To: Somebody Else <[email protected]> |
| 51 |
Subject: Fcc test |
| 52 |
MIME-Version: 1.0 |
| 53 |
Content-Type: text/plain; charset="us-ascii" |
| 54 |
Date: |
| 55 |
|
| 56 |
This is a fcc test |
| 57 |
EOF |
| 58 |
|
| 59 |
msgname=`mhpath +inbox 11` |
| 60 |
|
| 61 |
sed -e 's/^Date:.*/Date:/' "${msgname}" > "${msgname}".nodate |
| 62 |
|
| 63 |
check "${testname}.msg.expected" "${msgname}".nodate |
| 64 |
|
| 65 |
exit ${failed:-0} |