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