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