]>
diplodocus.org Git - nmh/blob - test/oauth/test-sendfrom
3 # Test the XOAUTH2 support with sendfrom
6 if test -z "${MH_OBJ_DIR}"; then
7 srcdir
=`dirname "$0"`/..
/..
8 MH_OBJ_DIR
=`cd "${srcdir}" && pwd`; export MH_OBJ_DIR
11 .
"${srcdir}/test/oauth/common.sh"
13 # fakesmtp uses the XOAUTH environment variable
15 XOAUTH
='dXNlcj11c2VyQGV4YW1wbGUuY29tAWF1dGg9QmVhcmVyIHRlc3QtYWNjZXNzAQE='
18 start_test
'with sendfrom'
23 access-user@example.com: test-access
24 refresh-user@example.com: test-refresh
25 expire-user@example.com: 2000000000
28 #### Set up profile to use sendfrom by adding a sendfrom-addr. This one adds
29 #### the oauth switches, which are necessary for this test.
30 sendfrom
="$MH_INST_DIR${datarootdir}/doc/nmh/contrib/sendfrom"
32 sendfrom-nobody@example.com: -server 127.0.0.1 -port ${smtp_port}
33 -client localhost -sasl -saslmech xoauth2 -authservice test -user user@example.com
36 cat > "${testname}.expected" <<EOF
38 AUTH XOAUTH2 dXNlcj11c2VyQGV4YW1wbGUuY29tAWF1dGg9QmVhcmVyIHRlc3QtYWNjZXNzAQE=
39 MAIL FROM:<nobody@example.com>
40 RCPT TO:<somebody@example.com>
42 From: Mr Nobody <nobody@example.com>
43 To: Somebody Else <somebody@example.com>
46 Content-Type: text/plain; charset="us-ascii"
55 run_test
"send -draft"
56 sed 's/^Date:.*/Date:/' "${testname}.smtp-req" > "${testname}.smtp-req".clean
57 check
"${testname}.smtp-req".clean
"${testname}.expected"