• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<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 <command>
36'imap://%HOSTIP:%IMAPPORT/1420/;UID=1' -u user:secret --libcurl log/test1420.c
37</command>
38</client>
39
40#
41# Verify data after the test has been "shot"
42<verify>
43<protocol>
44A001 CAPABILITY
45A002 LOGIN user secret
46A003 SELECT 1420
47A004 FETCH 1 BODY[]
48A005 LOGOUT
49</protocol>
50<file name="log/test1420.c" mode="text">
51/********* Sample code generated by the curl command line tool **********
52 * All curl_easy_setopt() options are documented at:
53 * https://curl.haxx.se/libcurl/c/curl_easy_setopt.html
54 ************************************************************************/
55#include <curl/curl.h>
56
57int main(int argc, char *argv[])
58{
59  CURLcode ret;
60  CURL *hnd;
61
62  hnd = curl_easy_init();
63  curl_easy_setopt(hnd, CURLOPT_URL, "imap://%HOSTIP:%IMAPPORT/1420/;UID=1");
64  curl_easy_setopt(hnd, CURLOPT_HEADER, 1L);
65  curl_easy_setopt(hnd, CURLOPT_USERPWD, "user:secret");
66  curl_easy_setopt(hnd, CURLOPT_USERAGENT, "stripped");
67  curl_easy_setopt(hnd, CURLOPT_MAXREDIRS, 50L);
68  curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L);
69  curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L);
70
71  /* Here is a list of options the curl code used that cannot get generated
72     as source easily. You may select to either not use them or implement
73     them yourself.
74
75  CURLOPT_WRITEDATA set to a objectpointer
76  CURLOPT_INTERLEAVEDATA set to a objectpointer
77  CURLOPT_WRITEFUNCTION set to a functionpointer
78  CURLOPT_READDATA set to a objectpointer
79  CURLOPT_READFUNCTION set to a functionpointer
80  CURLOPT_SEEKDATA set to a objectpointer
81  CURLOPT_SEEKFUNCTION set to a functionpointer
82  CURLOPT_ERRORBUFFER set to a objectpointer
83  CURLOPT_STDERR set to a objectpointer
84  CURLOPT_DEBUGFUNCTION set to a functionpointer
85  CURLOPT_DEBUGDATA set to a objectpointer
86  CURLOPT_HEADERFUNCTION set to a functionpointer
87  CURLOPT_HEADERDATA set to a objectpointer
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# curl's default user-agent varies with version, libraries etc.
102s/(USERAGENT, \")[^\"]+/${1}stripped/
103# CURLOPT_SSL_VERIFYPEER, SSH_KNOWNHOSTS and HTTP_VERSION vary with
104# configurations - just ignore them
105$_ = '' if /CURLOPT_SSL_VERIFYPEER/
106$_ = '' if /CURLOPT_SSH_KNOWNHOSTS/
107$_ = '' if /CURLOPT_HTTP_VERSION/
108</stripfile>
109</verify>
110</testcase>
111