xref: /curl/tests/data/test1407 (revision 361cd3ed)
1<testcase>
2# Based on test851
3<info>
4<keywords>
5POP3
6Clear Text
7LIST
8--libcurl
9</keywords>
10</info>
11
12#
13# Server-side
14<reply>
15<servercmd>
16REPLY LIST +OK %TESTNUMBER 100\r\n.
17</servercmd>
18</reply>
19
20#
21# Client-side
22<client>
23<server>
24pop3
25</server>
26<name>
27--libcurl for POP3 LIST one message
28</name>
29<setenv>
30SSL_CERT_FILE=
31</setenv>
32<command>
33pop3://%HOSTIP:%POP3PORT/%TESTNUMBER -l -u user:secret --libcurl %LOGDIR/test%TESTNUMBER.c
34</command>
35# Need ftp so the FTP options are written in the --libcurl template
36<features>
37ftp
38</features>
39</client>
40
41#
42# Verify data after the test has been "shot"
43<verify>
44<protocol>
45CAPA
46USER user
47PASS secret
48LIST %TESTNUMBER
49QUIT
50</protocol>
51<file name="%LOGDIR/test%TESTNUMBER.c" mode="text">
52/********* Sample code generated by the curl command line tool **********
53 * All curl_easy_setopt() options are documented at:
54 * https://curl.se/libcurl/c/curl_easy_setopt.html
55 ************************************************************************/
56#include <curl/curl.h>
57
58int main(int argc, char *argv[])
59{
60  CURLcode ret;
61  CURL *hnd;
62
63  hnd = curl_easy_init();
64  curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L);
65  curl_easy_setopt(hnd, CURLOPT_URL, "pop3://%HOSTIP:%POP3PORT/%TESTNUMBER");
66  curl_easy_setopt(hnd, CURLOPT_DIRLISTONLY, 1L);
67  curl_easy_setopt(hnd, CURLOPT_USERPWD, "user:secret");
68  curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L);
69  curl_easy_setopt(hnd, CURLOPT_FTP_SKIP_PASV_IP, 1L);
70  curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L);
71
72  /* Here is a list of options the curl code used that cannot get generated
73     as source easily. You may choose to either not use them or implement
74     them yourself.
75
76  CURLOPT_WRITEDATA was set to an object pointer
77  CURLOPT_WRITEFUNCTION was set to a function pointer
78  CURLOPT_READDATA was set to an object pointer
79  CURLOPT_READFUNCTION was set to a function pointer
80  CURLOPT_SEEKDATA was set to an object pointer
81  CURLOPT_SEEKFUNCTION was set to a function pointer
82  CURLOPT_ERRORBUFFER was set to an object pointer
83  CURLOPT_STDERR was set to an object pointer
84  CURLOPT_DEBUGFUNCTION was set to a function pointer
85  CURLOPT_DEBUGDATA was set to an object pointer
86  CURLOPT_HEADERFUNCTION was set to a function pointer
87  CURLOPT_HEADERDATA was set to an object pointer
88
89  */
90
91  ret = curl_easy_perform(hnd);
92
93  curl_easy_cleanup(hnd);
94  hnd = NULL;
95
96  return (int)ret;
97}
98/**** End of sample code ****/
99</file>
100<stripfile>
101# These options vary with configurations - just ignore them
102# CURLOPT_INTERLEAVEDATA requires RTSP (HTTP) protocol
103$_ = '' if /CURLOPT_USERAGENT/
104$_ = '' if /CURLOPT_MAXREDIRS/
105$_ = '' if /CURLOPT_SSL_VERIFYPEER/
106$_ = '' if /CURLOPT_SSH_KNOWNHOSTS/
107$_ = '' if /CURLOPT_HTTP_VERSION/
108$_ = '' if /CURLOPT_HTTP09_ALLOWED/
109$_ = '' if /CURLOPT_INTERLEAVEDATA/
110</stripfile>
111</verify>
112</testcase>
113