1<testcase> 2<info> 3<keywords> 4SMTP 5SASL 6SASL AUTH OAUTH2 7SASL-IR 8RFC4954 9RFC6749 10RFC7628 11</keywords> 12</info> 13 14# 15# Server-side 16<reply> 17<servercmd> 18AUTH OAUTHBEARER 19REPLY AUTH 235 Authenticated 20</servercmd> 21</reply> 22 23# 24# Client-side 25<client> 26<server> 27smtp 28</server> 29 <name> 30SMTP OAuth 2.0 (OAUTHBEARER) authentication with initial response 31 </name> 32<stdin> 33mail body 34</stdin> 35 <command> 36smtp://%HOSTIP:%SMTPPORT/947 --mail-rcpt recipient@example.com --mail-from sender@example.com -u user --oauth2-bearer mF_9.B5f-4.1JqM --sasl-ir -T - 37</command> 38# The protocol section doesn't support ways of specifying the raw data in the 39# base64 encoded message so we must assert this 40<precheck> 41perl -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> 49EHLO 947 50AUTH OAUTHBEARER dXNlcj11c2VyAWhvc3Q9MTI3LjAuMC4xAXBvcnQ9OTAwNQFhdXRoPUJlYXJlciBtRl85LkI1Zi00LjFKcU0BAQ== 51MAIL FROM:<sender@example.com> 52RCPT TO:<recipient@example.com> 53DATA 54QUIT 55</protocol> 56<upload> 57mail body 58. 59</upload> 60</verify> 61</testcase> 62