Imported Upstream version 7.48.0
[platform/upstream/curl.git] / tests / data / test946
1 <testcase>
2 <info>
3 <keywords>
4 SMTP
5 SASL
6 SASL AUTH OAUTH2
7 RFC4954
8 RFC6749
9 RFC7628
10 </keywords>
11 </info>
12
13 #
14 # Server-side
15 <reply>
16 <servercmd>
17 AUTH OAUTHBEARER
18 REPLY AUTH 334 OAUTHBEARER supported
19 REPLY dXNlcj11c2VyAWhvc3Q9MTI3LjAuMC4xAXBvcnQ9OTAwNQFhdXRoPUJlYXJlciBtRl85LkI1Zi00LjFKcU0BAQ== 235 Authenticated
20 </servercmd>
21 </reply>
22
23 #
24 # Client-side
25 <client>
26 <server>
27 smtp
28 </server>
29  <name>
30 SMTP OAuth 2.0 (OAUTHBEARER) authentication
31  </name>
32 <stdin>
33 mail body\r
34 </stdin>
35  <command>
36 smtp://%HOSTIP:%SMTPPORT/946 --mail-rcpt recipient@example.com --mail-from sender@example.com -u user --oauth2-bearer mF_9.B5f-4.1JqM -T -
37 </command>
38 # The protocol section doesn't support ways of specifing the raw data in the
39 # base64 encoded message so we must assert this
40 <precheck>
41 perl -e "print 'Test requires default test server host and port' if ( '%HOSTIP' ne '127.0.0.1' || '%SMTPPORT' ne '9005' );"
42 </precheck>
43 </client>
44
45 #
46 # Verify data after the test has been "shot"
47 <verify>
48 <protocol>
49 EHLO 946\r
50 AUTH OAUTHBEARER\r
51 dXNlcj11c2VyAWhvc3Q9MTI3LjAuMC4xAXBvcnQ9OTAwNQFhdXRoPUJlYXJlciBtRl85LkI1Zi00LjFKcU0BAQ==\r
52 MAIL FROM:<sender@example.com>\r
53 RCPT TO:<recipient@example.com>\r
54 DATA\r
55 QUIT\r
56 </protocol>
57 <upload>
58 mail body\r
59 .\r
60 </upload>
61 </verify>
62 </testcase>