Home | History | Annotate | Download | only in data
      1 <testcase>
      2 # Based on test800
      3 <info>
      4 <keywords>
      5 IMAP
      6 Clear Text
      7 FETCH
      8 --libcurl
      9 </keywords>
     10 </info>
     11 
     12 #
     13 # Server-side
     14 <reply>
     15 <data>
     16 From: me@somewhere
     17 To: fake@nowhere
     18 
     19 body
     20 
     21 --
     22   yours sincerely
     23 </data>
     24 </reply>
     25 
     26 #
     27 # Client-side
     28 <client>
     29 <server>
     30 imap
     31 </server>
     32  <name>
     33 --libcurl for IMAP FETCH message
     34  </name>
     35 <setenv>
     36 SSL_CERT_FILE=
     37 </setenv>
     38 <command>
     39 'imap://%HOSTIP:%IMAPPORT/1420/;MAILINDEX=1' -u user:secret --libcurl log/test1420.c
     40 </command>
     41 </client>
     42 
     43 #
     44 # Verify data after the test has been "shot"
     45 <verify>
     46 <protocol>
     47 A001 CAPABILITY
     48 A002 LOGIN user secret
     49 A003 SELECT 1420
     50 A004 FETCH 1 BODY[]
     51 A005 LOGOUT
     52 </protocol>
     53 <file name="log/test1420.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.haxx.se/libcurl/c/curl_easy_setopt.html
     57  ************************************************************************/
     58 #include <curl/curl.h>
     59 
     60 int 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/1420/;MAILINDEX=1");
     68   curl_easy_setopt(hnd, CURLOPT_USERPWD, "user:secret");
     69   curl_easy_setopt(hnd, CURLOPT_HTTP09_ALLOWED, 1L);
     70   curl_easy_setopt(hnd, CURLOPT_VERBOSE, 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 select to either not use them or implement
     75      them yourself.
     76 
     77   CURLOPT_WRITEDATA set to a objectpointer
     78   CURLOPT_INTERLEAVEDATA set to a objectpointer
     79   CURLOPT_WRITEFUNCTION set to a functionpointer
     80   CURLOPT_READDATA set to a objectpointer
     81   CURLOPT_READFUNCTION set to a functionpointer
     82   CURLOPT_SEEKDATA set to a objectpointer
     83   CURLOPT_SEEKFUNCTION set to a functionpointer
     84   CURLOPT_ERRORBUFFER set to a objectpointer
     85   CURLOPT_STDERR set to a objectpointer
     86   CURLOPT_DEBUGFUNCTION set to a functionpointer
     87   CURLOPT_DEBUGDATA set to a objectpointer
     88   CURLOPT_HEADERFUNCTION set to a functionpointer
     89   CURLOPT_HEADERDATA set to a objectpointer
     90 
     91   */
     92 
     93   ret = curl_easy_perform(hnd);
     94 
     95   curl_easy_cleanup(hnd);
     96   hnd = NULL;
     97 
     98   return (int)ret;
     99 }
    100 /**** End of sample code ****/
    101 </file>
    102 <stripfile>
    103 # These options vary with configurations - just ignore them
    104 $_ = '' if /CURLOPT_USERAGENT/
    105 $_ = '' if /CURLOPT_MAXREDIRS/
    106 $_ = '' if /CURLOPT_SSL_VERIFYPEER/
    107 $_ = '' if /CURLOPT_SSH_KNOWNHOSTS/
    108 $_ = '' if /CURLOPT_HTTP_VERSION/
    109 </stripfile>
    110 </verify>
    111 </testcase>
    112