test946 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. # Server-side
  14. <reply>
  15. <servercmd>
  16. AUTH OAUTHBEARER
  17. REPLY AUTH 334 OAUTHBEARER supported
  18. REPLY dXNlcj11c2VyAWhvc3Q9MTI3LjAuMC4xAXBvcnQ9OTAwNQFhdXRoPUJlYXJlciBtRl85LkI1Zi00LjFKcU0BAQ== 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
  29. </name>
  30. <stdin>
  31. mail body
  32. </stdin>
  33. <command>
  34. smtp://%HOSTIP:%SMTPPORT/946 --mail-rcpt recipient@example.com --mail-from sender@example.com -u user --oauth2-bearer mF_9.B5f-4.1JqM -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 946
  47. AUTH OAUTHBEARER
  48. dXNlcj11c2VyAWhvc3Q9MTI3LjAuMC4xAXBvcnQ9OTAwNQFhdXRoPUJlYXJlciBtRl85LkI1Zi00LjFKcU0BAQ==
  49. MAIL FROM:<sender@example.com>
  50. RCPT TO:<recipient@example.com>
  51. DATA
  52. QUIT
  53. </protocol>
  54. <upload>
  55. mail body
  56. .
  57. </upload>
  58. </verify>
  59. </testcase>