3
# N.B. --libcurl output not sufficient to deal with uploaded files.
25
<file name="log/test1406.eml">
32
smtp://%HOSTIP:%SMTPPORT/user --mail-rcpt 1406@foo --mail-rcpt 1406@foobar.example --mail-from 1406@from -T log/test1406.eml --libcurl log/test1406.c
37
# Verify data after the test has been "shot"
41
MAIL FROM:<1406@from> SIZE=34
43
RCPT TO:<1406@foobar.example>
55
<file name="log/test1406.c" mode="text">
56
/********* Sample code generated by the curl command line tool **********
57
* All curl_easy_setopt() options are documented at:
58
* http://curl.haxx.se/libcurl/c/curl_easy_setopt.html
59
************************************************************************/
60
#include <curl/curl.h>
62
int main(int argc, char *argv[])
66
struct curl_slist *slist1;
69
slist1 = curl_slist_append(slist1, "1406@foo");
70
slist1 = curl_slist_append(slist1, "1406@foobar.example");
72
hnd = curl_easy_init();
73
curl_easy_setopt(hnd, CURLOPT_INFILESIZE_LARGE, (curl_off_t)34);
74
curl_easy_setopt(hnd, CURLOPT_URL, "smtp://%HOSTIP:%SMTPPORT/user");
75
curl_easy_setopt(hnd, CURLOPT_HEADER, 1L);
76
curl_easy_setopt(hnd, CURLOPT_UPLOAD, 1L);
77
curl_easy_setopt(hnd, CURLOPT_USERAGENT, "stripped");
78
curl_easy_setopt(hnd, CURLOPT_MAXREDIRS, 50L);
79
curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L);
80
curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L);
81
curl_easy_setopt(hnd, CURLOPT_MAIL_FROM, "1406@from");
82
curl_easy_setopt(hnd, CURLOPT_MAIL_RCPT, slist1);
84
/* Here is a list of options the curl code used that cannot get generated
85
as source easily. You may select to either not use them or implement
88
CURLOPT_WRITEDATA set to a objectpointer
89
CURLOPT_WRITEFUNCTION set to a functionpointer
90
CURLOPT_READDATA set to a objectpointer
91
CURLOPT_READFUNCTION set to a functionpointer
92
CURLOPT_SEEKDATA set to a objectpointer
93
CURLOPT_SEEKFUNCTION set to a functionpointer
94
CURLOPT_ERRORBUFFER set to a objectpointer
95
CURLOPT_STDERR set to a objectpointer
96
CURLOPT_DEBUGFUNCTION set to a functionpointer
97
CURLOPT_DEBUGDATA set to a objectpointer
101
ret = curl_easy_perform(hnd);
103
curl_easy_cleanup(hnd);
105
curl_slist_free_all(slist1);
110
/**** End of sample code ****/
113
# curl's default user-agent varies with version, libraries etc.
114
s/(USERAGENT, \")[^\"]+/${1}stripped/
115
# CURLOPT_SSL_VERIFYPEER and SSH_KNOWNHOSTS vary with configurations - just
117
$_ = '' if /CURLOPT_SSL_VERIFYPEER/
118
$_ = '' if /CURLOPT_SSH_KNOWNHOSTS/