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