blob: 415e35902b4f6400a0f0621a98f1384bb9e99ff9 [file] [log] [blame]
xf.li6c8fc1e2023-08-12 00:11:09 -07001<testcase>
2# Based on test800
3<info>
4<keywords>
5IMAP
6Clear Text
7FETCH
8--libcurl
9</keywords>
10</info>
11
12#
13# Server-side
14<reply>
15<data>
16From: me@somewhere
17To: fake@nowhere
18
19body
20
21--
22 yours sincerely
23</data>
24</reply>
25
26#
27# Client-side
28<client>
29<server>
30imap
31</server>
32 <name>
33--libcurl for IMAP FETCH message
34 </name>
35<setenv>
36SSL_CERT_FILE=
37</setenv>
38<command>
39'imap://%HOSTIP:%IMAPPORT/%TESTNUMBER/;MAILINDEX=1' -u user:secret --libcurl log/test%TESTNUMBER.c
40</command>
41</client>
42
43#
44# Verify data after the test has been "shot"
45<verify>
46<protocol>
47A001 CAPABILITY
48A002 LOGIN user secret
49A003 SELECT %TESTNUMBER
50A004 FETCH 1 BODY[]
51A005 LOGOUT
52</protocol>
53<file name="log/test%TESTNUMBER.c" mode="text">
54/********* Sample code generated by the curl command line tool **********
55 * All curl_easy_setopt() options are documented at:
56 * https://curl.se/libcurl/c/curl_easy_setopt.html
57 ************************************************************************/
58#include <curl/curl.h>
59
60int main(int argc, char *argv[])
61{
62 CURLcode ret;
63 CURL *hnd;
64
65 hnd = curl_easy_init();
66 curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L);
67 curl_easy_setopt(hnd, CURLOPT_URL, "imap://%HOSTIP:%IMAPPORT/%TESTNUMBER/;MAILINDEX=1");
68 curl_easy_setopt(hnd, CURLOPT_USERPWD, "user:secret");
69 curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L);
70 curl_easy_setopt(hnd, CURLOPT_FTP_SKIP_PASV_IP, 1L);
71 curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L);
72
73 /* Here is a list of options the curl code used that cannot get generated
74 as source easily. You may choose to either not use them or implement
75 them yourself.
76
77 CURLOPT_WRITEDATA was set to an object pointer
78 CURLOPT_WRITEFUNCTION was set to a function pointer
79 CURLOPT_READDATA was set to an object pointer
80 CURLOPT_READFUNCTION was set to a function pointer
81 CURLOPT_SEEKDATA was set to an object pointer
82 CURLOPT_SEEKFUNCTION was set to a function pointer
83 CURLOPT_ERRORBUFFER was set to an object pointer
84 CURLOPT_STDERR was set to an object pointer
85 CURLOPT_DEBUGFUNCTION was set to a function pointer
86 CURLOPT_DEBUGDATA was set to an object pointer
87 CURLOPT_HEADERFUNCTION was set to a function pointer
88 CURLOPT_HEADERDATA was set to an object pointer
89
90 */
91
92 ret = curl_easy_perform(hnd);
93
94 curl_easy_cleanup(hnd);
95 hnd = NULL;
96
97 return (int)ret;
98}
99/**** End of sample code ****/
100</file>
101<stripfile>
102# These options vary with configurations - just ignore them
103# CURLOPT_INTERLEAVEDATA requires RTSP (HTTP) protocol
104$_ = '' if /CURLOPT_USERAGENT/
105$_ = '' if /CURLOPT_MAXREDIRS/
106$_ = '' if /CURLOPT_SSL_VERIFYPEER/
107$_ = '' if /CURLOPT_SSH_KNOWNHOSTS/
108$_ = '' if /CURLOPT_HTTP_VERSION/
109$_ = '' if /CURLOPT_INTERLEAVEDATA/
110</stripfile>
111</verify>
112</testcase>