xref: /curl/tests/data/test646 (revision 3fd80c7b)
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 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=@%LOGDIR/headers%TESTNUMBER" -F "=)" -F "=@%LOGDIR/test%TESTNUMBER.txt;headers=<%LOGDIR/headers%TESTNUMBER" -H "From: different" -H "To: another" -H "Reply-To: <followup@example.com>"
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
45#a
46 folded header
47</file2>
48</client>
49
50#
51# Verify data after the test has been "shot"
52<verify>
53<strippart>
54s/^--------------------------[A-Za-z0-9]*/------------------------------/
55s/boundary=------------------------[A-Za-z0-9]*/boundary=----------------------------/
56</strippart>
57<protocol>
58EHLO %TESTNUMBER
59MAIL FROM:<sender@example.com>
60RCPT TO:<recipient@example.com>
61DATA
62QUIT
63</protocol>
64<upload>
65Content-Type: multipart/mixed; boundary=----------------------------
66Mime-Version: 1.0
67From: different
68To: another
69Reply-To: <followup@example.com>
70
71------------------------------
72Content-Type: multipart/alternative; boundary=----------------------------
73
74------------------------------
75Content-Type: text/html
76Content-Transfer-Encoding: 8bit
77X-test1: this is a header
78X-test2: this is another header
79
80<body>This is the html version</body>
81------------------------------
82X-fileheader1: This is a header from a file
83X-fileheader2: This is #a folded header
84
85This is the plain text version
86--------------------------------
87
88------------------------------
89Content-Disposition: attachment; filename="test%TESTNUMBER.txt"
90X-fileheader1: This is a header from a file
91X-fileheader2: This is #a folded header
92
93This is an attached file.
94
95It may contain any type of data.
96
97--------------------------------
98.
99</upload>
100</verify>
101</testcase>
102