test646 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <testcase>
  2. <info>
  3. <keywords>
  4. SMTP
  5. MULTIPART
  6. </keywords>
  7. </info>
  8. #
  9. # Server-side
  10. <reply>
  11. </reply>
  12. #
  13. # Client-side
  14. <client>
  15. <server>
  16. smtp
  17. </server>
  18. <name>
  19. SMTP multipart using mime API
  20. </name>
  21. <stdin>
  22. From: different
  23. To: another
  24. body
  25. </stdin>
  26. <command>
  27. smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient@example.com --mail-from sender@example.com -F "=(;type=multipart/alternative" -F "= <body>This is the html version</body>;headers=X-test1: this is a header;type=text/html;headers=X-test2: this is another header " -F "=This is the plain text version;headers=@log/headers%TESTNUMBER" -F "=)" -F "=@log/test%TESTNUMBER.txt;headers=<log/headers%TESTNUMBER" -H "From: different" -H "To: another" -H "Reply-To: <followup@example.com>"
  28. </command>
  29. <file1 name="log/test%TESTNUMBER.txt">
  30. This is an attached file.
  31. It may contain any type of data.
  32. </file1>
  33. <file2 name="log/headers%TESTNUMBER">
  34. # This line is a comment
  35. X-fileheader1: This is a header from a file
  36. # This line is another comment. It precedes a folded header.
  37. X-fileheader2: This is #a
  38. folded header
  39. </file2>
  40. </client>
  41. #
  42. # Verify data after the test has been "shot"
  43. <verify>
  44. <strippart>
  45. s/^--------------------------[a-z0-9]*/------------------------------/
  46. s/boundary=------------------------[a-z0-9]*/boundary=----------------------------/
  47. </strippart>
  48. <protocol>
  49. EHLO %TESTNUMBER
  50. MAIL FROM:<sender@example.com>
  51. RCPT TO:<recipient@example.com>
  52. DATA
  53. QUIT
  54. </protocol>
  55. <upload>
  56. Content-Type: multipart/mixed; boundary=----------------------------
  57. Mime-Version: 1.0
  58. From: different
  59. To: another
  60. Reply-To: <followup@example.com>
  61. ------------------------------
  62. Content-Type: multipart/alternative; boundary=----------------------------
  63. ------------------------------
  64. Content-Type: text/html
  65. Content-Transfer-Encoding: 8bit
  66. X-test1: this is a header
  67. X-test2: this is another header
  68. <body>This is the html version</body>
  69. ------------------------------
  70. X-fileheader1: This is a header from a file
  71. X-fileheader2: This is #a folded header
  72. This is the plain text version
  73. --------------------------------
  74. ------------------------------
  75. Content-Disposition: attachment; filename="test%TESTNUMBER.txt"
  76. X-fileheader1: This is a header from a file
  77. X-fileheader2: This is #a folded header
  78. This is an attached file.
  79. It may contain any type of data.
  80. --------------------------------
  81. .
  82. </upload>
  83. </verify>
  84. </testcase>