| 1 |
#!/bin/sh |
| 2 |
# |
| 3 |
# Test the behavior of post with multiple recipients and the use of Bcc: |
| 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 |
# Bcc test. |
| 17 |
# |
| 18 |
# It's worth pointing out here what's going on the SMTP protocol. |
| 19 |
# |
| 20 |
# If there are both sighted and unsighted addresses in the address list, |
| 21 |
# post calls verify_all_addresses() which results in ALL recipient |
| 22 |
# addresses being attempted, then the SMTP connection is reset, then |
| 23 |
# both the sighted and unsigned messages are sent (in different SMTP |
| 24 |
# transactions). Apparantly post has always done it this way. |
| 25 |
# |
| 26 |
|
| 27 |
cat > "${MH_TEST_DIR}/Mail/draft" <<EOF |
| 28 |
From: Mr Nobody <[email protected]> |
| 29 |
To: Somebody One <[email protected]>, |
| 30 |
Somebody Two <[email protected]> |
| 31 |
Subject: Test Bcc |
| 32 |
Bcc: Somebody Three <[email protected]>, |
| 33 |
Somebody Four <[email protected]> |
| 34 |
|
| 35 |
This is test of Bcc recipients. |
| 36 |
EOF |
| 37 |
|
| 38 |
cat > "${testname}.expected" <<EOF |
| 39 |
EHLO nosuchhost.example.com |
| 40 |
MAIL FROM:<[email protected]> |
| 41 |
RCPT TO:<[email protected]> |
| 42 |
RCPT TO:<[email protected]> |
| 43 |
RCPT TO:<[email protected]> |
| 44 |
RCPT TO:<[email protected]> |
| 45 |
RSET |
| 46 |
MAIL FROM:<[email protected]> |
| 47 |
RCPT TO:<[email protected]> |
| 48 |
RCPT TO:<[email protected]> |
| 49 |
DATA |
| 50 |
From: Mr Nobody <[email protected]> |
| 51 |
To: Somebody One <[email protected]>, |
| 52 |
Somebody Two <[email protected]> |
| 53 |
Subject: Test Bcc |
| 54 |
MIME-Version: 1.0 |
| 55 |
Content-Type: text/plain; charset="us-ascii" |
| 56 |
Date: |
| 57 |
|
| 58 |
This is test of Bcc recipients. |
| 59 |
. |
| 60 |
RSET |
| 61 |
MAIL FROM:<[email protected]> |
| 62 |
RCPT TO:<[email protected]> |
| 63 |
RCPT TO:<[email protected]> |
| 64 |
DATA |
| 65 |
From: Mr Nobody <[email protected]> |
| 66 |
Date: |
| 67 |
Subject: Test Bcc |
| 68 |
BCC: |
| 69 |
|
| 70 |
------- Blind-Carbon-Copy |
| 71 |
|
| 72 |
From: Mr Nobody <[email protected]> |
| 73 |
To: Somebody One <[email protected]>, |
| 74 |
Somebody Two <[email protected]> |
| 75 |
Subject: Test Bcc |
| 76 |
MIME-Version: 1.0 |
| 77 |
Content-Type: text/plain; charset="us-ascii" |
| 78 |
Date: |
| 79 |
|
| 80 |
This is test of Bcc recipients. |
| 81 |
|
| 82 |
------- End of Blind-Carbon-Copy |
| 83 |
. |
| 84 |
QUIT |
| 85 |
EOF |
| 86 |
|
| 87 |
test_post "${testname}.actual" "${testname}.expected" |
| 88 |
|
| 89 |
exit ${failed:-0} |