test947 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <testcase>
  2. <info>
  3. <keywords>
  4. SMTP
  5. SASL
  6. SASL AUTH OAUTH2
  7. SASL-IR
  8. RFC4954
  9. RFC6749
  10. RFC7628
  11. </keywords>
  12. </info>
  13. #
  14. # Server-side
  15. <reply>
  16. <servercmd>
  17. AUTH OAUTHBEARER
  18. REPLY AUTH 235 Authenticated
  19. </servercmd>
  20. </reply>
  21. #
  22. # Client-side
  23. <client>
  24. <server>
  25. smtp
  26. </server>
  27. <name>
  28. SMTP OAuth 2.0 (OAUTHBEARER) authentication with initial response
  29. </name>
  30. <stdin>
  31. mail body
  32. </stdin>
  33. <command>
  34. smtp://%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 -
  35. </command>
  36. # The protocol section doesn't support ways of specifying the raw data in the
  37. # base64 encoded message so we must assert this
  38. <precheck>
  39. perl -e "print 'Test requires default test server host and port' if ( '%HOSTIP' ne '127.0.0.1' || '%SMTPPORT' ne '9005' );"
  40. </precheck>
  41. </client>
  42. #
  43. # Verify data after the test has been "shot"
  44. <verify>
  45. <protocol>
  46. EHLO 947
  47. AUTH OAUTHBEARER dXNlcj11c2VyAWhvc3Q9MTI3LjAuMC4xAXBvcnQ9OTAwNQFhdXRoPUJlYXJlciBtRl85LkI1Zi00LjFKcU0BAQ==
  48. MAIL FROM:<sender@example.com>
  49. RCPT TO:<recipient@example.com>
  50. DATA
  51. QUIT
  52. </protocol>
  53. <upload>
  54. mail body
  55. .
  56. </upload>
  57. </verify>
  58. </testcase>