]>
diplodocus.org Git - nmh/blob - test/send/test-sendfrom
2 ######################################################
6 ######################################################
10 if test -z "${MH_OBJ_DIR}"; then
11 srcdir
=`dirname "$0"`/..
/..
12 MH_OBJ_DIR
=`cd "$srcdir" && pwd`; export MH_OBJ_DIR
15 .
"${srcdir}/test/post/test-post-common.sh"
19 start_test
'sendfrom, using -snoop'
21 #### Set up profile to use sendfrom by adding a sendfrom-addr. This one adds
22 #### -snoop to the send switches. The output from snoop is constant, and so
23 #### is easily checked below.
25 sendfrom-nobody@example.com: -snoop
28 cat > "${MH_TEST_DIR}/Mail/draft" <<EOF
29 From: Mr Nobody <nobody@example.com>
30 To: Somebody Else <somebody@example.com>
36 cat > "${testname}.expected" <<EOF
37 EHLO nosuchhost.example.com
38 MAIL FROM:<nobody@example.com>
39 RCPT TO:<somebody@example.com>
41 From: Mr Nobody <nobody@example.com>
42 To: Somebody Else <somebody@example.com>
45 Content-Type: text/plain; charset="us-ascii"
53 cat > "${testname}.post-expected" <<EOF
54 Trying to connect to "127.0.0.1" ...
55 Connecting to 127.0.0.1:${localport}...
56 <= 220 Not really an ESMTP server
57 => EHLO nosuchhost.example.com
59 <= 250 I'll buy that for a dollar!
60 => MAIL FROM:<nobody@example.com>
61 <= 250 I'll buy that for a dollar!
62 => RCPT TO:<somebody@example.com>
63 <= 250 I'll buy that for a dollar!
67 <= 250 Thanks for the info!
69 <= 221 Later alligator!
72 test_post
"${testname}.actual" "${testname}.expected" \
75 check
"${testname}.post-expected" "${testname}.post"