summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorAlessandro Ghedini <alessandro@ghedini.me>2014-01-29 10:44:49 +0100
committerAlessandro Ghedini <alessandro@ghedini.me>2014-01-29 10:44:49 +0100
commitc930db776b4046d2977e64c52779ea2402ac2d24 (patch)
tree8d7144a824e34e41936396c334a823d566708f65 /docs
parentb40308b18042c9bb55c6e0388e3715bc264b1b55 (diff)
Imported Upstream version 7.35.0
Diffstat (limited to 'docs')
-rw-r--r--docs/FAQ2
-rw-r--r--docs/FEATURES4
-rw-r--r--docs/INSTALL7
-rw-r--r--docs/INTERNALS6
-rw-r--r--docs/KNOWN_BUGS4
-rw-r--r--docs/Makefile.am2
-rw-r--r--docs/Makefile.in4
-rw-r--r--docs/RELEASE-PROCEDURE53
-rw-r--r--docs/TODO39
-rw-r--r--docs/TheArtOfHttpScripting297
-rw-r--r--docs/curl-config.pdfbin6016 -> 6016 bytes
-rw-r--r--docs/curl.110
-rw-r--r--docs/curl.html2
-rw-r--r--docs/curl.pdfbin99548 -> 99434 bytes
-rw-r--r--docs/examples/Makefile.in401
-rw-r--r--docs/examples/Makefile.inc8
-rw-r--r--docs/examples/imap-append.c115
-rw-r--r--docs/examples/imap-copy.c65
-rw-r--r--docs/examples/imap-create.c61
-rw-r--r--docs/examples/imap-delete.c61
-rw-r--r--docs/examples/imap-examine.c61
-rw-r--r--docs/examples/imap-fetch.c (renamed from docs/examples/imap.c)24
-rw-r--r--docs/examples/imap-list.c60
-rw-r--r--docs/examples/imap-multi.c145
-rw-r--r--docs/examples/imap-noop.c61
-rw-r--r--docs/examples/imap-search.c65
-rw-r--r--docs/examples/imap-ssl.c (renamed from docs/examples/pop3slist.c)48
-rw-r--r--docs/examples/imap-store.c76
-rw-r--r--docs/examples/imap-tls.c84
-rw-r--r--docs/examples/pop3-dele.c64
-rw-r--r--docs/examples/pop3-list.c58
-rw-r--r--docs/examples/pop3-multi.c145
-rw-r--r--docs/examples/pop3-noop.c64
-rw-r--r--docs/examples/pop3-retr.c58
-rw-r--r--docs/examples/pop3-ssl.c (renamed from docs/examples/pop3s.c)48
-rw-r--r--docs/examples/pop3-stat.c64
-rw-r--r--docs/examples/pop3-tls.c84
-rw-r--r--docs/examples/pop3-top.c61
-rw-r--r--docs/examples/pop3-uidl.c61
-rw-r--r--docs/examples/simplesmtp.c87
-rw-r--r--docs/examples/smtp-expn.c73
-rw-r--r--docs/examples/smtp-mail.c137
-rw-r--r--docs/examples/smtp-multi.c182
-rw-r--r--docs/examples/smtp-ssl.c161
-rw-r--r--docs/examples/smtp-tls.c85
-rw-r--r--docs/examples/smtp-vrfy.c73
-rw-r--r--docs/libcurl/Makefile.in2
-rw-r--r--docs/libcurl/curl_easy_cleanup.pdfbin4280 -> 4280 bytes
-rw-r--r--docs/libcurl/curl_easy_duphandle.pdfbin4029 -> 4029 bytes
-rw-r--r--docs/libcurl/curl_easy_escape.pdf16
-rw-r--r--docs/libcurl/curl_easy_getinfo.pdfbin17281 -> 17281 bytes
-rw-r--r--docs/libcurl/curl_easy_init.pdfbin4064 -> 4064 bytes
-rw-r--r--docs/libcurl/curl_easy_pause.38
-rw-r--r--docs/libcurl/curl_easy_pause.html3
-rw-r--r--docs/libcurl/curl_easy_pause.pdfbin7183 -> 7457 bytes
-rw-r--r--docs/libcurl/curl_easy_perform.pdfbin4398 -> 4398 bytes
-rw-r--r--docs/libcurl/curl_easy_recv.pdfbin5447 -> 5447 bytes
-rw-r--r--docs/libcurl/curl_easy_reset.pdfbin3683 -> 3683 bytes
-rw-r--r--docs/libcurl/curl_easy_send.pdfbin5179 -> 5179 bytes
-rw-r--r--docs/libcurl/curl_easy_setopt.334
-rw-r--r--docs/libcurl/curl_easy_setopt.html19
-rw-r--r--docs/libcurl/curl_easy_setopt.pdfbin148820 -> 148833 bytes
-rw-r--r--docs/libcurl/curl_easy_strerror.pdfbin3411 -> 3411 bytes
-rw-r--r--docs/libcurl/curl_easy_unescape.pdfbin4140 -> 4140 bytes
-rw-r--r--docs/libcurl/curl_escape.pdfbin4014 -> 4014 bytes
-rw-r--r--docs/libcurl/curl_formadd.pdfbin12196 -> 12196 bytes
-rw-r--r--docs/libcurl/curl_formfree.pdfbin3769 -> 3769 bytes
-rw-r--r--docs/libcurl/curl_formget.pdfbin4410 -> 4410 bytes
-rw-r--r--docs/libcurl/curl_free.pdf16
-rw-r--r--docs/libcurl/curl_getdate.324
-rw-r--r--docs/libcurl/curl_getdate.html9
-rw-r--r--docs/libcurl/curl_getdate.pdfbin6936 -> 6340 bytes
-rw-r--r--docs/libcurl/curl_getenv.pdfbin4188 -> 4188 bytes
-rw-r--r--docs/libcurl/curl_global_cleanup.pdfbin3860 -> 3860 bytes
-rw-r--r--docs/libcurl/curl_global_init.pdfbin5093 -> 5093 bytes
-rw-r--r--docs/libcurl/curl_global_init_mem.pdfbin4083 -> 4083 bytes
-rw-r--r--docs/libcurl/curl_mprintf.pdfbin5924 -> 5924 bytes
-rw-r--r--docs/libcurl/curl_multi_add_handle.pdfbin4406 -> 4406 bytes
-rw-r--r--docs/libcurl/curl_multi_assign.pdfbin4593 -> 4593 bytes
-rw-r--r--docs/libcurl/curl_multi_cleanup.pdfbin3812 -> 3812 bytes
-rw-r--r--docs/libcurl/curl_multi_fdset.pdfbin5180 -> 5180 bytes
-rw-r--r--docs/libcurl/curl_multi_info_read.pdfbin4913 -> 4915 bytes
-rw-r--r--docs/libcurl/curl_multi_init.pdfbin3423 -> 3423 bytes
-rw-r--r--docs/libcurl/curl_multi_perform.pdfbin5655 -> 5655 bytes
-rw-r--r--docs/libcurl/curl_multi_remove_handle.pdfbin3877 -> 3877 bytes
-rw-r--r--docs/libcurl/curl_multi_setopt.pdfbin11487 -> 11487 bytes
-rw-r--r--docs/libcurl/curl_multi_socket.pdfbin9402 -> 9402 bytes
-rw-r--r--docs/libcurl/curl_multi_socket_action.pdfbin9638 -> 9638 bytes
-rw-r--r--docs/libcurl/curl_multi_strerror.pdfbin3433 -> 3433 bytes
-rw-r--r--docs/libcurl/curl_multi_timeout.pdfbin4628 -> 4628 bytes
-rw-r--r--docs/libcurl/curl_multi_wait.pdfbin4952 -> 4952 bytes
-rw-r--r--docs/libcurl/curl_share_cleanup.pdfbin3630 -> 3630 bytes
-rw-r--r--docs/libcurl/curl_share_init.pdfbin3819 -> 3819 bytes
-rw-r--r--docs/libcurl/curl_share_setopt.pdfbin5585 -> 5585 bytes
-rw-r--r--docs/libcurl/curl_share_strerror.pdfbin3432 -> 3432 bytes
-rw-r--r--docs/libcurl/curl_slist_append.pdf16
-rw-r--r--docs/libcurl/curl_slist_free_all.pdf16
-rw-r--r--docs/libcurl/curl_strequal.pdfbin4148 -> 4148 bytes
-rw-r--r--docs/libcurl/curl_unescape.pdfbin3977 -> 3977 bytes
-rw-r--r--docs/libcurl/curl_version.pdfbin3311 -> 3311 bytes
-rw-r--r--docs/libcurl/curl_version_info.pdfbin8435 -> 8435 bytes
-rw-r--r--docs/libcurl/libcurl-easy.pdfbin4231 -> 4231 bytes
-rw-r--r--docs/libcurl/libcurl-errors.pdfbin17118 -> 17118 bytes
-rw-r--r--docs/libcurl/libcurl-multi.pdfbin9397 -> 9397 bytes
-rw-r--r--docs/libcurl/libcurl-share.pdfbin4940 -> 4940 bytes
-rw-r--r--docs/libcurl/libcurl-tutorial.pdfbin72192 -> 72192 bytes
-rw-r--r--docs/libcurl/libcurl.pdfbin13659 -> 13659 bytes
-rw-r--r--docs/mk-ca-bundle.html2
-rw-r--r--docs/mk-ca-bundle.pdfbin4957 -> 5144 bytes
109 files changed, 2964 insertions, 471 deletions
diff --git a/docs/FAQ b/docs/FAQ
index b6f8958a..3704f056 100644
--- a/docs/FAQ
+++ b/docs/FAQ
@@ -422,7 +422,7 @@ FAQ
curl can be built to use one of the following SSL alternatives: OpenSSL,
GnuTLS, yassl, NSS, PolarSSL, axTLS, Secure Transport (native iOS/OS X),
- schannel (native Windows) or qssl (native IBM i). They all have their pros
+ WinSSL (native Windows) or qssl (native IBM i). They all have their pros
and cons, and we try to maintain a comparison of them here:
http://curl.haxx.se/docs/ssl-compared.html
diff --git a/docs/FEATURES b/docs/FEATURES
index 14d7e78d..0221ce35 100644
--- a/docs/FEATURES
+++ b/docs/FEATURES
@@ -176,14 +176,14 @@ IMAPS (*1)
FOOTNOTES
=========
- *1 = requires OpenSSL, GnuTLS, NSS, yassl, axTLS, PolarSSL, schannel (native
+ *1 = requires OpenSSL, GnuTLS, NSS, yassl, axTLS, PolarSSL, WinSSL (native
Windows), Secure Transport (native iOS/OS X) or qssl (native IBM i)
*2 = requires OpenLDAP
*3 = requires a GSSAPI-compliant library, such as Heimdal or similar
*4 = requires FBopenssl
*5 = requires a krb4 library, such as the MIT one or similar
*6 = requires c-ares
- *7 = requires OpenSSL, NSS, qssl, schannel or Secure Transport; GnuTLS, for
+ *7 = requires OpenSSL, NSS, qssl, WinSSL or Secure Transport; GnuTLS, for
example, only supports SSLv3 and TLSv1
*8 = requires libssh2
*9 = requires OpenSSL, GnuTLS, NSS, yassl, Secure Transport or SSPI (native
diff --git a/docs/INSTALL b/docs/INSTALL
index 4140359d..2cebac43 100644
--- a/docs/INSTALL
+++ b/docs/INSTALL
@@ -993,6 +993,7 @@ REDUCING SIZE
--disable-verbose (eliminates debugging strings and error code strings)
--enable-hidden-symbols (eliminates unneeded symbols in the shared library)
--without-libidn (disables support for the libidn DNS library)
+ --without-librtmp (disables support for RTMP)
--without-ssl (disables support for SSL/TLS)
--without-zlib (disables support for on-the-fly decompression)
@@ -1011,9 +1012,9 @@ REDUCING SIZE
.comment section).
Using these techniques it is possible to create a basic HTTP-only shared
- libcurl library for i386 Linux platforms that is only 106 KiB in size, and
- an FTP-only library that is 108 KiB in size (as of libcurl version 7.27.0,
- using gcc 4.6.3).
+ libcurl library for i386 Linux platforms that is only 114 KiB in size, and
+ an FTP-only library that is 115 KiB in size (as of libcurl version 7.34.1,
+ using gcc 4.8.2).
You may find that statically linking libcurl to your application will
result in a lower total size than dynamically linking.
diff --git a/docs/INTERNALS b/docs/INTERNALS
index c8e433c5..a4afe068 100644
--- a/docs/INTERNALS
+++ b/docs/INTERNALS
@@ -337,10 +337,10 @@ SSL libraries
in future libcurl versions.
To deal with this internally in the best way possible, we have a generic SSL
- function API as provided by the sslgen.[ch] system, and they are the only SSL
- functions we must use from within libcurl. sslgen is then crafted to use the
+ function API as provided by the vtls.[ch] system, and they are the only SSL
+ functions we must use from within libcurl. vtls is then crafted to use the
appropriate lower-level function calls to whatever SSL library that is in
- use.
+ use. For example vtls/openssl.[ch] for the OpenSSL library.
Library Symbols
===============
diff --git a/docs/KNOWN_BUGS b/docs/KNOWN_BUGS
index e838fefd..d167ab34 100644
--- a/docs/KNOWN_BUGS
+++ b/docs/KNOWN_BUGS
@@ -69,12 +69,12 @@ may have been fixed since this was written!
option as for all other operating systems.
75. NTLM authentication involving unicode user name or password only works
- properly if built with UNICODE defined together with the schannel/winssl
+ properly if built with UNICODE defined together with the WinSSL/schannel
backend. The original problem was mentioned in:
http://curl.haxx.se/mail/lib-2009-10/0024.html
http://curl.haxx.se/bug/view.cgi?id=896
- The schannel version verified to work as mentioned in
+ The WinSSL/schannel version verified to work as mentioned in
http://curl.haxx.se/mail/lib-2012-07/0073.html
73. if a connection is made to a FTP server but the server then just never
diff --git a/docs/Makefile.am b/docs/Makefile.am
index 8a084557..d3c3d40d 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -37,7 +37,7 @@ EXTRA_DIST = MANUAL BUGS CONTRIBUTE FAQ FEATURES INTERNALS SSLCERTS \
README.win32 RESOURCES TODO TheArtOfHttpScripting THANKS VERSIONS \
KNOWN_BUGS BINDINGS $(man_MANS) $(HTMLPAGES) HISTORY INSTALL \
$(PDFPAGES) LICENSE-MIXING README.netware DISTRO-DILEMMA INSTALL.devcpp \
- MAIL-ETIQUETTE HTTP-COOKIES LIBCURL-STRUCTS SECURITY
+ MAIL-ETIQUETTE HTTP-COOKIES LIBCURL-STRUCTS SECURITY RELEASE-PROCEDURE
MAN2HTML= roffit < $< >$@
diff --git a/docs/Makefile.in b/docs/Makefile.in
index 3240d275..7225e4b9 100644
--- a/docs/Makefile.in
+++ b/docs/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.14 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
@@ -435,7 +435,7 @@ EXTRA_DIST = MANUAL BUGS CONTRIBUTE FAQ FEATURES INTERNALS SSLCERTS \
README.win32 RESOURCES TODO TheArtOfHttpScripting THANKS VERSIONS \
KNOWN_BUGS BINDINGS $(man_MANS) $(HTMLPAGES) HISTORY INSTALL \
$(PDFPAGES) LICENSE-MIXING README.netware DISTRO-DILEMMA INSTALL.devcpp \
- MAIL-ETIQUETTE HTTP-COOKIES LIBCURL-STRUCTS SECURITY
+ MAIL-ETIQUETTE HTTP-COOKIES LIBCURL-STRUCTS SECURITY RELEASE-PROCEDURE
MAN2HTML = roffit < $< >$@
SUFFIXES = .1 .html .pdf
diff --git a/docs/RELEASE-PROCEDURE b/docs/RELEASE-PROCEDURE
new file mode 100644
index 00000000..86fcef4f
--- /dev/null
+++ b/docs/RELEASE-PROCEDURE
@@ -0,0 +1,53 @@
+ _ _ ____ _
+ ___| | | | _ \| |
+ / __| | | | |_) | |
+ | (__| |_| | _ <| |___
+ \___|\___/|_| \_\_____|
+
+curl release procedure - how to do a release
+============================================
+
+[in the source code repo]
+
+- edit RELEASE-NOTES to be accurate
+
+- update docs/THANKS
+
+- make sure all relevant changes are committed on the master branch
+
+- tag the git repo in this style: 'git tag -a curl-7_34_0'. -a annotates the
+ tag and we use underscores instead of dots in the version number.
+
+- run "./maketgz 7.34.0" to build the release tarballs. It is important that
+ you run this on a machine with the correct set of autotools etc installed
+ as this is what then will be shipped and used by most users on *nix like
+ systems.
+
+- push the git commits and the new tag
+
+- gpg sign the 4 tarballs as maketgz suggests
+
+- upload the 8 resulting files to the primary download directory
+
+[data in the curl-www repo]
+
+- edit Makefile (version number and date),
+ _newslog.html (announce the new release) and
+ _changes.html (insert changes+bugfixes from RELEASE-NOTES)
+
+- commit all local changes
+
+- tag the repo with the same tag as used for the source repo
+
+- make sure all relevant changes are committed and pushed on the master branch
+
+ (the web site then updates its contents automatically)
+
+[inform]
+
+- send an email to curl-users, curl-announce and curl-library. Insert the
+ RELEASE-NOTES into the mail.
+
+[celebrate]
+
+- suitable beverage intake is encouraged for the festivities
diff --git a/docs/TODO b/docs/TODO
index bec3abca..c87c4f8b 100644
--- a/docs/TODO
+++ b/docs/TODO
@@ -17,6 +17,8 @@
1.4 signal-based resolver timeouts
1.5 get rid of PATH_MAX
1.6 Modified buffer size approach
+ 1.7 Detect when called from witin callbacks
+ 1.8 Allow SSL (HTTPS) to proxy
2. libcurl - multi interface
2.1 More non-blocking
@@ -30,8 +32,7 @@
4.2 Alter passive/active on failure and retry
4.3 Earlier bad letter detection
4.4 REST for large files
- 4.5 FTP proxy support
- 4.6 ASCII support
+ 4.5 ASCII support
5. HTTP
5.1 Better persistency for HTTP 1.0
@@ -70,9 +71,8 @@
12.4 Cache OpenSSL contexts
12.5 Export session ids
12.6 Provide callback for cert verification
- 12.7 Support other SSL libraries
- 12.8 improve configure --with-ssl
- 12.9 Support DANE
+ 12.7 improve configure --with-ssl
+ 12.8 Support DANE
13. GnuTLS
13.1 SSL engine stuff
@@ -175,6 +175,18 @@
Dynamically allocate buffer size depending on protocol in use in combination
with freeing it after each individual transfer? Other suggestions?
+1.7 Detect when called from witin callbacks
+
+ We should set a state variable before calling callbacks, so that we
+ subsequently can add code within libcurl that returns error if called within
+ callbacks for when that's not supported.
+
+1.8 Allow SSL (HTTPS) to proxy
+
+ To prevent local users from snooping on your traffic to the proxy. Supported
+ by Chrome already:
+ http://www.chromium.org/developers/design-documents/secure-web-proxy
+
2. libcurl - multi interface
@@ -231,13 +243,7 @@
the server doesn't set the pointer to the requested index. The tricky
(impossible?) part is to figure out if the server did the right thing or not.
-4.5 FTP proxy support
-
- Support the most common FTP proxies, Philip Newton provided a list allegedly
- from ncftp. This is not a subject without debate, and is probably not really
- suitable for libcurl. http://curl.haxx.se/mail/archive-2003-04/0126.html
-
-4.6 ASCII support
+4.5 ASCII support
FTP ASCII transfers do not follow RFC959. They don't convert the data
accordingly.
@@ -409,17 +415,12 @@ to provide the data to send.
certificate, but this doesn't seem to be exposed in the libcurl APIs. Could
it be? There's so much that could be done if it were!
-12.7 Support other SSL libraries
-
- Make curl's SSL layer capable of using other free SSL libraries. Such as
- MatrixSSL (http://www.matrixssl.org/).
-
-12.8 improve configure --with-ssl
+12.7 improve configure --with-ssl
make the configure --with-ssl option first check for OpenSSL, then GnuTLS,
then NSS...
-12.9 Support DANE
+12.8 Support DANE
DNS-Based Authentication of Named Entities (DANE) is a way to provide SSL
keys and certs over DNS using DNSSEC as an alternative to the CA model.
diff --git a/docs/TheArtOfHttpScripting b/docs/TheArtOfHttpScripting
index b0dab5ff..27462a57 100644
--- a/docs/TheArtOfHttpScripting
+++ b/docs/TheArtOfHttpScripting
@@ -1,16 +1,72 @@
-Online: http://curl.haxx.se/docs/httpscripting.html
-Date: Jan 19, 2011
-
- The Art Of Scripting HTTP Requests Using Curl
- =============================================
-
- This document will assume that you're familiar with HTML and general
- networking.
-
- The possibility to write scripts is essential to make a good computer
- system. Unix' capability to be extended by shell scripts and various tools to
- run various automated commands and scripts is one reason why it has succeeded
- so well.
+Updated: Dec 24, 2013 (http://curl.haxx.se/docs/httpscripting.html)
+ _ _ ____ _
+ ___| | | | _ \| |
+ / __| | | | |_) | |
+ | (__| |_| | _ <| |___
+ \___|\___/|_| \_\_____|
+
+
+The Art Of Scripting HTTP Requests Using Curl
+
+ 1. HTTP Scripting
+ 1.1 Background
+ 1.2 The HTTP Protocol
+ 1.3 See the Protocol
+ 1.4 See the Timing
+ 1.5 See the Response
+ 2. URL
+ 2.1 Spec
+ 2.2 Host
+ 2.3 Port number
+ 2.4 User name and password
+ 2.5 Path part
+ 3. Fetch a page
+ 3.1 GET
+ 3.2 HEAD
+ 4. HTML forms
+ 4.1 Forms explained
+ 4.2 GET
+ 4.3 POST
+ 4.4 File Upload POST
+ 4.5 Hidden Fields
+ 4.6 Figure Out What A POST Looks Like
+ 5. HTTP upload
+ 5.1 PUT
+ 6. HTTP Authentication
+ 6.1 Basic Authentication
+ 6.2 Other Authentication
+ 6.3 Proxy Authentication
+ 6.4 Hiding credentials
+ 7. More HTTP Headers
+ 7.1 Referer
+ 7.2 User Agent
+ 8. Redirects
+ 8.1 Location header
+ 8.2 Other redirects
+ 9. Cookies
+ 9.1 Cookie Basics
+ 9.2 Cookie options
+ 10. HTTPS
+ 10.1 HTTPS is HTTP secure
+ 10.2 Certificates
+ 11. Custom Request Elements
+ 11.1 Modify method and headers
+ 11.2 More on changed methods
+ 12. Web Login
+ 12.1 Some login tricks
+ 13. Debug
+ 13.1 Some debug tricks
+ 14. References
+ 14.1 Standards
+ 14.2 Sites
+
+==============================================================================
+
+1. HTTP Scripting
+
+ 1.1 Background
+
+ This document assumes that you're familiar with HTML and general networking.
The increasing amount of applications moving to the web has made "HTTP
Scripting" more frequently requested and wanted. To be able to automatically
@@ -27,7 +83,7 @@ Date: Jan 19, 2011
to glue everything together using some kind of script language or repeated
manual invokes.
-1. The HTTP Protocol
+ 1.2 The HTTP Protocol
HTTP is the protocol used to fetch data from web servers. It is a very simple
protocol that is built upon TCP/IP. The protocol also allows information to
@@ -44,7 +100,7 @@ Date: Jan 19, 2011
well), response headers and most often also a response body. The "body" part
is the plain data you requested, like the actual HTML or the image etc.
- 1.1 See the Protocol
+ 1.3 See the Protocol
Using curl's option --verbose (-v as a short option) will display what kind
of commands curl sends to the server, as well as a few other informational
@@ -59,13 +115,88 @@ Date: Jan 19, 2011
curl --trace-ascii debugdump.txt http://www.example.com/
+ 1.4 See the Timing
+
+ Many times you may wonder what exactly is taking all the time, or you just
+ want to know the amount of milliseconds between two points in a
+ transfer. For those, and other similar situations, the --trace-time option
+ is what you need. It'll prepend the time to each trace output line:
+
+ curl --trace-ascii d.txt --trace-time http://example.com/
+
+ 1.5 See the Response
+
+ By default curl sends the response to stdout. You need to redirect it
+ somewhere to avoid that, most often that is done with -o or -O.
+
2. URL
+ 2.1 Spec
+
The Uniform Resource Locator format is how you specify the address of a
particular resource on the Internet. You know these, you've seen URLs like
- http://curl.haxx.se or https://yourbank.com a million times.
+ http://curl.haxx.se or https://yourbank.com a million times. RFC 3986 is the
+ canonical spec.
+
+ 2.2 Host
+
+ The host name is usually resolved using DNS or your /etc/hosts file to an IP
+ address and that's what curl will communicate with. Alternatively you specify
+ the IP address directly in the URL instead of a name.
+
+ For development and other trying out situation, you can point out a different
+ IP address for a host name than what would otherwise be used, by using curl's
+ --resolve option:
+
+ curl --resolve www.example.org:80:127.0.0.1 http://www.example.org/
+
+ 2.3 Port number
+
+ Each protocol curl supports operate on a default port number, be it over TCP
+ or in some cases UDP. Normally you don't have to take that into
+ consideration, but at times you run test servers on other ports or
+ similar. Then you can specify the port number in the URL with a colon and a
+ number immediately following the host name. Like when doing HTTP to port
+ 1234:
+
+ curl http://www.example.org:1234/
+
+ The port number you specify in the URL is the number that the server uses to
+ offer its services. Sometimes you may use a local proxy, and then you may
+ need to specify that proxy's port number separate on what curl needs to
+ connect to locally. Like when using a HTTP proxy on port 4321:
+
+ curl --proxy http://proxy.example.org:4321 http://remote.example.org/
+
+ 2.4 User name and password
+
+ Some services are setup to require HTTP authentication and then you need to
+ provide name and password which then is transfered to the remote site in
+ various ways depending on the exact authentication protocol used.
+
+ You can opt to either insert the user and password in the URL or you can
+ provide them separately:
+
+ curl http://user:password@example.org/
+
+ or
+
+ curl -u user:password http://example.org/
+
+ You need to pay attention that this kind of HTTP authentication is not what
+ is usually done and requested by user-oriented web sites these days. They
+ tend to use forms and cookies instead.
+
+ 2.5 Path part
+
+ The path part is just sent off to the server to request that it sends back
+ the associated response. The path is what is to the right side of the slash
+ that follows the host name and possibly port number.
+
-3. GET a page
+3. Fetch a page
+
+ 3.1 GET
The simplest and most common request/operation made using HTTP is to get a
URL. The URL could itself refer to a web page, an image or a file. The client
@@ -79,10 +210,23 @@ Date: Jan 19, 2011
All HTTP replies contain a set of response headers that are normally hidden,
use curl's --include (-i) option to display them as well as the rest of the
- document. You can also ask the remote server for ONLY the headers by using
- the --head (-I) option (which will make curl issue a HEAD request).
+ document.
+
+ 3.2 HEAD
+
+ You can ask the remote server for ONLY the headers by using the --head (-I)
+ option which will make curl issue a HEAD request. In some special cases
+ servers deny the HEAD method while others still work, which is a particular
+ kind of annoyance.
+
+ The HEAD method is defined and made so that the server returns the headers
+ exactly the way it would do for a GET, but without a body. It means that you
+ may see a Content-Length: in the response headers, but there must not be an
+ actual body in the HEAD response.
-4. Forms
+4. HTML forms
+
+ 4.1 Forms explained
Forms are the general way a web site can present a HTML page with fields for
the user to enter data in, and then press some kind of 'OK' or 'submit'
@@ -95,7 +239,7 @@ Date: Jan 19, 2011
Of course there has to be some kind of program in the server end to receive
the data you send. You cannot just invent something out of the air.
- 4.1 GET
+ 4.2 GET
A GET-form uses the method GET, as specified in HTML like:
@@ -121,7 +265,7 @@ Date: Jan 19, 2011
curl "http://www.hotmail.com/when/junk.cgi?birthyear=1905&press=OK"
- 4.2 POST
+ 4.3 POST
The GET method makes all input field names get displayed in the URL field of
your browser. That's generally a good thing when you want to be able to
@@ -158,7 +302,7 @@ Date: Jan 19, 2011
curl --data-urlencode "name=I am Daniel" http://www.example.com
- 4.3 File Upload POST
+ 4.4 File Upload POST
Back in late 1995 they defined an additional way to post data over HTTP. It
is documented in the RFC 1867, why this method sometimes is referred to as
@@ -179,7 +323,7 @@ Date: Jan 19, 2011
curl --form upload=@localfilename --form press=OK [URL]
- 4.4 Hidden Fields
+ 4.5 Hidden Fields
A very common way for HTML based application to pass state information
between pages is to add hidden fields to the forms. Hidden fields are
@@ -200,7 +344,7 @@ Date: Jan 19, 2011
curl --data "birthyear=1905&press=OK&person=daniel" [URL]
- 4.5 Figure Out What A POST Looks Like
+ 4.6 Figure Out What A POST Looks Like
When you're about fill in a form and send to a server by using curl instead
of a browser, you're of course very interested in sending a POST exactly the
@@ -213,7 +357,9 @@ Date: Jan 19, 2011
You will then clearly see the data get appended to the URL, separated with a
'?'-letter as GET forms are supposed to.
-5. PUT
+5. HTTP upload
+
+ 5.1 PUT
The perhaps best way to upload data to a HTTP server is to use PUT. Then
again, this of course requires that someone put a program or script on the
@@ -225,6 +371,8 @@ Date: Jan 19, 2011
6. HTTP Authentication
+ 6.1 Basic Authentication
+
HTTP Authentication is the ability to tell the server your username and
password so that it can verify that you're allowed to do the request you're
doing. The Basic authentication used in HTTP (which is the type curl uses by
@@ -236,10 +384,14 @@ Date: Jan 19, 2011
curl --user name:password http://www.example.com
+ 6.2 Other Authentication
+
The site might require a different authentication method (check the headers
returned by the server), and then --ntlm, --digest, --negotiate or even
--anyauth might be options that suit you.
+ 6.3 Proxy Authentication
+
Sometimes your HTTP access is only available through the use of a HTTP
proxy. This seems to be especially common at various companies. A HTTP proxy
may require its own user and password to allow the client to get through to
@@ -253,6 +405,8 @@ Date: Jan 19, 2011
If you use any one these user+password options but leave out the password
part, curl will prompt for the password interactively.
+ 6.4 Hiding credentials
+
Do note that when a program is run, its parameters might be possible to see
when listing the running processes of the system. Thus, other users may be
able to watch your passwords if you pass them as plain command line
@@ -262,7 +416,9 @@ Date: Jan 19, 2011
many web sites will not use this concept when they provide logins etc. See
the Web Login chapter further below for more details on that.
-7. Referer
+7. More HTTP Headers
+
+ 7.1 Referer
A HTTP request may include a 'referer' field (yes it is misspelled), which
can be used to tell from which URL the client got to this particular
@@ -276,7 +432,7 @@ Date: Jan 19, 2011
curl --referer http://www.example.come http://www.example.com
-8. User Agent
+ 7.2 User Agent
Very similar to the referer field, all HTTP requests may set the User-Agent
field. It names what user agent (client) that is being used. Many
@@ -298,7 +454,9 @@ Date: Jan 19, 2011
curl --user-agent "Mozilla/4.73 [en] (X11; U; Linux 2.2.15 i686)" [URL]
-9. Redirects
+8. Redirects
+
+ 8.1 Location header
When a resource is requested from a server, the reply from the server may
include a hint about where the browser should go next to find this page, or a
@@ -318,7 +476,16 @@ Date: Jan 19, 2011
only use POST in the first request, and then revert to GET in the following
operations.
-10. Cookies
+ 8.2 Other redirects
+
+ Browser typically support at least two other ways of redirects that curl
+ doesn't: first the html may contain a meta refresh tag that asks the browser
+ to load a specific URL after a set number of seconds, or it may use
+ javascript to do it.
+
+9. Cookies
+
+ 9.1 Cookie Basics
The way the web browsers do "client side state control" is by using
cookies. Cookies are just names with associated contents. The cookies are
@@ -335,6 +502,8 @@ Date: Jan 19, 2011
must be able to record and send back cookies the way the web application
expects them. The same way browsers deal with them.
+ 9.2 Cookie options
+
The simplest way to send a few cookies to the server when getting a page with
curl is to add them on the command line like:
@@ -366,16 +535,18 @@ Date: Jan 19, 2011
curl --cookie nada --location http://www.example.com
Curl has the ability to read and write cookie files that use the same file
- format that Netscape and Mozilla do. It is a convenient way to share cookies
- between browsers and automatic scripts. The --cookie (-b) switch
- automatically detects if a given file is such a cookie file and parses it,
- and by using the --cookie-jar (-c) option you'll make curl write a new cookie
- file at the end of an operation:
+ format that Netscape and Mozilla once used. It is a convenient way to share
+ cookies between scripts or invokes. The --cookie (-b) switch automatically
+ detects if a given file is such a cookie file and parses it, and by using the
+ --cookie-jar (-c) option you'll make curl write a new cookie file at the end
+ of an operation:
curl --cookie cookies.txt --cookie-jar newcookies.txt \
http://www.example.com
-11. HTTPS
+10. HTTPS
+
+ 10.1 HTTPS is HTTP secure
There are a few ways to do secure HTTP transfers. The by far most common
protocol for doing this is what is generally known as HTTPS, HTTP over
@@ -391,7 +562,7 @@ Date: Jan 19, 2011
curl https://secure.example.com
- 11.1 Certificates
+ 10.2 Certificates
In the HTTPS world, you use certificates to validate that you are the one
you claim to be, as an addition to normal passwords. Curl supports client-
@@ -413,7 +584,9 @@ Date: Jan 19, 2011
http://curl.haxx.se/docs/sslcerts.html
-12. Custom Request Elements
+11. Custom Request Elements
+
+11.1 Modify method and headers
Doing fancy stuff, you may need to add or change elements of a single curl
request.
@@ -434,7 +607,26 @@ Date: Jan 19, 2011
curl --header "Destination: http://nowhere" http://example.com
-13. Web Login
+ 11.2 More on changed methods
+
+ It should be noted that curl selects which methods to use on its own
+ depending on what action to ask for. -d will do POST, -I will do HEAD and so
+ on. If you use the --request / -X option you can change the method keyword
+ curl selects, but you will not modify curl's behavior. This means that if you
+ for example use -d "data" to do a POST, you can modify the method to a
+ PROPFIND with -X and curl will still think it sends a POST. You can change
+ the normal GET to a POST method by simply adding -X POST in a command line
+ like:
+
+ curl -X POST http://example.org/
+
+ ... but curl will still think and act as if it sent a GET so it won't send any
+ request body etc.
+
+
+12. Web Login
+
+ 12.1 Some login tricks
While not strictly just HTTP related, it still cause a lot of people problems
so here's the executive run-down of how the vast majority of all login forms
@@ -463,7 +655,9 @@ Date: Jan 19, 2011
to do a proper login POST. Remember that the contents need to be URL encoded
when sent in a normal POST.
-14. Debug
+13. Debug
+
+ 13.1 Some debug tricks
Many times when you run curl on a site, you'll notice that the site doesn't
seem to respond the same way to your curl requests as it does to your
@@ -473,35 +667,40 @@ Date: Jan 19, 2011
browser's requests:
* Use the --trace-ascii option to store fully detailed logs of the requests
- for easier analyzing and better understanding
+ for easier analyzing and better understanding
* Make sure you check for and use cookies when needed (both reading with
- --cookie and writing with --cookie-jar)
+ --cookie and writing with --cookie-jar)
* Set user-agent to one like a recent popular browser does
* Set referer like it is set by the browser
* If you use POST, make sure you send all the fields and in the same order as
- the browser does it. (See chapter 4.5 above)
+ the browser does it.
A very good helper to make sure you do this right, is the LiveHTTPHeader tool
that lets you view all headers you send and receive with Mozilla/Firefox
- (even when using HTTPS).
+ (even when using HTTPS). Chrome features similar functionality out of the box
+ among the developer's tools.
A more raw approach is to capture the HTTP traffic on the network with tools
such as ethereal or tcpdump and check what headers that were sent and
received by the browser. (HTTPS makes this technique inefficient.)
-15. References
+14. References
+
+ 14.1 Standards
RFC 2616 is a must to read if you want in-depth understanding of the HTTP
- protocol.
+ protocol
+
+ RFC 3986 explains the URL syntax
- RFC 3986 explains the URL syntax.
+ RFC 1867 defines the HTTP post upload format
- RFC 2109 defines how cookies are supposed to work.
+ RFC 6525 defines how HTTP cookies work
- RFC 1867 defines the HTTP post upload format.
+ 14.2 Sites
http://curl.haxx.se is the home of the cURL project
diff --git a/docs/curl-config.pdf b/docs/curl-config.pdf
index b53930c8..e7c97b9c 100644
--- a/docs/curl-config.pdf
+++ b/docs/curl-config.pdf
Binary files differ
diff --git a/docs/curl.1 b/docs/curl.1
index 49194762..32ae92a8 100644
--- a/docs/curl.1
+++ b/docs/curl.1
@@ -287,11 +287,11 @@ data pieces specified will be merged together with a separating
chunk that looks like \&'name=daniel&skill=lousy'.
If you start the data with the letter @, the rest should be a file name to
-read the data from, or - if you want curl to read the data from stdin. The
-contents of the file must already be URL-encoded. Multiple files can also be
-specified. Posting data from a file named 'foobar' would thus be done with
-\fI--data\fP @foobar. When --data is told to read from a file like that,
-carriage returns and newlines will be stripped out.
+read the data from, or - if you want curl to read the data from
+stdin. Multiple files can also be specified. Posting data from a file
+named 'foobar' would thus be done with \fI--data\fP @foobar. When --data is
+told to read from a file like that, carriage returns and newlines will be
+stripped out.
.IP "-D, --dump-header <file>"
Write the protocol headers to the specified file.
diff --git a/docs/curl.html b/docs/curl.html
index 16d718f6..760fb063 100644
--- a/docs/curl.html
+++ b/docs/curl.html
@@ -139,7 +139,7 @@ p.roffit {
<p class="level1">(HTTP) Sends the specified data in a POST request to the HTTP server, in the same way that a browser does when a user has filled in an HTML form and presses the submit button. This will cause curl to pass the data to the server using the content-type application/x-www-form-urlencoded. Compare to <a class="emphasis" href="#-F">-F, --form</a>.
<p class="level1"><a class="emphasis" href="#-d">-d, --data</a> is the same as <a class="emphasis" href="#--data-ascii">--data-ascii</a>. To post data purely binary, you should instead use the <a class="emphasis" href="#--data-binary">--data-binary</a> option. To URL-encode the value of a form field you may use <a class="emphasis" href="#--data-urlencode">--data-urlencode</a>.
<p class="level1">If any of these options is used more than once on the same command line, the data pieces specified will be merged together with a separating &-symbol. Thus, using '-d name=daniel -d skill=lousy' would generate a post chunk that looks like 'name=daniel&skill=lousy'.
-<p class="level1">If you start the data with the letter @, the rest should be a file name to read the data from, or - if you want curl to read the data from stdin. The contents of the file must already be URL-encoded. Multiple files can also be specified. Posting data from a file named 'foobar' would thus be done with <span Class="emphasis">--data</span> @foobar. When --data is told to read from a file like that, carriage returns and newlines will be stripped out.
+<p class="level1">If you start the data with the letter @, the rest should be a file name to read the data from, or - if you want curl to read the data from stdin. Multiple files can also be specified. Posting data from a file named 'foobar' would thus be done with <span Class="emphasis">--data</span> @foobar. When --data is told to read from a file like that, carriage returns and newlines will be stripped out.
<p class="level0"><a name="-D"></a><span class="nroffip">-D, --dump-header &lt;file&gt;</span>
<p class="level1">Write the protocol headers to the specified file.
<p class="level1">This option is handy to use when you want to store the headers that an HTTP site sends to you. Cookies from the headers could then be read in a second curl invocation by using the <a class="emphasis" href="#-b">-b, --cookie</a> option! The <a class="emphasis" href="#-c">-c, --cookie-jar</a> option is however a better way to store cookies.
diff --git a/docs/curl.pdf b/docs/curl.pdf
index b55c204f..74399789 100644
--- a/docs/curl.pdf
+++ b/docs/curl.pdf
Binary files differ
diff --git a/docs/examples/Makefile.in b/docs/examples/Makefile.in
index 2fca8323..269ba4ba 100644
--- a/docs/examples/Makefile.in
+++ b/docs/examples/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.14 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
@@ -115,10 +115,18 @@ check_PROGRAMS = 10-at-a-time$(EXEEXT) anyauthput$(EXEEXT) \
simple$(EXEEXT) simplepost$(EXEEXT) simplessl$(EXEEXT) \
sendrecv$(EXEEXT) httpcustomheader$(EXEEXT) certinfo$(EXEEXT) \
chkspeed$(EXEEXT) ftpgetinfo$(EXEEXT) ftp-wildcard$(EXEEXT) \
- smtp-multi$(EXEEXT) simplesmtp$(EXEEXT) smtp-tls$(EXEEXT) \
+ smtp-mail$(EXEEXT) smtp-multi$(EXEEXT) smtp-ssl$(EXEEXT) \
+ smtp-tls$(EXEEXT) smtp-vrfy$(EXEEXT) smtp-expn$(EXEEXT) \
rtsp$(EXEEXT) externalsocket$(EXEEXT) resolve$(EXEEXT) \
- progressfunc$(EXEEXT) pop3s$(EXEEXT) pop3slist$(EXEEXT) \
- imap$(EXEEXT) url2file$(EXEEXT) sftpget$(EXEEXT) \
+ progressfunc$(EXEEXT) pop3-retr$(EXEEXT) pop3-list$(EXEEXT) \
+ pop3-uidl$(EXEEXT) pop3-dele$(EXEEXT) pop3-top$(EXEEXT) \
+ pop3-stat$(EXEEXT) pop3-noop$(EXEEXT) pop3-ssl$(EXEEXT) \
+ pop3-tls$(EXEEXT) pop3-multi$(EXEEXT) imap-list$(EXEEXT) \
+ imap-fetch$(EXEEXT) imap-store$(EXEEXT) imap-append$(EXEEXT) \
+ imap-examine$(EXEEXT) imap-search$(EXEEXT) \
+ imap-create$(EXEEXT) imap-delete$(EXEEXT) imap-copy$(EXEEXT) \
+ imap-noop$(EXEEXT) imap-ssl$(EXEEXT) imap-tls$(EXEEXT) \
+ imap-multi$(EXEEXT) url2file$(EXEEXT) sftpget$(EXEEXT) \
ftpsget$(EXEEXT) postinmemory$(EXEEXT)
subdir = docs/examples
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
@@ -294,11 +302,97 @@ https_LDADD = $(LDADD)
@USE_EXPLICIT_LIB_DEPS_FALSE@https_DEPENDENCIES = \
@USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la
@USE_EXPLICIT_LIB_DEPS_TRUE@https_DEPENDENCIES = $(LIBDIR)/libcurl.la
-imap_SOURCES = imap.c
-imap_OBJECTS = imap.$(OBJEXT)
-imap_LDADD = $(LDADD)
-@USE_EXPLICIT_LIB_DEPS_FALSE@imap_DEPENDENCIES = $(LIBDIR)/libcurl.la
-@USE_EXPLICIT_LIB_DEPS_TRUE@imap_DEPENDENCIES = $(LIBDIR)/libcurl.la
+imap_append_SOURCES = imap-append.c
+imap_append_OBJECTS = imap-append.$(OBJEXT)
+imap_append_LDADD = $(LDADD)
+@USE_EXPLICIT_LIB_DEPS_FALSE@imap_append_DEPENDENCIES = \
+@USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la
+@USE_EXPLICIT_LIB_DEPS_TRUE@imap_append_DEPENDENCIES = \
+@USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la
+imap_copy_SOURCES = imap-copy.c
+imap_copy_OBJECTS = imap-copy.$(OBJEXT)
+imap_copy_LDADD = $(LDADD)
+@USE_EXPLICIT_LIB_DEPS_FALSE@imap_copy_DEPENDENCIES = \
+@USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la
+@USE_EXPLICIT_LIB_DEPS_TRUE@imap_copy_DEPENDENCIES = \
+@USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la
+imap_create_SOURCES = imap-create.c
+imap_create_OBJECTS = imap-create.$(OBJEXT)
+imap_create_LDADD = $(LDADD)
+@USE_EXPLICIT_LIB_DEPS_FALSE@imap_create_DEPENDENCIES = \
+@USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la
+@USE_EXPLICIT_LIB_DEPS_TRUE@imap_create_DEPENDENCIES = \
+@USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la
+imap_delete_SOURCES = imap-delete.c
+imap_delete_OBJECTS = imap-delete.$(OBJEXT)
+imap_delete_LDADD = $(LDADD)
+@USE_EXPLICIT_LIB_DEPS_FALSE@imap_delete_DEPENDENCIES = \
+@USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la
+@USE_EXPLICIT_LIB_DEPS_TRUE@imap_delete_DEPENDENCIES = \
+@USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la
+imap_examine_SOURCES = imap-examine.c
+imap_examine_OBJECTS = imap-examine.$(OBJEXT)
+imap_examine_LDADD = $(LDADD)
+@USE_EXPLICIT_LIB_DEPS_FALSE@imap_examine_DEPENDENCIES = \
+@USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la
+@USE_EXPLICIT_LIB_DEPS_TRUE@imap_examine_DEPENDENCIES = \
+@USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la
+imap_fetch_SOURCES = imap-fetch.c
+imap_fetch_OBJECTS = imap-fetch.$(OBJEXT)
+imap_fetch_LDADD = $(LDADD)
+@USE_EXPLICIT_LIB_DEPS_FALSE@imap_fetch_DEPENDENCIES = \
+@USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la
+@USE_EXPLICIT_LIB_DEPS_TRUE@imap_fetch_DEPENDENCIES = \
+@USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la
+imap_list_SOURCES = imap-list.c
+imap_list_OBJECTS = imap-list.$(OBJEXT)
+imap_list_LDADD = $(LDADD)
+@USE_EXPLICIT_LIB_DEPS_FALSE@imap_list_DEPENDENCIES = \
+@USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la
+@USE_EXPLICIT_LIB_DEPS_TRUE@imap_list_DEPENDENCIES = \
+@USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la
+imap_multi_SOURCES = imap-multi.c
+imap_multi_OBJECTS = imap-multi.$(OBJEXT)
+imap_multi_LDADD = $(LDADD)
+@USE_EXPLICIT_LIB_DEPS_FALSE@imap_multi_DEPENDENCIES = \
+@USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la
+@USE_EXPLICIT_LIB_DEPS_TRUE@imap_multi_DEPENDENCIES = \
+@USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la
+imap_noop_SOURCES = imap-noop.c
+imap_noop_OBJECTS = imap-noop.$(OBJEXT)
+imap_noop_LDADD = $(LDADD)
+@USE_EXPLICIT_LIB_DEPS_FALSE@imap_noop_DEPENDENCIES = \
+@USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la
+@USE_EXPLICIT_LIB_DEPS_TRUE@imap_noop_DEPENDENCIES = \
+@USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la
+imap_search_SOURCES = imap-search.c
+imap_search_OBJECTS = imap-search.$(OBJEXT)
+imap_search_LDADD = $(LDADD)
+@USE_EXPLICIT_LIB_DEPS_FALSE@imap_search_DEPENDENCIES = \
+@USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la
+@USE_EXPLICIT_LIB_DEPS_TRUE@imap_search_DEPENDENCIES = \
+@USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la
+imap_ssl_SOURCES = imap-ssl.c
+imap_ssl_OBJECTS = imap-ssl.$(OBJEXT)
+imap_ssl_LDADD = $(LDADD)
+@USE_EXPLICIT_LIB_DEPS_FALSE@imap_ssl_DEPENDENCIES = \
+@USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la
+@USE_EXPLICIT_LIB_DEPS_TRUE@imap_ssl_DEPENDENCIES = \
+@USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la
+imap_store_SOURCES = imap-store.c
+imap_store_OBJECTS = imap-store.$(OBJEXT)
+imap_store_LDADD = $(LDADD)
+@USE_EXPLICIT_LIB_DEPS_FALSE@imap_store_DEPENDENCIES = \
+@USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la
+@USE_EXPLICIT_LIB_DEPS_TRUE@imap_store_DEPENDENCIES = \
+@USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la
+imap_tls_SOURCES = imap-tls.c
+imap_tls_OBJECTS = imap-tls.$(OBJEXT)
+imap_tls_LDADD = $(LDADD)
+@USE_EXPLICIT_LIB_DEPS_FALSE@imap_tls_DEPENDENCIES = \
+@USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la
+@USE_EXPLICIT_LIB_DEPS_TRUE@imap_tls_DEPENDENCIES = \
+@USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la
multi_app_SOURCES = multi-app.c
multi_app_OBJECTS = multi-app.$(OBJEXT)
multi_app_LDADD = $(LDADD)
@@ -341,18 +435,75 @@ persistant_LDADD = $(LDADD)
@USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la
@USE_EXPLICIT_LIB_DEPS_TRUE@persistant_DEPENDENCIES = \
@USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la
-pop3s_SOURCES = pop3s.c
-pop3s_OBJECTS = pop3s.$(OBJEXT)
-pop3s_LDADD = $(LDADD)
-@USE_EXPLICIT_LIB_DEPS_FALSE@pop3s_DEPENDENCIES = \
+pop3_dele_SOURCES = pop3-dele.c
+pop3_dele_OBJECTS = pop3-dele.$(OBJEXT)
+pop3_dele_LDADD = $(LDADD)
+@USE_EXPLICIT_LIB_DEPS_FALSE@pop3_dele_DEPENDENCIES = \
+@USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la
+@USE_EXPLICIT_LIB_DEPS_TRUE@pop3_dele_DEPENDENCIES = \
+@USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la
+pop3_list_SOURCES = pop3-list.c
+pop3_list_OBJECTS = pop3-list.$(OBJEXT)
+pop3_list_LDADD = $(LDADD)
+@USE_EXPLICIT_LIB_DEPS_FALSE@pop3_list_DEPENDENCIES = \
+@USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la
+@USE_EXPLICIT_LIB_DEPS_TRUE@pop3_list_DEPENDENCIES = \
+@USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la
+pop3_multi_SOURCES = pop3-multi.c
+pop3_multi_OBJECTS = pop3-multi.$(OBJEXT)
+pop3_multi_LDADD = $(LDADD)
+@USE_EXPLICIT_LIB_DEPS_FALSE@pop3_multi_DEPENDENCIES = \
+@USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la
+@USE_EXPLICIT_LIB_DEPS_TRUE@pop3_multi_DEPENDENCIES = \
+@USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la
+pop3_noop_SOURCES = pop3-noop.c
+pop3_noop_OBJECTS = pop3-noop.$(OBJEXT)
+pop3_noop_LDADD = $(LDADD)
+@USE_EXPLICIT_LIB_DEPS_FALSE@pop3_noop_DEPENDENCIES = \
+@USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la
+@USE_EXPLICIT_LIB_DEPS_TRUE@pop3_noop_DEPENDENCIES = \
+@USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la
+pop3_retr_SOURCES = pop3-retr.c
+pop3_retr_OBJECTS = pop3-retr.$(OBJEXT)
+pop3_retr_LDADD = $(LDADD)
+@USE_EXPLICIT_LIB_DEPS_FALSE@pop3_retr_DEPENDENCIES = \
+@USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la
+@USE_EXPLICIT_LIB_DEPS_TRUE@pop3_retr_DEPENDENCIES = \
+@USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la
+pop3_ssl_SOURCES = pop3-ssl.c
+pop3_ssl_OBJECTS = pop3-ssl.$(OBJEXT)
+pop3_ssl_LDADD = $(LDADD)
+@USE_EXPLICIT_LIB_DEPS_FALSE@pop3_ssl_DEPENDENCIES = \
+@USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la
+@USE_EXPLICIT_LIB_DEPS_TRUE@pop3_ssl_DEPENDENCIES = \
+@USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la
+pop3_stat_SOURCES = pop3-stat.c
+pop3_stat_OBJECTS = pop3-stat.$(OBJEXT)
+pop3_stat_LDADD = $(LDADD)
+@USE_EXPLICIT_LIB_DEPS_FALSE@pop3_stat_DEPENDENCIES = \
+@USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la
+@USE_EXPLICIT_LIB_DEPS_TRUE@pop3_stat_DEPENDENCIES = \
+@USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la
+pop3_tls_SOURCES = pop3-tls.c
+pop3_tls_OBJECTS = pop3-tls.$(OBJEXT)
+pop3_tls_LDADD = $(LDADD)
+@USE_EXPLICIT_LIB_DEPS_FALSE@pop3_tls_DEPENDENCIES = \
@USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la
-@USE_EXPLICIT_LIB_DEPS_TRUE@pop3s_DEPENDENCIES = $(LIBDIR)/libcurl.la
-pop3slist_SOURCES = pop3slist.c
-pop3slist_OBJECTS = pop3slist.$(OBJEXT)
-pop3slist_LDADD = $(LDADD)
-@USE_EXPLICIT_LIB_DEPS_FALSE@pop3slist_DEPENDENCIES = \
+@USE_EXPLICIT_LIB_DEPS_TRUE@pop3_tls_DEPENDENCIES = \
+@USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la
+pop3_top_SOURCES = pop3-top.c
+pop3_top_OBJECTS = pop3-top.$(OBJEXT)
+pop3_top_LDADD = $(LDADD)
+@USE_EXPLICIT_LIB_DEPS_FALSE@pop3_top_DEPENDENCIES = \
@USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la
-@USE_EXPLICIT_LIB_DEPS_TRUE@pop3slist_DEPENDENCIES = \
+@USE_EXPLICIT_LIB_DEPS_TRUE@pop3_top_DEPENDENCIES = \
+@USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la
+pop3_uidl_SOURCES = pop3-uidl.c
+pop3_uidl_OBJECTS = pop3-uidl.$(OBJEXT)
+pop3_uidl_LDADD = $(LDADD)
+@USE_EXPLICIT_LIB_DEPS_FALSE@pop3_uidl_DEPENDENCIES = \
+@USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la
+@USE_EXPLICIT_LIB_DEPS_TRUE@pop3_uidl_DEPENDENCIES = \
@USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la
post_callback_SOURCES = post-callback.c
post_callback_OBJECTS = post-callback.$(OBJEXT)
@@ -429,13 +580,6 @@ simplepost_LDADD = $(LDADD)
@USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la
@USE_EXPLICIT_LIB_DEPS_TRUE@simplepost_DEPENDENCIES = \
@USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la
-simplesmtp_SOURCES = simplesmtp.c
-simplesmtp_OBJECTS = simplesmtp.$(OBJEXT)
-simplesmtp_LDADD = $(LDADD)
-@USE_EXPLICIT_LIB_DEPS_FALSE@simplesmtp_DEPENDENCIES = \
-@USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la
-@USE_EXPLICIT_LIB_DEPS_TRUE@simplesmtp_DEPENDENCIES = \
-@USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la
simplessl_SOURCES = simplessl.c
simplessl_OBJECTS = simplessl.$(OBJEXT)
simplessl_LDADD = $(LDADD)
@@ -443,6 +587,20 @@ simplessl_LDADD = $(LDADD)
@USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la
@USE_EXPLICIT_LIB_DEPS_TRUE@simplessl_DEPENDENCIES = \
@USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la
+smtp_expn_SOURCES = smtp-expn.c
+smtp_expn_OBJECTS = smtp-expn.$(OBJEXT)
+smtp_expn_LDADD = $(LDADD)
+@USE_EXPLICIT_LIB_DEPS_FALSE@smtp_expn_DEPENDENCIES = \
+@USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la
+@USE_EXPLICIT_LIB_DEPS_TRUE@smtp_expn_DEPENDENCIES = \
+@USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la
+smtp_mail_SOURCES = smtp-mail.c
+smtp_mail_OBJECTS = smtp-mail.$(OBJEXT)
+smtp_mail_LDADD = $(LDADD)
+@USE_EXPLICIT_LIB_DEPS_FALSE@smtp_mail_DEPENDENCIES = \
+@USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la
+@USE_EXPLICIT_LIB_DEPS_TRUE@smtp_mail_DEPENDENCIES = \
+@USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la
smtp_multi_SOURCES = smtp-multi.c
smtp_multi_OBJECTS = smtp-multi.$(OBJEXT)
smtp_multi_LDADD = $(LDADD)
@@ -450,6 +608,13 @@ smtp_multi_LDADD = $(LDADD)
@USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la
@USE_EXPLICIT_LIB_DEPS_TRUE@smtp_multi_DEPENDENCIES = \
@USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la
+smtp_ssl_SOURCES = smtp-ssl.c
+smtp_ssl_OBJECTS = smtp-ssl.$(OBJEXT)
+smtp_ssl_LDADD = $(LDADD)
+@USE_EXPLICIT_LIB_DEPS_FALSE@smtp_ssl_DEPENDENCIES = \
+@USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la
+@USE_EXPLICIT_LIB_DEPS_TRUE@smtp_ssl_DEPENDENCIES = \
+@USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la
smtp_tls_SOURCES = smtp-tls.c
smtp_tls_OBJECTS = smtp-tls.$(OBJEXT)
smtp_tls_LDADD = $(LDADD)
@@ -457,6 +622,13 @@ smtp_tls_LDADD = $(LDADD)
@USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la
@USE_EXPLICIT_LIB_DEPS_TRUE@smtp_tls_DEPENDENCIES = \
@USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la
+smtp_vrfy_SOURCES = smtp-vrfy.c
+smtp_vrfy_OBJECTS = smtp-vrfy.$(OBJEXT)
+smtp_vrfy_LDADD = $(LDADD)
+@USE_EXPLICIT_LIB_DEPS_FALSE@smtp_vrfy_DEPENDENCIES = \
+@USE_EXPLICIT_LIB_DEPS_FALSE@ $(LIBDIR)/libcurl.la
+@USE_EXPLICIT_LIB_DEPS_TRUE@smtp_vrfy_DEPENDENCIES = \
+@USE_EXPLICIT_LIB_DEPS_TRUE@ $(LIBDIR)/libcurl.la
url2file_SOURCES = url2file.c
url2file_OBJECTS = url2file.$(OBJEXT)
url2file_LDADD = $(LDADD)
@@ -502,24 +674,32 @@ SOURCES = 10-at-a-time.c anyauthput.c certinfo.c chkspeed.c \
cookie_interface.c debug.c externalsocket.c fileupload.c \
fopen.c ftp-wildcard.c ftpget.c ftpgetinfo.c ftpgetresp.c \
ftpsget.c ftpupload.c getinfo.c getinmemory.c http-post.c \
- httpcustomheader.c httpput.c https.c imap.c multi-app.c \
- multi-debugcallback.c multi-double.c multi-post.c \
- multi-single.c persistant.c pop3s.c pop3slist.c \
+ httpcustomheader.c httpput.c https.c imap-append.c imap-copy.c \
+ imap-create.c imap-delete.c imap-examine.c imap-fetch.c \
+ imap-list.c imap-multi.c imap-noop.c imap-search.c imap-ssl.c \
+ imap-store.c imap-tls.c multi-app.c multi-debugcallback.c \
+ multi-double.c multi-post.c multi-single.c persistant.c \
+ pop3-dele.c pop3-list.c pop3-multi.c pop3-noop.c pop3-retr.c \
+ pop3-ssl.c pop3-stat.c pop3-tls.c pop3-top.c pop3-uidl.c \
post-callback.c postinmemory.c postit2.c progressfunc.c \
resolve.c rtsp.c sendrecv.c sepheaders.c sftpget.c simple.c \
- simplepost.c simplesmtp.c simplessl.c smtp-multi.c smtp-tls.c \
- url2file.c
+ simplepost.c simplessl.c smtp-expn.c smtp-mail.c smtp-multi.c \
+ smtp-ssl.c smtp-tls.c smtp-vrfy.c url2file.c
DIST_SOURCES = 10-at-a-time.c anyauthput.c certinfo.c chkspeed.c \
cookie_interface.c debug.c externalsocket.c fileupload.c \
fopen.c ftp-wildcard.c ftpget.c ftpgetinfo.c ftpgetresp.c \
ftpsget.c ftpupload.c getinfo.c getinmemory.c http-post.c \
- httpcustomheader.c httpput.c https.c imap.c multi-app.c \
- multi-debugcallback.c multi-double.c multi-post.c \
- multi-single.c persistant.c pop3s.c pop3slist.c \
+ httpcustomheader.c httpput.c https.c imap-append.c imap-copy.c \
+ imap-create.c imap-delete.c imap-examine.c imap-fetch.c \
+ imap-list.c imap-multi.c imap-noop.c imap-search.c imap-ssl.c \
+ imap-store.c imap-tls.c multi-app.c multi-debugcallback.c \
+ multi-double.c multi-post.c multi-single.c persistant.c \
+ pop3-dele.c pop3-list.c pop3-multi.c pop3-noop.c pop3-retr.c \
+ pop3-ssl.c pop3-stat.c pop3-tls.c pop3-top.c pop3-uidl.c \
post-callback.c postinmemory.c postit2.c progressfunc.c \
resolve.c rtsp.c sendrecv.c sepheaders.c sftpget.c simple.c \
- simplepost.c simplesmtp.c simplessl.c smtp-multi.c smtp-tls.c \
- url2file.c
+ simplepost.c simplessl.c smtp-expn.c smtp-mail.c smtp-multi.c \
+ smtp-ssl.c smtp-tls.c smtp-vrfy.c url2file.c
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
@@ -890,9 +1070,57 @@ https$(EXEEXT): $(https_OBJECTS) $(https_DEPENDENCIES) $(EXTRA_https_DEPENDENCIE
@rm -f https$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(https_OBJECTS) $(https_LDADD) $(LIBS)
-imap$(EXEEXT): $(imap_OBJECTS) $(imap_DEPENDENCIES) $(EXTRA_imap_DEPENDENCIES)
- @rm -f imap$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(imap_OBJECTS) $(imap_LDADD) $(LIBS)
+imap-append$(EXEEXT): $(imap_append_OBJECTS) $(imap_append_DEPENDENCIES) $(EXTRA_imap_append_DEPENDENCIES)
+ @rm -f imap-append$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(imap_append_OBJECTS) $(imap_append_LDADD) $(LIBS)
+
+imap-copy$(EXEEXT): $(imap_copy_OBJECTS) $(imap_copy_DEPENDENCIES) $(EXTRA_imap_copy_DEPENDENCIES)
+ @rm -f imap-copy$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(imap_copy_OBJECTS) $(imap_copy_LDADD) $(LIBS)
+
+imap-create$(EXEEXT): $(imap_create_OBJECTS) $(imap_create_DEPENDENCIES) $(EXTRA_imap_create_DEPENDENCIES)
+ @rm -f imap-create$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(imap_create_OBJECTS) $(imap_create_LDADD) $(LIBS)
+
+imap-delete$(EXEEXT): $(imap_delete_OBJECTS) $(imap_delete_DEPENDENCIES) $(EXTRA_imap_delete_DEPENDENCIES)
+ @rm -f imap-delete$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(imap_delete_OBJECTS) $(imap_delete_LDADD) $(LIBS)
+
+imap-examine$(EXEEXT): $(imap_examine_OBJECTS) $(imap_examine_DEPENDENCIES) $(EXTRA_imap_examine_DEPENDENCIES)
+ @rm -f imap-examine$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(imap_examine_OBJECTS) $(imap_examine_LDADD) $(LIBS)
+
+imap-fetch$(EXEEXT): $(imap_fetch_OBJECTS) $(imap_fetch_DEPENDENCIES) $(EXTRA_imap_fetch_DEPENDENCIES)
+ @rm -f imap-fetch$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(imap_fetch_OBJECTS) $(imap_fetch_LDADD) $(LIBS)
+
+imap-list$(EXEEXT): $(imap_list_OBJECTS) $(imap_list_DEPENDENCIES) $(EXTRA_imap_list_DEPENDENCIES)
+ @rm -f imap-list$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(imap_list_OBJECTS) $(imap_list_LDADD) $(LIBS)
+
+imap-multi$(EXEEXT): $(imap_multi_OBJECTS) $(imap_multi_DEPENDENCIES) $(EXTRA_imap_multi_DEPENDENCIES)
+ @rm -f imap-multi$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(imap_multi_OBJECTS) $(imap_multi_LDADD) $(LIBS)
+
+imap-noop$(EXEEXT): $(imap_noop_OBJECTS) $(imap_noop_DEPENDENCIES) $(EXTRA_imap_noop_DEPENDENCIES)
+ @rm -f imap-noop$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(imap_noop_OBJECTS) $(imap_noop_LDADD) $(LIBS)
+
+imap-search$(EXEEXT): $(imap_search_OBJECTS) $(imap_search_DEPENDENCIES) $(EXTRA_imap_search_DEPENDENCIES)
+ @rm -f imap-search$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(imap_search_OBJECTS) $(imap_search_LDADD) $(LIBS)
+
+imap-ssl$(EXEEXT): $(imap_ssl_OBJECTS) $(imap_ssl_DEPENDENCIES) $(EXTRA_imap_ssl_DEPENDENCIES)
+ @rm -f imap-ssl$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(imap_ssl_OBJECTS) $(imap_ssl_LDADD) $(LIBS)
+
+imap-store$(EXEEXT): $(imap_store_OBJECTS) $(imap_store_DEPENDENCIES) $(EXTRA_imap_store_DEPENDENCIES)
+ @rm -f imap-store$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(imap_store_OBJECTS) $(imap_store_LDADD) $(LIBS)
+
+imap-tls$(EXEEXT): $(imap_tls_OBJECTS) $(imap_tls_DEPENDENCIES) $(EXTRA_imap_tls_DEPENDENCIES)
+ @rm -f imap-tls$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(imap_tls_OBJECTS) $(imap_tls_LDADD) $(LIBS)
multi-app$(EXEEXT): $(multi_app_OBJECTS) $(multi_app_DEPENDENCIES) $(EXTRA_multi_app_DEPENDENCIES)
@rm -f multi-app$(EXEEXT)
@@ -918,13 +1146,45 @@ persistant$(EXEEXT): $(persistant_OBJECTS) $(persistant_DEPENDENCIES) $(EXTRA_pe
@rm -f persistant$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(persistant_OBJECTS) $(persistant_LDADD) $(LIBS)
-pop3s$(EXEEXT): $(pop3s_OBJECTS) $(pop3s_DEPENDENCIES) $(EXTRA_pop3s_DEPENDENCIES)
- @rm -f pop3s$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(pop3s_OBJECTS) $(pop3s_LDADD) $(LIBS)
+pop3-dele$(EXEEXT): $(pop3_dele_OBJECTS) $(pop3_dele_DEPENDENCIES) $(EXTRA_pop3_dele_DEPENDENCIES)
+ @rm -f pop3-dele$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(pop3_dele_OBJECTS) $(pop3_dele_LDADD) $(LIBS)
+
+pop3-list$(EXEEXT): $(pop3_list_OBJECTS) $(pop3_list_DEPENDENCIES) $(EXTRA_pop3_list_DEPENDENCIES)
+ @rm -f pop3-list$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(pop3_list_OBJECTS) $(pop3_list_LDADD) $(LIBS)
+
+pop3-multi$(EXEEXT): $(pop3_multi_OBJECTS) $(pop3_multi_DEPENDENCIES) $(EXTRA_pop3_multi_DEPENDENCIES)
+ @rm -f pop3-multi$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(pop3_multi_OBJECTS) $(pop3_multi_LDADD) $(LIBS)
+
+pop3-noop$(EXEEXT): $(pop3_noop_OBJECTS) $(pop3_noop_DEPENDENCIES) $(EXTRA_pop3_noop_DEPENDENCIES)
+ @rm -f pop3-noop$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(pop3_noop_OBJECTS) $(pop3_noop_LDADD) $(LIBS)
+
+pop3-retr$(EXEEXT): $(pop3_retr_OBJECTS) $(pop3_retr_DEPENDENCIES) $(EXTRA_pop3_retr_DEPENDENCIES)
+ @rm -f pop3-retr$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(pop3_retr_OBJECTS) $(pop3_retr_LDADD) $(LIBS)
-pop3slist$(EXEEXT): $(pop3slist_OBJECTS) $(pop3slist_DEPENDENCIES) $(EXTRA_pop3slist_DEPENDENCIES)
- @rm -f pop3slist$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(pop3slist_OBJECTS) $(pop3slist_LDADD) $(LIBS)
+pop3-ssl$(EXEEXT): $(pop3_ssl_OBJECTS) $(pop3_ssl_DEPENDENCIES) $(EXTRA_pop3_ssl_DEPENDENCIES)
+ @rm -f pop3-ssl$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(pop3_ssl_OBJECTS) $(pop3_ssl_LDADD) $(LIBS)
+
+pop3-stat$(EXEEXT): $(pop3_stat_OBJECTS) $(pop3_stat_DEPENDENCIES) $(EXTRA_pop3_stat_DEPENDENCIES)
+ @rm -f pop3-stat$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(pop3_stat_OBJECTS) $(pop3_stat_LDADD) $(LIBS)
+
+pop3-tls$(EXEEXT): $(pop3_tls_OBJECTS) $(pop3_tls_DEPENDENCIES) $(EXTRA_pop3_tls_DEPENDENCIES)
+ @rm -f pop3-tls$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(pop3_tls_OBJECTS) $(pop3_tls_LDADD) $(LIBS)
+
+pop3-top$(EXEEXT): $(pop3_top_OBJECTS) $(pop3_top_DEPENDENCIES) $(EXTRA_pop3_top_DEPENDENCIES)
+ @rm -f pop3-top$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(pop3_top_OBJECTS) $(pop3_top_LDADD) $(LIBS)
+
+pop3-uidl$(EXEEXT): $(pop3_uidl_OBJECTS) $(pop3_uidl_DEPENDENCIES) $(EXTRA_pop3_uidl_DEPENDENCIES)
+ @rm -f pop3-uidl$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(pop3_uidl_OBJECTS) $(pop3_uidl_LDADD) $(LIBS)
post-callback$(EXEEXT): $(post_callback_OBJECTS) $(post_callback_DEPENDENCIES) $(EXTRA_post_callback_DEPENDENCIES)
@rm -f post-callback$(EXEEXT)
@@ -970,22 +1230,34 @@ simplepost$(EXEEXT): $(simplepost_OBJECTS) $(simplepost_DEPENDENCIES) $(EXTRA_si
@rm -f simplepost$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(simplepost_OBJECTS) $(simplepost_LDADD) $(LIBS)
-simplesmtp$(EXEEXT): $(simplesmtp_OBJECTS) $(simplesmtp_DEPENDENCIES) $(EXTRA_simplesmtp_DEPENDENCIES)
- @rm -f simplesmtp$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(simplesmtp_OBJECTS) $(simplesmtp_LDADD) $(LIBS)
-
simplessl$(EXEEXT): $(simplessl_OBJECTS) $(simplessl_DEPENDENCIES) $(EXTRA_simplessl_DEPENDENCIES)
@rm -f simplessl$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(simplessl_OBJECTS) $(simplessl_LDADD) $(LIBS)
+smtp-expn$(EXEEXT): $(smtp_expn_OBJECTS) $(smtp_expn_DEPENDENCIES) $(EXTRA_smtp_expn_DEPENDENCIES)
+ @rm -f smtp-expn$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(smtp_expn_OBJECTS) $(smtp_expn_LDADD) $(LIBS)
+
+smtp-mail$(EXEEXT): $(smtp_mail_OBJECTS) $(smtp_mail_DEPENDENCIES) $(EXTRA_smtp_mail_DEPENDENCIES)
+ @rm -f smtp-mail$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(smtp_mail_OBJECTS) $(smtp_mail_LDADD) $(LIBS)
+
smtp-multi$(EXEEXT): $(smtp_multi_OBJECTS) $(smtp_multi_DEPENDENCIES) $(EXTRA_smtp_multi_DEPENDENCIES)
@rm -f smtp-multi$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(smtp_multi_OBJECTS) $(smtp_multi_LDADD) $(LIBS)
+smtp-ssl$(EXEEXT): $(smtp_ssl_OBJECTS) $(smtp_ssl_DEPENDENCIES) $(EXTRA_smtp_ssl_DEPENDENCIES)
+ @rm -f smtp-ssl$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(smtp_ssl_OBJECTS) $(smtp_ssl_LDADD) $(LIBS)
+
smtp-tls$(EXEEXT): $(smtp_tls_OBJECTS) $(smtp_tls_DEPENDENCIES) $(EXTRA_smtp_tls_DEPENDENCIES)
@rm -f smtp-tls$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(smtp_tls_OBJECTS) $(smtp_tls_LDADD) $(LIBS)
+smtp-vrfy$(EXEEXT): $(smtp_vrfy_OBJECTS) $(smtp_vrfy_DEPENDENCIES) $(EXTRA_smtp_vrfy_DEPENDENCIES)
+ @rm -f smtp-vrfy$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(smtp_vrfy_OBJECTS) $(smtp_vrfy_LDADD) $(LIBS)
+
url2file$(EXEEXT): $(url2file_OBJECTS) $(url2file_DEPENDENCIES) $(EXTRA_url2file_DEPENDENCIES)
@rm -f url2file$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(url2file_OBJECTS) $(url2file_LDADD) $(LIBS)
@@ -1017,15 +1289,35 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/httpcustomheader.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/httpput.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/https.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imap.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imap-append.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imap-copy.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imap-create.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imap-delete.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imap-examine.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imap-fetch.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imap-list.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imap-multi.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imap-noop.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imap-search.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imap-ssl.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imap-store.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imap-tls.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/multi-app.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/multi-debugcallback.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/multi-double.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/multi-post.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/multi-single.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/persistant.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pop3s.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pop3slist.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pop3-dele.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pop3-list.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pop3-multi.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pop3-noop.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pop3-retr.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pop3-ssl.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pop3-stat.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pop3-tls.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pop3-top.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pop3-uidl.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/post-callback.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/postinmemory.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/postit2.Po@am__quote@
@@ -1037,10 +1329,13 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sftpget.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simple.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simplepost.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simplesmtp.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simplessl.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/smtp-expn.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/smtp-mail.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/smtp-multi.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/smtp-ssl.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/smtp-tls.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/smtp-vrfy.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/url2file.Po@am__quote@
.c.o:
diff --git a/docs/examples/Makefile.inc b/docs/examples/Makefile.inc
index 6a97bc27..dda08750 100644
--- a/docs/examples/Makefile.inc
+++ b/docs/examples/Makefile.inc
@@ -4,8 +4,12 @@ check_PROGRAMS = 10-at-a-time anyauthput cookie_interface debug fileupload \
https multi-app multi-debugcallback multi-double multi-post multi-single \
persistant post-callback postit2 sepheaders simple simplepost simplessl \
sendrecv httpcustomheader certinfo chkspeed ftpgetinfo ftp-wildcard \
- smtp-multi simplesmtp smtp-tls rtsp externalsocket resolve \
- progressfunc pop3s pop3slist imap url2file sftpget ftpsget postinmemory
+ smtp-mail smtp-multi smtp-ssl smtp-tls smtp-vrfy smtp-expn rtsp \
+ externalsocket resolve progressfunc pop3-retr pop3-list pop3-uidl pop3-dele \
+ pop3-top pop3-stat pop3-noop pop3-ssl pop3-tls pop3-multi imap-list \
+ imap-fetch imap-store imap-append imap-examine imap-search imap-create \
+ imap-delete imap-copy imap-noop imap-ssl imap-tls imap-multi url2file \
+ sftpget ftpsget postinmemory
# These examples require external dependencies that may not be commonly
# available on POSIX systems, so don't bother attempting to compile them here.
diff --git a/docs/examples/imap-append.c b/docs/examples/imap-append.c
new file mode 100644
index 00000000..8f0ebcb3
--- /dev/null
+++ b/docs/examples/imap-append.c
@@ -0,0 +1,115 @@
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at http://curl.haxx.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ***************************************************************************/
+#include <stdio.h>
+#include <curl/curl.h>
+
+/* This is a simple example showing how to send mail using libcurl's IMAP
+ * capabilities.
+ *
+ * Note that this example requires libcurl 7.30.0 or above.
+ */
+
+#define FROM "<sender@example.org>"
+#define TO "<addressee@example.net>"
+#define CC "<info@example.org>"
+
+static const char *payload_text[] = {
+ "Date: Mon, 29 Nov 2010 21:54:29 +1100\r\n",
+ "To: " TO "\r\n",
+ "From: " FROM "(Example User)\r\n",
+ "Cc: " CC "(Another example User)\r\n",
+ "Message-ID: <dcd7cb36-11db-487a-9f3a-e652a9458efd@rfcpedant.example.org>\r\n",
+ "Subject: IMAP example message\r\n",
+ "\r\n", /* empty line to divide headers from body, see RFC5322 */
+ "The body of the message starts here.\r\n",
+ "\r\n",
+ "It could be a lot of lines, could be MIME encoded, whatever.\r\n",
+ "Check RFC5322.\r\n",
+ NULL
+};
+
+struct upload_status {
+ int lines_read;
+};
+
+static size_t payload_source(void *ptr, size_t size, size_t nmemb, void *userp)
+{
+ struct upload_status *upload_ctx = (struct upload_status *)userp;
+ const char *data;
+
+ if((size == 0) || (nmemb == 0) || ((size*nmemb) < 1)) {
+ return 0;
+ }
+
+ data = payload_text[upload_ctx->lines_read];
+
+ if(data) {
+ size_t len = strlen(data);
+ memcpy(ptr, data, len);
+ upload_ctx->lines_read++;
+
+ return len;
+ }
+
+ return 0;
+}
+
+int main(void)
+{
+ CURL *curl;
+ CURLcode res = CURLE_OK;
+ struct upload_status upload_ctx;
+
+ upload_ctx.lines_read = 0;
+
+ curl = curl_easy_init();
+ if(curl) {
+ /* Set username and password */
+ curl_easy_setopt(curl, CURLOPT_USERNAME, "user");
+ curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret");
+
+ /* This will create a new message 100. Note that you should perform an
+ * EXAMINE command to obtain the UID of the next message to create and a
+ * SELECT to ensure you are creating the message in the OUTBOX. */
+ curl_easy_setopt(curl, CURLOPT_URL, "imap://imap.example.com/100");
+
+ /* In this case, we're using a callback function to specify the data. You
+ * could just use the CURLOPT_READDATA option to specify a FILE pointer to
+ * read from. */
+ curl_easy_setopt(curl, CURLOPT_READFUNCTION, payload_source);
+ curl_easy_setopt(curl, CURLOPT_READDATA, &upload_ctx);
+ curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
+
+ /* Perform the append */
+ res = curl_easy_perform(curl);
+
+ /* Check for errors */
+ if(res != CURLE_OK)
+ fprintf(stderr, "curl_easy_perform() failed: %s\n",
+ curl_easy_strerror(res));
+
+ /* Always cleanup */
+ curl_easy_cleanup(curl);
+ }
+
+ return (int)res;
+}
diff --git a/docs/examples/imap-copy.c b/docs/examples/imap-copy.c
new file mode 100644
index 00000000..fe2d91c1
--- /dev/null
+++ b/docs/examples/imap-copy.c
@@ -0,0 +1,65 @@
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at http://curl.haxx.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ***************************************************************************/
+#include <stdio.h>
+#include <curl/curl.h>
+
+/* This is a simple example showing how to copy a mail from one mailbox folder
+ * to another using libcurl's IMAP capabilities.
+ *
+ * Note that this example requires libcurl 7.30.0 or above.
+ */
+
+int main(void)
+{
+ CURL *curl;
+ CURLcode res = CURLE_OK;
+
+ curl = curl_easy_init();
+ if(curl) {
+ /* Set username and password */
+ curl_easy_setopt(curl, CURLOPT_USERNAME, "user");
+ curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret");
+
+ /* This is source mailbox folder to select */
+ curl_easy_setopt(curl, CURLOPT_URL, "imap://imap.example.com/INBOX");
+
+ /* Set the COPY command specifing the message ID and destination folder */
+ curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "COPY 1 FOLDER");
+
+ /* Note that to perform a move operation you will need to perform the copy,
+ * then mark the original mail as Deleted and EXPUNGE or CLOSE. Please see
+ * imap-store.c for more information on deleting messages. */
+
+ /* Perform the custom request */
+ res = curl_easy_perform(curl);
+
+ /* Check for errors */
+ if(res != CURLE_OK)
+ fprintf(stderr, "curl_easy_perform() failed: %s\n",
+ curl_easy_strerror(res));
+
+ /* Always cleanup */
+ curl_easy_cleanup(curl);
+ }
+
+ return (int)res;
+}
diff --git a/docs/examples/imap-create.c b/docs/examples/imap-create.c
new file mode 100644
index 00000000..65ddede6
--- /dev/null
+++ b/docs/examples/imap-create.c
@@ -0,0 +1,61 @@
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at http://curl.haxx.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ***************************************************************************/
+#include <stdio.h>
+#include <curl/curl.h>
+
+/* This is a simple example showing how to create a new mailbox folder using
+ * libcurl's IMAP capabilities.
+ *
+ * Note that this example requires libcurl 7.30.0 or above.
+ */
+
+int main(void)
+{
+ CURL *curl;
+ CURLcode res = CURLE_OK;
+
+ curl = curl_easy_init();
+ if(curl) {
+ /* Set username and password */
+ curl_easy_setopt(curl, CURLOPT_USERNAME, "user");
+ curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret");
+
+ /* This is just the server URL */
+ curl_easy_setopt(curl, CURLOPT_URL, "imap://imap.example.com");
+
+ /* Set the CREATE command specifing the new folder name */
+ curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "CREATE FOLDER");
+
+ /* Perform the custom request */
+ res = curl_easy_perform(curl);
+
+ /* Check for errors */
+ if(res != CURLE_OK)
+ fprintf(stderr, "curl_easy_perform() failed: %s\n",
+ curl_easy_strerror(res));
+
+ /* Always cleanup */
+ curl_easy_cleanup(curl);
+ }
+
+ return (int)res;
+}
diff --git a/docs/examples/imap-delete.c b/docs/examples/imap-delete.c
new file mode 100644
index 00000000..5113be9a
--- /dev/null
+++ b/docs/examples/imap-delete.c
@@ -0,0 +1,61 @@
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at http://curl.haxx.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ***************************************************************************/
+#include <stdio.h>
+#include <curl/curl.h>
+
+/* This is a simple example showing how to delete an existing mailbox folder
+ * using libcurl's IMAP capabilities.
+ *
+ * Note that this example requires libcurl 7.30.0 or above.
+ */
+
+int main(void)
+{
+ CURL *curl;
+ CURLcode res = CURLE_OK;
+
+ curl = curl_easy_init();
+ if(curl) {
+ /* Set username and password */
+ curl_easy_setopt(curl, CURLOPT_USERNAME, "user");
+ curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret");
+
+ /* This is just the server URL */
+ curl_easy_setopt(curl, CURLOPT_URL, "imap://imap.example.com");
+
+ /* Set the DELETE command specifing the existing folder */
+ curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "DELETE FOLDER");
+
+ /* Perform the custom request */
+ res = curl_easy_perform(curl);
+
+ /* Check for errors */
+ if(res != CURLE_OK)
+ fprintf(stderr, "curl_easy_perform() failed: %s\n",
+ curl_easy_strerror(res));
+
+ /* Always cleanup */
+ curl_easy_cleanup(curl);
+ }
+
+ return (int)res;
+}
diff --git a/docs/examples/imap-examine.c b/docs/examples/imap-examine.c
new file mode 100644
index 00000000..a7b41c58
--- /dev/null
+++ b/docs/examples/imap-examine.c
@@ -0,0 +1,61 @@
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at http://curl.haxx.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ***************************************************************************/
+#include <stdio.h>
+#include <curl/curl.h>
+
+/* This is a simple example showing how to obtain information about a mailbox
+ * folder using libcurl's IMAP capabilities via the EXAMINE command.
+ *
+ * Note that this example requires libcurl 7.30.0 or above.
+ */
+
+int main(void)
+{
+ CURL *curl;
+ CURLcode res = CURLE_OK;
+
+ curl = curl_easy_init();
+ if(curl) {
+ /* Set username and password */
+ curl_easy_setopt(curl, CURLOPT_USERNAME, "user");
+ curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret");
+
+ /* This is just the server URL */
+ curl_easy_setopt(curl, CURLOPT_URL, "imap://imap.example.com");
+
+ /* Set the EXAMINE command specifing the mailbox folder */
+ curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "EXAMINE OUTBOX");
+
+ /* Perform the custom request */
+ res = curl_easy_perform(curl);
+
+ /* Check for errors */
+ if(res != CURLE_OK)
+ fprintf(stderr, "curl_easy_perform() failed: %s\n",
+ curl_easy_strerror(res));
+
+ /* Always cleanup */
+ curl_easy_cleanup(curl);
+ }
+
+ return (int)res;
+}
diff --git a/docs/examples/imap.c b/docs/examples/imap-fetch.c
index ba07f022..831d0dcf 100644
--- a/docs/examples/imap.c
+++ b/docs/examples/imap-fetch.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -22,6 +22,12 @@
#include <stdio.h>
#include <curl/curl.h>
+/* This is a simple example showing how to fetch mail using libcurl's IMAP
+ * capabilities.
+ *
+ * Note that this example requires libcurl 7.30.0 or above.
+ */
+
int main(void)
{
CURL *curl;
@@ -30,15 +36,23 @@ int main(void)
curl = curl_easy_init();
if(curl) {
/* Set username and password */
- curl_easy_setopt(curl, CURLOPT_USERPWD, "user:password");
+ curl_easy_setopt(curl, CURLOPT_USERNAME, "user");
+ curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret");
- /* This will fetch the mailbox named "foobar" */
- curl_easy_setopt(curl, CURLOPT_URL, "imap://imap.example.com/foobar");
+ /* This will fetch message 1 from the user's inbox */
+ curl_easy_setopt(curl, CURLOPT_URL, "imap://imap.example.com/INBOX/;UID=1");
+ /* Perform the fetch */
res = curl_easy_perform(curl);
- /* always cleanup */
+ /* Check for errors */
+ if(res != CURLE_OK)
+ fprintf(stderr, "curl_easy_perform() failed: %s\n",
+ curl_easy_strerror(res));
+
+ /* Always cleanup */
curl_easy_cleanup(curl);
}
+
return (int)res;
}
diff --git a/docs/examples/imap-list.c b/docs/examples/imap-list.c
new file mode 100644
index 00000000..4223052e
--- /dev/null
+++ b/docs/examples/imap-list.c
@@ -0,0 +1,60 @@
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at http://curl.haxx.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ***************************************************************************/
+#include <stdio.h>
+#include <curl/curl.h>
+
+/* This is a simple example showing how to list the folders within an IMAP
+ * mailbox.
+ *
+ * Note that this example requires libcurl 7.30.0 or above.
+ */
+
+int main(void)
+{
+ CURL *curl;
+ CURLcode res = CURLE_OK;
+
+ curl = curl_easy_init();
+ if(curl) {
+ /* Set username and password */
+ curl_easy_setopt(curl, CURLOPT_USERNAME, "user");
+ curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret");
+
+ /* This will list the folders within the user's mailbox. If you want to
+ * list the folders within a specific folder, for example the inbox, then
+ * specify the folder as a path in the URL such as /INBOX */
+ curl_easy_setopt(curl, CURLOPT_URL, "imap://imap.example.com");
+
+ /* Perform the list */
+ res = curl_easy_perform(curl);
+
+ /* Check for errors */
+ if(res != CURLE_OK)
+ fprintf(stderr, "curl_easy_perform() failed: %s\n",
+ curl_easy_strerror(res));
+
+ /* Always cleanup */
+ curl_easy_cleanup(curl);
+ }
+
+ return (int)res;
+}
diff --git a/docs/examples/imap-multi.c b/docs/examples/imap-multi.c
new file mode 100644
index 00000000..601205a0
--- /dev/null
+++ b/docs/examples/imap-multi.c
@@ -0,0 +1,145 @@
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at http://curl.haxx.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ***************************************************************************/
+#include <stdio.h>
+#include <curl/curl.h>
+
+/* This is a simple example showing how to fetch mail using libcurl's IMAP
+ * capabilities. It builds on the imap-fetch.c example to demonstrate how to
+ * use libcurl's multi interface.
+ *
+ * Note that this example requires libcurl 7.30.0 or above.
+ */
+
+#define MULTI_PERFORM_HANG_TIMEOUT 60 * 1000
+
+static struct timeval tvnow(void)
+{
+ struct timeval now;
+
+ /* time() returns the value of time in seconds since the epoch */
+ now.tv_sec = (long)time(NULL);
+ now.tv_usec = 0;
+
+ return now;
+}
+
+static long tvdiff(struct timeval newer, struct timeval older)
+{
+ return (newer.tv_sec - older.tv_sec) * 1000 +
+ (newer.tv_usec - older.tv_usec) / 1000;
+}
+
+int main(void)
+{
+ CURL *curl;
+ CURLM *mcurl;
+ int still_running = 1;
+ struct timeval mp_start;
+
+ curl_global_init(CURL_GLOBAL_DEFAULT);
+
+ curl = curl_easy_init();
+ if(!curl)
+ return 1;
+
+ mcurl = curl_multi_init();
+ if(!mcurl)
+ return 2;
+
+ /* Set username and password */
+ curl_easy_setopt(curl, CURLOPT_USERNAME, "user");
+ curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret");
+
+ /* This will fetch message 1 from the user's inbox */
+ curl_easy_setopt(curl, CURLOPT_URL, "imap://imap.example.com/INBOX/;UID=1");
+
+ /* Tell the multi stack about our easy handle */
+ curl_multi_add_handle(mcurl, curl);
+
+ /* Record the start time which we can use later */
+ mp_start = tvnow();
+
+ /* We start some action by calling perform right away */
+ curl_multi_perform(mcurl, &still_running);
+
+ while(still_running) {
+ struct timeval timeout;
+ fd_set fdread;
+ fd_set fdwrite;
+ fd_set fdexcep;
+ int maxfd = -1;
+ int rc;
+
+ long curl_timeo = -1;
+
+ /* Initialise the file descriptors */
+ FD_ZERO(&fdread);
+ FD_ZERO(&fdwrite);
+ FD_ZERO(&fdexcep);
+
+ /* Set a suitable timeout to play around with */
+ timeout.tv_sec = 1;
+ timeout.tv_usec = 0;
+
+ curl_multi_timeout(mcurl, &curl_timeo);
+ if(curl_timeo >= 0) {
+ timeout.tv_sec = curl_timeo / 1000;
+ if(timeout.tv_sec > 1)
+ timeout.tv_sec = 1;
+ else
+ timeout.tv_usec = (curl_timeo % 1000) * 1000;
+ }
+
+ /* Get file descriptors from the transfers */
+ curl_multi_fdset(mcurl, &fdread, &fdwrite, &fdexcep, &maxfd);
+
+ /* In a real-world program you OF COURSE check the return code of the
+ function calls. On success, the value of maxfd is guaranteed to be
+ greater or equal than -1. We call select(maxfd + 1, ...), specially in
+ case of (maxfd == -1), we call select(0, ...), which is basically equal
+ to sleep. */
+ rc = select(maxfd + 1, &fdread, &fdwrite, &fdexcep, &timeout);
+
+ if(tvdiff(tvnow(), mp_start) > MULTI_PERFORM_HANG_TIMEOUT) {
+ fprintf(stderr,
+ "ABORTING: Since it seems that we would have run forever.\n");
+ break;
+ }
+
+ switch(rc) {
+ case -1: /* select error */
+ break;
+ case 0: /* timeout */
+ default: /* action */
+ curl_multi_perform(mcurl, &still_running);
+ break;
+ }
+ }
+
+ /* Always cleanup */
+ curl_multi_remove_handle(mcurl, curl);
+ curl_multi_cleanup(mcurl);
+ curl_easy_cleanup(curl);
+ curl_global_cleanup();
+
+ return 0;
+}
diff --git a/docs/examples/imap-noop.c b/docs/examples/imap-noop.c
new file mode 100644
index 00000000..71a55728
--- /dev/null
+++ b/docs/examples/imap-noop.c
@@ -0,0 +1,61 @@
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at http://curl.haxx.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ***************************************************************************/
+#include <stdio.h>
+#include <curl/curl.h>
+
+/* This is a simple example showing how to perform a noop using libcurl's IMAP
+ * capabilities.
+ *
+ * Note that this example requires libcurl 7.30.0 or above.
+ */
+
+int main(void)
+{
+ CURL *curl;
+ CURLcode res = CURLE_OK;
+
+ curl = curl_easy_init();
+ if(curl) {
+ /* Set username and password */
+ curl_easy_setopt(curl, CURLOPT_USERNAME, "user");
+ curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret");
+
+ /* This is just the server URL */
+ curl_easy_setopt(curl, CURLOPT_URL, "imap://imap.example.com");
+
+ /* Set the NOOP command */
+ curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "NOOP");
+
+ /* Perform the custom request */
+ res = curl_easy_perform(curl);
+
+ /* Check for errors */
+ if(res != CURLE_OK)
+ fprintf(stderr, "curl_easy_perform() failed: %s\n",
+ curl_easy_strerror(res));
+
+ /* Always cleanup */
+ curl_easy_cleanup(curl);
+ }
+
+ return (int)res;
+}
diff --git a/docs/examples/imap-search.c b/docs/examples/imap-search.c
new file mode 100644
index 00000000..0c1d2673
--- /dev/null
+++ b/docs/examples/imap-search.c
@@ -0,0 +1,65 @@
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at http://curl.haxx.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ***************************************************************************/
+#include <stdio.h>
+#include <curl/curl.h>
+
+/* This is a simple example showing how to search for new messages using
+ * libcurl's IMAP capabilities.
+ *
+ * Note that this example requires libcurl 7.30.0 or above.
+ */
+
+int main(void)
+{
+ CURL *curl;
+ CURLcode res = CURLE_OK;
+
+ curl = curl_easy_init();
+ if(curl) {
+ /* Set username and password */
+ curl_easy_setopt(curl, CURLOPT_USERNAME, "user");
+ curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret");
+
+ /* This is mailbox folder to select */
+ curl_easy_setopt(curl, CURLOPT_URL, "imap://imap.example.com/INBOX");
+
+ /* Set the SEARCH command specifing what we want to search for. Note that
+ * this can contain a message sequence set and a number of search criteria
+ * keywords including flags such as ANSWERED, DELETED, DRAFT, FLAGGED, NEW,
+ * RECENT and SEEN. For more information about the search criteria please
+ * see RFC-3501 section 6.4.4. */
+ curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "SEARCH NEW");
+
+ /* Perform the custom request */
+ res = curl_easy_perform(curl);
+
+ /* Check for errors */
+ if(res != CURLE_OK)
+ fprintf(stderr, "curl_easy_perform() failed: %s\n",
+ curl_easy_strerror(res));
+
+ /* Always cleanup */
+ curl_easy_cleanup(curl);
+ }
+
+ return (int)res;
+}
diff --git a/docs/examples/pop3slist.c b/docs/examples/imap-ssl.c
index 9d9668fa..e42ff392 100644
--- a/docs/examples/pop3slist.c
+++ b/docs/examples/imap-ssl.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -22,52 +22,64 @@
#include <stdio.h>
#include <curl/curl.h>
+/* This is a simple example showing how to fetch mail using libcurl's IMAP
+ * capabilities. It builds on the imap-fetch.c example adding transport
+ * security to protect the authentication details from being snooped.
+ *
+ * Note that this example requires libcurl 7.30.0 or above.
+ */
+
int main(void)
{
CURL *curl;
- CURLcode res;
+ CURLcode res = CURLE_OK;
curl = curl_easy_init();
if(curl) {
/* Set username and password */
- curl_easy_setopt(curl, CURLOPT_USERPWD, "user:password");
+ curl_easy_setopt(curl, CURLOPT_USERNAME, "user");
+ curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret");
- /* This will list every message of the given mailbox */
- curl_easy_setopt(curl, CURLOPT_URL, "pop3s://user@pop.example.com/");
+ /* This will fetch message 1 from the user's inbox. Note the use of
+ * imaps:// rather than imap:// to request a SSL based connection. */
+ curl_easy_setopt(curl, CURLOPT_URL, "imaps://imap.example.com/INBOX/;UID=1");
-#ifdef SKIP_PEER_VERIFICATION
- /*
- * If you want to connect to a site who isn't using a certificate that is
+ /* If you want to connect to a site who isn't using a certificate that is
* signed by one of the certs in the CA bundle you have, you can skip the
* verification of the server's certificate. This makes the connection
* A LOT LESS SECURE.
*
* If you have a CA cert for the server stored someplace else than in the
* default bundle, then the CURLOPT_CAPATH option might come handy for
- * you.
- */
+ * you. */
+#ifdef SKIP_PEER_VERIFICATION
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
#endif
-#ifdef SKIP_HOSTNAME_VERFICATION
- /*
- * If the site you're connecting to uses a different host name that what
+ /* If the site you're connecting to uses a different host name that what
* they have mentioned in their server certificate's commonName (or
* subjectAltName) fields, libcurl will refuse to connect. You can skip
- * this check, but this will make the connection less secure.
- */
+ * this check, but this will make the connection less secure. */
+#ifdef SKIP_HOSTNAME_VERFICATION
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
#endif
- /* Perform the request, res will get the return code */
+ /* Since the traffic will be encrypted, it is very useful to turn on debug
+ * information within libcurl to see what is happening during the
+ * transfer */
+ curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
+
+ /* Perform the fetch */
res = curl_easy_perform(curl);
+
/* Check for errors */
if(res != CURLE_OK)
fprintf(stderr, "curl_easy_perform() failed: %s\n",
curl_easy_strerror(res));
- /* always cleanup */
+ /* Always cleanup */
curl_easy_cleanup(curl);
}
- return 0;
+
+ return (int)res;
}
diff --git a/docs/examples/imap-store.c b/docs/examples/imap-store.c
new file mode 100644
index 00000000..8f5e7d5b
--- /dev/null
+++ b/docs/examples/imap-store.c
@@ -0,0 +1,76 @@
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at http://curl.haxx.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ***************************************************************************/
+#include <stdio.h>
+#include <curl/curl.h>
+
+/* This is a simple example showing how to modify an existing mail using
+ * libcurl's IMAP capabilities with the STORE command.
+ *
+ * Note that this example requires libcurl 7.30.0 or above.
+ */
+
+int main(void)
+{
+ CURL *curl;
+ CURLcode res = CURLE_OK;
+
+ curl = curl_easy_init();
+ if(curl) {
+ /* Set username and password */
+ curl_easy_setopt(curl, CURLOPT_USERNAME, "user");
+ curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret");
+
+ /* This is the mailbox folder to select */
+ curl_easy_setopt(curl, CURLOPT_URL, "imap://imap.example.com/INBOX");
+
+ /* Set the STORE command with the Deleted flag for message 1. Note that
+ * you can use the STORE command to set other flags such as Seen, Answered,
+ * Flagged, Draft and Recent. */
+ curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "STORE 1 +Flags \\Deleted");
+
+ /* Perform the custom request */
+ res = curl_easy_perform(curl);
+
+ /* Check for errors */
+ if(res != CURLE_OK)
+ fprintf(stderr, "curl_easy_perform() failed: %s\n",
+ curl_easy_strerror(res));
+ else {
+ /* Set the EXPUNGE command, although you can use the CLOSE command if you
+ * don't want to know the result of the STORE */
+ curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "EXPUNGE");
+
+ /* Perform the second custom request */
+ res = curl_easy_perform(curl);
+
+ /* Check for errors */
+ if(res != CURLE_OK)
+ fprintf(stderr, "curl_easy_perform() failed: %s\n",
+ curl_easy_strerror(res));
+ }
+
+ /* Always cleanup */
+ curl_easy_cleanup(curl);
+ }
+
+ return (int)res;
+}
diff --git a/docs/examples/imap-tls.c b/docs/examples/imap-tls.c
new file mode 100644
index 00000000..c439864b
--- /dev/null
+++ b/docs/examples/imap-tls.c
@@ -0,0 +1,84 @@
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at http://curl.haxx.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ***************************************************************************/
+#include <stdio.h>
+#include <curl/curl.h>
+
+/* This is a simple example showing how to fetch mail using libcurl's IMAP
+ * capabilities. It builds on the imap-fetch.c example adding transport
+ * security to protect the authentication details from being snooped.
+ *
+ * Note that this example requires libcurl 7.30.0 or above.
+ */
+
+int main(void)
+{
+ CURL *curl;
+ CURLcode res = CURLE_OK;
+
+ curl = curl_easy_init();
+ if(curl) {
+ /* Set username and password */
+ curl_easy_setopt(curl, CURLOPT_USERNAME, "user");
+ curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret");
+
+ /* This will fetch message 1 from the user's inbox */
+ curl_easy_setopt(curl, CURLOPT_URL, "imap://imap.example.com/INBOX/;UID=1");
+
+ /* In this example, we'll start with a plain text connection, and upgrade
+ * to Transport Layer Security (TLS) using the STARTTLS command. Be careful
+ * of using CURLUSESSL_TRY here, because if TLS upgrade fails, the transfer
+ * will continue anyway - see the security discussion in the libcurl
+ * tutorial for more details. */
+ curl_easy_setopt(curl, CURLOPT_USE_SSL, (long)CURLUSESSL_ALL);
+
+ /* If your server doesn't have a valid certificate, then you can disable
+ * part of the Transport Layer Security protection by setting the
+ * CURLOPT_SSL_VERIFYPEER and CURLOPT_SSL_VERIFYHOST options to 0 (false).
+ * curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
+ * curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
+ * That is, in general, a bad idea. It is still better than sending your
+ * authentication details in plain text though.
+ * Instead, you should get the issuer certificate (or the host certificate
+ * if the certificate is self-signed) and add it to the set of certificates
+ * that are known to libcurl using CURLOPT_CAINFO and/or CURLOPT_CAPATH. See
+ * docs/SSLCERTS for more information. */
+ curl_easy_setopt(curl, CURLOPT_CAINFO, "/path/to/certificate.pem");
+
+ /* Since the traffic will be encrypted, it is very useful to turn on debug
+ * information within libcurl to see what is happening during the
+ * transfer */
+ curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
+
+ /* Perform the fetch */
+ res = curl_easy_perform(curl);
+
+ /* Check for errors */
+ if(res != CURLE_OK)
+ fprintf(stderr, "curl_easy_perform() failed: %s\n",
+ curl_easy_strerror(res));
+
+ /* Always cleanup */
+ curl_easy_cleanup(curl);
+ }
+
+ return (int)res;
+}
diff --git a/docs/examples/pop3-dele.c b/docs/examples/pop3-dele.c
new file mode 100644
index 00000000..fab598f0
--- /dev/null
+++ b/docs/examples/pop3-dele.c
@@ -0,0 +1,64 @@
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at http://curl.haxx.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ***************************************************************************/
+#include <stdio.h>
+#include <curl/curl.h>
+
+/* This is a simple example showing how to delete an existing mail using
+ * libcurl's POP3 capabilities.
+ *
+ * Note that this example requires libcurl 7.26.0 or above.
+ */
+
+int main(void)
+{
+ CURL *curl;
+ CURLcode res = CURLE_OK;
+
+ curl = curl_easy_init();
+ if(curl) {
+ /* Set username and password */
+ curl_easy_setopt(curl, CURLOPT_USERNAME, "user");
+ curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret");
+
+ /* You can specify the message either in the URL or DELE command */
+ curl_easy_setopt(curl, CURLOPT_URL, "pop3://pop.example.com/1");
+
+ /* Set the DELE command */
+ curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "DELE");
+
+ /* Do not perform a transfer as DELE returns no data */
+ curl_easy_setopt(curl, CURLOPT_NOBODY, 1L);
+
+ /* Perform the custom request */
+ res = curl_easy_perform(curl);
+
+ /* Check for errors */
+ if(res != CURLE_OK)
+ fprintf(stderr, "curl_easy_perform() failed: %s\n",
+ curl_easy_strerror(res));
+
+ /* Always cleanup */
+ curl_easy_cleanup(curl);
+ }
+
+ return (int)res;
+}
diff --git a/docs/examples/pop3-list.c b/docs/examples/pop3-list.c
new file mode 100644
index 00000000..aebcea6b
--- /dev/null
+++ b/docs/examples/pop3-list.c
@@ -0,0 +1,58 @@
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at http://curl.haxx.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ***************************************************************************/
+#include <stdio.h>
+#include <curl/curl.h>
+
+/* This is a simple example using libcurl's POP3 capabilities to list the
+ * contents of a mailbox.
+ *
+ * Note that this example requires libcurl 7.20.0 or above.
+ */
+
+int main(void)
+{
+ CURL *curl;
+ CURLcode res = CURLE_OK;
+
+ curl = curl_easy_init();
+ if(curl) {
+ /* Set username and password */
+ curl_easy_setopt(curl, CURLOPT_USERNAME, "user");
+ curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret");
+
+ /* This will list every message of the given mailbox */
+ curl_easy_setopt(curl, CURLOPT_URL, "pop3://pop.example.com");
+
+ /* Perform the list */
+ res = curl_easy_perform(curl);
+
+ /* Check for errors */
+ if(res != CURLE_OK)
+ fprintf(stderr, "curl_easy_perform() failed: %s\n",
+ curl_easy_strerror(res));
+
+ /* Always cleanup */
+ curl_easy_cleanup(curl);
+ }
+
+ return (int)res;
+}
diff --git a/docs/examples/pop3-multi.c b/docs/examples/pop3-multi.c
new file mode 100644
index 00000000..d14d1159
--- /dev/null
+++ b/docs/examples/pop3-multi.c
@@ -0,0 +1,145 @@
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at http://curl.haxx.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ***************************************************************************/
+#include <stdio.h>
+#include <curl/curl.h>
+
+/* This is a simple example showing how to retrieve mail using libcurl's POP3
+ * capabilities. It builds on the pop3-retr.c example to demonstrate how to use
+ * libcurl's multi interface.
+ *
+ * Note that this example requires libcurl 7.20.0 or above.
+ */
+
+#define MULTI_PERFORM_HANG_TIMEOUT 60 * 1000
+
+static struct timeval tvnow(void)
+{
+ struct timeval now;
+
+ /* time() returns the value of time in seconds since the epoch */
+ now.tv_sec = (long)time(NULL);
+ now.tv_usec = 0;
+
+ return now;
+}
+
+static long tvdiff(struct timeval newer, struct timeval older)
+{
+ return (newer.tv_sec - older.tv_sec) * 1000 +
+ (newer.tv_usec - older.tv_usec) / 1000;
+}
+
+int main(void)
+{
+ CURL *curl;
+ CURLM *mcurl;
+ int still_running = 1;
+ struct timeval mp_start;
+
+ curl_global_init(CURL_GLOBAL_DEFAULT);
+
+ curl = curl_easy_init();
+ if(!curl)
+ return 1;
+
+ mcurl = curl_multi_init();
+ if(!mcurl)
+ return 2;
+
+ /* Set username and password */
+ curl_easy_setopt(curl, CURLOPT_USERNAME, "user");
+ curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret");
+
+ /* This will retreive message 1 from the user's mailbox */
+ curl_easy_setopt(curl, CURLOPT_URL, "pop3://pop.example.com/1");
+
+ /* Tell the multi stack about our easy handle */
+ curl_multi_add_handle(mcurl, curl);
+
+ /* Record the start time which we can use later */
+ mp_start = tvnow();
+
+ /* We start some action by calling perform right away */
+ curl_multi_perform(mcurl, &still_running);
+
+ while(still_running) {
+ struct timeval timeout;
+ fd_set fdread;
+ fd_set fdwrite;
+ fd_set fdexcep;
+ int maxfd = -1;
+ int rc;
+
+ long curl_timeo = -1;
+
+ /* Initialise the file descriptors */
+ FD_ZERO(&fdread);
+ FD_ZERO(&fdwrite);
+ FD_ZERO(&fdexcep);
+
+ /* Set a suitable timeout to play around with */
+ timeout.tv_sec = 1;
+ timeout.tv_usec = 0;
+
+ curl_multi_timeout(mcurl, &curl_timeo);
+ if(curl_timeo >= 0) {
+ timeout.tv_sec = curl_timeo / 1000;
+ if(timeout.tv_sec > 1)
+ timeout.tv_sec = 1;
+ else
+ timeout.tv_usec = (curl_timeo % 1000) * 1000;
+ }
+
+ /* Get file descriptors from the transfers */
+ curl_multi_fdset(mcurl, &fdread, &fdwrite, &fdexcep, &maxfd);
+
+ /* In a real-world program you OF COURSE check the return code of the
+ function calls. On success, the value of maxfd is guaranteed to be
+ greater or equal than -1. We call select(maxfd + 1, ...), specially in
+ case of (maxfd == -1), we call select(0, ...), which is basically equal
+ to sleep. */
+ rc = select(maxfd + 1, &fdread, &fdwrite, &fdexcep, &timeout);
+
+ if(tvdiff(tvnow(), mp_start) > MULTI_PERFORM_HANG_TIMEOUT) {
+ fprintf(stderr,
+ "ABORTING: Since it seems that we would have run forever.\n");
+ break;
+ }
+
+ switch(rc) {
+ case -1: /* select error */
+ break;
+ case 0: /* timeout */
+ default: /* action */
+ curl_multi_perform(mcurl, &still_running);
+ break;
+ }
+ }
+
+ /* Always cleanup */
+ curl_multi_remove_handle(mcurl, curl);
+ curl_multi_cleanup(mcurl);
+ curl_easy_cleanup(curl);
+ curl_global_cleanup();
+
+ return 0;
+}
diff --git a/docs/examples/pop3-noop.c b/docs/examples/pop3-noop.c
new file mode 100644
index 00000000..4efe6715
--- /dev/null
+++ b/docs/examples/pop3-noop.c
@@ -0,0 +1,64 @@
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at http://curl.haxx.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ***************************************************************************/
+#include <stdio.h>
+#include <curl/curl.h>
+
+/* This is a simple example showing how to perform a noop using libcurl's POP3
+ * capabilities.
+ *
+ * Note that this example requires libcurl 7.26.0 or above.
+ */
+
+int main(void)
+{
+ CURL *curl;
+ CURLcode res = CURLE_OK;
+
+ curl = curl_easy_init();
+ if(curl) {
+ /* Set username and password */
+ curl_easy_setopt(curl, CURLOPT_USERNAME, "user");
+ curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret");
+
+ /* This is just the server URL */
+ curl_easy_setopt(curl, CURLOPT_URL, "pop3://pop.example.com");
+
+ /* Set the NOOP command */
+ curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "NOOP");
+
+ /* Do not perform a transfer as NOOP returns no data */
+ curl_easy_setopt(curl, CURLOPT_NOBODY, 1L);
+
+ /* Perform the custom request */
+ res = curl_easy_perform(curl);
+
+ /* Check for errors */
+ if(res != CURLE_OK)
+ fprintf(stderr, "curl_easy_perform() failed: %s\n",
+ curl_easy_strerror(res));
+
+ /* Always cleanup */
+ curl_easy_cleanup(curl);
+ }
+
+ return (int)res;
+}
diff --git a/docs/examples/pop3-retr.c b/docs/examples/pop3-retr.c
new file mode 100644
index 00000000..e5a50f22
--- /dev/null
+++ b/docs/examples/pop3-retr.c
@@ -0,0 +1,58 @@
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at http://curl.haxx.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ***************************************************************************/
+#include <stdio.h>
+#include <curl/curl.h>
+
+/* This is a simple example showing how to retrieve mail using libcurl's POP3
+ * capabilities.
+ *
+ * Note that this example requires libcurl 7.20.0 or above.
+ */
+
+int main(void)
+{
+ CURL *curl;
+ CURLcode res = CURLE_OK;
+
+ curl = curl_easy_init();
+ if(curl) {
+ /* Set username and password */
+ curl_easy_setopt(curl, CURLOPT_USERNAME, "user");
+ curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret");
+
+ /* This will retreive message 1 from the user's mailbox */
+ curl_easy_setopt(curl, CURLOPT_URL, "pop3://pop.example.com/1");
+
+ /* Perform the retr */
+ res = curl_easy_perform(curl);
+
+ /* Check for errors */
+ if(res != CURLE_OK)
+ fprintf(stderr, "curl_easy_perform() failed: %s\n",
+ curl_easy_strerror(res));
+
+ /* Always cleanup */
+ curl_easy_cleanup(curl);
+ }
+
+ return (int)res;
+}
diff --git a/docs/examples/pop3s.c b/docs/examples/pop3-ssl.c
index 44d7c80d..45e0054b 100644
--- a/docs/examples/pop3s.c
+++ b/docs/examples/pop3-ssl.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -22,52 +22,64 @@
#include <stdio.h>
#include <curl/curl.h>
+/* This is a simple example showing how to retrieve mail using libcurl's POP3
+ * capabilities. It builds on the pop3-retr.c example adding transport
+ * security to protect the authentication details from being snooped.
+ *
+ * Note that this example requires libcurl 7.20.0 or above.
+ */
+
int main(void)
{
CURL *curl;
- CURLcode res;
+ CURLcode res = CURLE_OK;
curl = curl_easy_init();
if(curl) {
/* Set username and password */
- curl_easy_setopt(curl, CURLOPT_USERPWD, "user:password");
+ curl_easy_setopt(curl, CURLOPT_USERNAME, "user");
+ curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret");
- /* This will only fetch the message with ID "1" of the given mailbox */
- curl_easy_setopt(curl, CURLOPT_URL, "pop3s://user@pop.example.com/1");
+ /* This will retreive message 1 from the user's mailbox. Note the use of
+ * pop3s:// rather than pop3:// to request a SSL based connection. */
+ curl_easy_setopt(curl, CURLOPT_URL, "pop3s://pop.example.com/1");
-#ifdef SKIP_PEER_VERIFICATION
- /*
- * If you want to connect to a site who isn't using a certificate that is
+ /* If you want to connect to a site who isn't using a certificate that is
* signed by one of the certs in the CA bundle you have, you can skip the
* verification of the server's certificate. This makes the connection
* A LOT LESS SECURE.
*
* If you have a CA cert for the server stored someplace else than in the
* default bundle, then the CURLOPT_CAPATH option might come handy for
- * you.
- */
+ * you. */
+#ifdef SKIP_PEER_VERIFICATION
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
#endif
-#ifdef SKIP_HOSTNAME_VERFICATION
- /*
- * If the site you're connecting to uses a different host name that what
+ /* If the site you're connecting to uses a different host name that what
* they have mentioned in their server certificate's commonName (or
* subjectAltName) fields, libcurl will refuse to connect. You can skip
- * this check, but this will make the connection less secure.
- */
+ * this check, but this will make the connection less secure. */
+#ifdef SKIP_HOSTNAME_VERFICATION
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
#endif
- /* Perform the request, res will get the return code */
+ /* Since the traffic will be encrypted, it is very useful to turn on debug
+ * information within libcurl to see what is happening during the
+ * transfer */
+ curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
+
+ /* Perform the retr */
res = curl_easy_perform(curl);
+
/* Check for errors */
if(res != CURLE_OK)
fprintf(stderr, "curl_easy_perform() failed: %s\n",
curl_easy_strerror(res));
- /* always cleanup */
+ /* Always cleanup */
curl_easy_cleanup(curl);
}
- return 0;
+
+ return (int)res;
}
diff --git a/docs/examples/pop3-stat.c b/docs/examples/pop3-stat.c
new file mode 100644
index 00000000..7b318fc2
--- /dev/null
+++ b/docs/examples/pop3-stat.c
@@ -0,0 +1,64 @@
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at http://curl.haxx.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ***************************************************************************/
+#include <stdio.h>
+#include <curl/curl.h>
+
+/* This is a simple example showing how to obtain message statistics using
+ * libcurl's POP3 capabilities.
+ *
+ * Note that this example requires libcurl 7.26.0 or above.
+ */
+
+int main(void)
+{
+ CURL *curl;
+ CURLcode res = CURLE_OK;
+
+ curl = curl_easy_init();
+ if(curl) {
+ /* Set username and password */
+ curl_easy_setopt(curl, CURLOPT_USERNAME, "user");
+ curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret");
+
+ /* This is just the server URL */
+ curl_easy_setopt(curl, CURLOPT_URL, "pop3://pop.example.com");
+
+ /* Set the STAT command */
+ curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "STAT");
+
+ /* Do not perform a transfer as the data is in the response */
+ curl_easy_setopt(curl, CURLOPT_NOBODY, 1L);
+
+ /* Perform the custom request */
+ res = curl_easy_perform(curl);
+
+ /* Check for errors */
+ if(res != CURLE_OK)
+ fprintf(stderr, "curl_easy_perform() failed: %s\n",
+ curl_easy_strerror(res));
+
+ /* Always cleanup */
+ curl_easy_cleanup(curl);
+ }
+
+ return (int)res;
+}
diff --git a/docs/examples/pop3-tls.c b/docs/examples/pop3-tls.c
new file mode 100644
index 00000000..812d89b8
--- /dev/null
+++ b/docs/examples/pop3-tls.c
@@ -0,0 +1,84 @@
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at http://curl.haxx.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ***************************************************************************/
+#include <stdio.h>
+#include <curl/curl.h>
+
+/* This is a simple example showing how to retrieve mail using libcurl's POP3
+ * capabilities. It builds on the pop3-retr.c example adding transport
+ * security to protect the authentication details from being snooped.
+ *
+ * Note that this example requires libcurl 7.20.0 or above.
+ */
+
+int main(void)
+{
+ CURL *curl;
+ CURLcode res = CURLE_OK;
+
+ curl = curl_easy_init();
+ if(curl) {
+ /* Set username and password */
+ curl_easy_setopt(curl, CURLOPT_USERNAME, "user");
+ curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret");
+
+ /* This will retreive message 1 from the user's mailbox */
+ curl_easy_setopt(curl, CURLOPT_URL, "pop3://pop.example.com/1");
+
+ /* In this example, we'll start with a plain text connection, and upgrade
+ * to Transport Layer Security (TLS) using the STLS command. Be careful of
+ * using CURLUSESSL_TRY here, because if TLS upgrade fails, the transfer
+ * will continue anyway - see the security discussion in the libcurl
+ * tutorial for more details. */
+ curl_easy_setopt(curl, CURLOPT_USE_SSL, (long)CURLUSESSL_ALL);
+
+ /* If your server doesn't have a valid certificate, then you can disable
+ * part of the Transport Layer Security protection by setting the
+ * CURLOPT_SSL_VERIFYPEER and CURLOPT_SSL_VERIFYHOST options to 0 (false).
+ * curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
+ * curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
+ * That is, in general, a bad idea. It is still better than sending your
+ * authentication details in plain text though.
+ * Instead, you should get the issuer certificate (or the host certificate
+ * if the certificate is self-signed) and add it to the set of certificates
+ * that are known to libcurl using CURLOPT_CAINFO and/or CURLOPT_CAPATH. See
+ * docs/SSLCERTS for more information. */
+ curl_easy_setopt(curl, CURLOPT_CAINFO, "/path/to/certificate.pem");
+
+ /* Since the traffic will be encrypted, it is very useful to turn on debug
+ * information within libcurl to see what is happening during the
+ * transfer */
+ curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
+
+ /* Perform the retr */
+ res = curl_easy_perform(curl);
+
+ /* Check for errors */
+ if(res != CURLE_OK)
+ fprintf(stderr, "curl_easy_perform() failed: %s\n",
+ curl_easy_strerror(res));
+
+ /* Always cleanup */
+ curl_easy_cleanup(curl);
+ }
+
+ return (int)res;
+}
diff --git a/docs/examples/pop3-top.c b/docs/examples/pop3-top.c
new file mode 100644
index 00000000..21cee889
--- /dev/null
+++ b/docs/examples/pop3-top.c
@@ -0,0 +1,61 @@
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at http://curl.haxx.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ***************************************************************************/
+#include <stdio.h>
+#include <curl/curl.h>
+
+/* This is a simple example showing how to retrieve only the headers of a mail
+ * using libcurl's POP3 capabilities.
+ *
+ * Note that this example requires libcurl 7.26.0 or above.
+ */
+
+int main(void)
+{
+ CURL *curl;
+ CURLcode res = CURLE_OK;
+
+ curl = curl_easy_init();
+ if(curl) {
+ /* Set username and password */
+ curl_easy_setopt(curl, CURLOPT_USERNAME, "user");
+ curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret");
+
+ /* This is just the server URL */
+ curl_easy_setopt(curl, CURLOPT_URL, "pop3://pop.example.com");
+
+ /* Set the TOP command for message 1 to only include the headers */
+ curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "TOP 1 0");
+
+ /* Perform the custom request */
+ res = curl_easy_perform(curl);
+
+ /* Check for errors */
+ if(res != CURLE_OK)
+ fprintf(stderr, "curl_easy_perform() failed: %s\n",
+ curl_easy_strerror(res));
+
+ /* Always cleanup */
+ curl_easy_cleanup(curl);
+ }
+
+ return (int)res;
+}
diff --git a/docs/examples/pop3-uidl.c b/docs/examples/pop3-uidl.c
new file mode 100644
index 00000000..debb1791
--- /dev/null
+++ b/docs/examples/pop3-uidl.c
@@ -0,0 +1,61 @@
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at http://curl.haxx.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ***************************************************************************/
+#include <stdio.h>
+#include <curl/curl.h>
+
+/* This is a simple example using libcurl's POP3 capabilities to list the
+ * contents of a mailbox by unique ID.
+ *
+ * Note that this example requires libcurl 7.26.0 or above.
+ */
+
+int main(void)
+{
+ CURL *curl;
+ CURLcode res = CURLE_OK;
+
+ curl = curl_easy_init();
+ if(curl) {
+ /* Set username and password */
+ curl_easy_setopt(curl, CURLOPT_USERNAME, "user");
+ curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret");
+
+ /* This is just the server URL */
+ curl_easy_setopt(curl, CURLOPT_URL, "pop3://pop.example.com");
+
+ /* Set the UIDL command */
+ curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "UIDL");
+
+ /* Perform the custom request */
+ res = curl_easy_perform(curl);
+
+ /* Check for errors */
+ if(res != CURLE_OK)
+ fprintf(stderr, "curl_easy_perform() failed: %s\n",
+ curl_easy_strerror(res));
+
+ /* Always cleanup */
+ curl_easy_cleanup(curl);
+ }
+
+ return (int)res;
+}
diff --git a/docs/examples/simplesmtp.c b/docs/examples/simplesmtp.c
deleted file mode 100644
index df851624..00000000
--- a/docs/examples/simplesmtp.c
+++ /dev/null
@@ -1,87 +0,0 @@
-/***************************************************************************
- * _ _ ____ _
- * Project ___| | | | _ \| |
- * / __| | | | |_) | |
- * | (__| |_| | _ <| |___
- * \___|\___/|_| \_\_____|
- *
- * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
- *
- * This software is licensed as described in the file COPYING, which
- * you should have received as part of this distribution. The terms
- * are also available at http://curl.haxx.se/docs/copyright.html.
- *
- * You may opt to use, copy, modify, merge, publish, distribute and/or sell
- * copies of the Software, and permit persons to whom the Software is
- * furnished to do so, under the terms of the COPYING file.
- *
- * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
- * KIND, either express or implied.
- *
- ***************************************************************************/
-#include <stdio.h>
-#include <string.h>
-#include <curl/curl.h>
-
-int main(void)
-{
- CURL *curl;
- CURLcode res;
- struct curl_slist *recipients = NULL;
-
- /* value for envelope reverse-path */
- static const char *from = "<bradh@example.com>";
-
- /* this becomes the envelope forward-path */
- static const char *to = "<bradh@example.net>";
-
- curl = curl_easy_init();
- if(curl) {
- /* this is the URL for your mailserver - you can also use an smtps:// URL
- * here */
- curl_easy_setopt(curl, CURLOPT_URL, "smtp://mail.example.net.");
-
- /* Note that this option isn't strictly required, omitting it will result in
- * libcurl will sent the MAIL FROM command with no sender data. All
- * autoresponses should have an empty reverse-path, and should be directed
- * to the address in the reverse-path which triggered them. Otherwise, they
- * could cause an endless loop. See RFC 5321 Section 4.5.5 for more details.
- */
- curl_easy_setopt(curl, CURLOPT_MAIL_FROM, from);
-
- /* Note that the CURLOPT_MAIL_RCPT takes a list, not a char array. */
- recipients = curl_slist_append(recipients, to);
- curl_easy_setopt(curl, CURLOPT_MAIL_RCPT, recipients);
-
- /* You provide the payload (headers and the body of the message) as the
- * "data" element. There are two choices, either:
- * - provide a callback function and specify the function name using the
- * CURLOPT_READFUNCTION option; or
- * - just provide a FILE pointer that can be used to read the data from.
- * The easiest case is just to read from standard input, (which is available
- * as a FILE pointer) as shown here.
- */
- curl_easy_setopt(curl, CURLOPT_READDATA, stdin);
-
- /* send the message (including headers) */
- res = curl_easy_perform(curl);
- /* Check for errors */
- if(res != CURLE_OK)
- fprintf(stderr, "curl_easy_perform() failed: %s\n",
- curl_easy_strerror(res));
-
- /* free the list of recipients */
- curl_slist_free_all(recipients);
-
- /* curl won't send the QUIT command until you call cleanup, so you should be
- * able to re-use this connection for additional messages (setting
- * CURLOPT_MAIL_FROM and CURLOPT_MAIL_RCPT as required, and calling
- * curl_easy_perform() again. It may not be a good idea to keep the
- * connection open for a very long time though (more than a few minutes may
- * result in the server timing out the connection), and you do want to clean
- * up in the end.
- */
- curl_easy_cleanup(curl);
- }
- return 0;
-}
diff --git a/docs/examples/smtp-expn.c b/docs/examples/smtp-expn.c
new file mode 100644
index 00000000..0322d2fc
--- /dev/null
+++ b/docs/examples/smtp-expn.c
@@ -0,0 +1,73 @@
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at http://curl.haxx.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ***************************************************************************/
+#include <stdio.h>
+#include <string.h>
+#include <curl/curl.h>
+
+/* This is a simple example showing how to expand an email mailing list.
+ *
+ * Notes:
+ *
+ * 1) This example requires libcurl 7.34.0 or above.
+ * 2) Not all email servers support this command.
+ */
+
+int main(void)
+{
+ CURL *curl;
+ CURLcode res;
+ struct curl_slist *recipients = NULL;
+
+ curl = curl_easy_init();
+ if(curl) {
+ /* This is the URL for your mailserver */
+ curl_easy_setopt(curl, CURLOPT_URL, "smtp://mail.example.com");
+
+ /* Note that the CURLOPT_MAIL_RCPT takes a list, not a char array */
+ recipients = curl_slist_append(recipients, "Friends");
+ curl_easy_setopt(curl, CURLOPT_MAIL_RCPT, recipients);
+
+ /* Set the EXPN command */
+ curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "EXPN");
+
+ /* Perform the custom request */
+ res = curl_easy_perform(curl);
+
+ /* Check for errors */
+ if(res != CURLE_OK)
+ fprintf(stderr, "curl_easy_perform() failed: %s\n",
+ curl_easy_strerror(res));
+
+ /* Free the list of recipients */
+ curl_slist_free_all(recipients);
+
+ /* Curl won't send the QUIT command until you call cleanup, so you should
+ * be able to re-use this connection for additional requests. It may not be
+ * a good idea to keep the connection open for a very long time though
+ * (more than a few minutes may result in the server timing out the
+ * connection) and you do want to clean up in the end.
+ */
+ curl_easy_cleanup(curl);
+ }
+
+ return 0;
+}
diff --git a/docs/examples/smtp-mail.c b/docs/examples/smtp-mail.c
new file mode 100644
index 00000000..af4d1b65
--- /dev/null
+++ b/docs/examples/smtp-mail.c
@@ -0,0 +1,137 @@
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at http://curl.haxx.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ***************************************************************************/
+#include <stdio.h>
+#include <string.h>
+#include <curl/curl.h>
+
+/* This is a simple example showing how to send mail using libcurl's SMTP
+ * capabilities. For an exmaple of using the multi interface please see
+ * smtp-multi.c.
+ *
+ * Note that this example requires libcurl 7.20.0 or above.
+ */
+
+#define FROM "<sender@example.org>"
+#define TO "<addressee@example.net>"
+#define CC "<info@example.org>"
+
+static const char *payload_text[] = {
+ "Date: Mon, 29 Nov 2010 21:54:29 +1100\r\n",
+ "To: " TO "\r\n",
+ "From: " FROM "(Example User)\r\n",
+ "Cc: " CC "(Another example User)\r\n",
+ "Message-ID: <dcd7cb36-11db-487a-9f3a-e652a9458efd@rfcpedant.example.org>\r\n",
+ "Subject: SMTP example message\r\n",
+ "\r\n", /* empty line to divide headers from body, see RFC5322 */
+ "The body of the message starts here.\r\n",
+ "\r\n",
+ "It could be a lot of lines, could be MIME encoded, whatever.\r\n",
+ "Check RFC5322.\r\n",
+ NULL
+};
+
+struct upload_status {
+ int lines_read;
+};
+
+static size_t payload_source(void *ptr, size_t size, size_t nmemb, void *userp)
+{
+ struct upload_status *upload_ctx = (struct upload_status *)userp;
+ const char *data;
+
+ if((size == 0) || (nmemb == 0) || ((size*nmemb) < 1)) {
+ return 0;
+ }
+
+ data = payload_text[upload_ctx->lines_read];
+
+ if(data) {
+ size_t len = strlen(data);
+ memcpy(ptr, data, len);
+ upload_ctx->lines_read++;
+
+ return len;
+ }
+
+ return 0;
+}
+
+int main(void)
+{
+ CURL *curl;
+ CURLcode res = CURLE_OK;
+ struct curl_slist *recipients = NULL;
+ struct upload_status upload_ctx;
+
+ upload_ctx.lines_read = 0;
+
+ curl = curl_easy_init();
+ if(curl) {
+ /* This is the URL for your mailserver */
+ curl_easy_setopt(curl, CURLOPT_URL, "smtp://mail.example.com");
+
+ /* Note that this option isn't strictly required, omitting it will result in
+ * libcurl sending the MAIL FROM command with empty sender data. All
+ * autoresponses should have an empty reverse-path, and should be directed
+ * to the address in the reverse-path which triggered them. Otherwise, they
+ * could cause an endless loop. See RFC 5321 Section 4.5.5 for more details.
+ */
+ curl_easy_setopt(curl, CURLOPT_MAIL_FROM, FROM);
+
+ /* Add two recipients, in this particular case they correspond to the
+ * To: and Cc: addressees in the header, but they could be any kind of
+ * recipient. */
+ recipients = curl_slist_append(recipients, TO);
+ recipients = curl_slist_append(recipients, CC);
+ curl_easy_setopt(curl, CURLOPT_MAIL_RCPT, recipients);
+
+ /* We're using a callback function to specify the payload (the headers and
+ * body of the message). You could just use the CURLOPT_READDATA option to
+ * specify a FILE pointer to read from. */
+ curl_easy_setopt(curl, CURLOPT_READFUNCTION, payload_source);
+ curl_easy_setopt(curl, CURLOPT_READDATA, &upload_ctx);
+ curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
+
+ /* Send the message */
+ res = curl_easy_perform(curl);
+
+ /* Check for errors */
+ if(res != CURLE_OK)
+ fprintf(stderr, "curl_easy_perform() failed: %s\n",
+ curl_easy_strerror(res));
+
+ /* Free the list of recipients */
+ curl_slist_free_all(recipients);
+
+ /* curl won't send the QUIT command until you call cleanup, so you should be
+ * able to re-use this connection for additional messages (setting
+ * CURLOPT_MAIL_FROM and CURLOPT_MAIL_RCPT as required, and calling
+ * curl_easy_perform() again. It may not be a good idea to keep the
+ * connection open for a very long time though (more than a few minutes may
+ * result in the server timing out the connection), and you do want to clean
+ * up in the end.
+ */
+ curl_easy_cleanup(curl);
+ }
+
+ return (int)res;
+}
diff --git a/docs/examples/smtp-multi.c b/docs/examples/smtp-multi.c
index 6462aff2..7f3d333d 100644
--- a/docs/examples/smtp-multi.c
+++ b/docs/examples/smtp-multi.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -19,139 +19,151 @@
* KIND, either express or implied.
*
***************************************************************************/
-/* This is an example application source code sending SMTP mail using the
- * multi interface.
- */
-
#include <string.h>
#include <curl/curl.h>
-/*
- * This is the list of basic details you need to tweak to get things right.
+/* This is an example showing how to send mail using libcurl's SMTP
+ * capabilities. It builds on the smtp-mail.c example to demonstrate how to use
+ * libcurl's multi interface.
+ *
+ * Note that this example requires libcurl 7.20.0 or above.
*/
-#define USERNAME "user@example.com"
-#define PASSWORD "123qwerty"
-#define SMTPSERVER "smtp.example.com"
-#define SMTPPORT ":587" /* it is a colon+port string, but you can set it
- to "" to use the default port */
-#define RECIPIENT "<recipient@example.com>"
-#define MAILFROM "<realuser@example.com>"
+
+#define FROM "<sender@example.com>"
+#define TO "<recipient@example.com>"
+#define CC "<info@example.com>"
#define MULTI_PERFORM_HANG_TIMEOUT 60 * 1000
-/* Note that you should include the actual meta data headers here as well if
- you want the mail to have a Subject, another From:, show a To: or whatever
- you think your mail should feature! */
-static const char *text[]={
- "one\n",
- "two\n",
- "three\n",
- " Hello, this is CURL email SMTP\n",
+static const char *payload_text[] = {
+ "Date: Mon, 29 Nov 2010 21:54:29 +1100\r\n",
+ "To: " TO "\r\n",
+ "From: " FROM "(Example User)\r\n",
+ "Cc: " CC "(Another example User)\r\n",
+ "Message-ID: <dcd7cb36-11db-487a-9f3a-e652a9458efd@rfcpedant.example.org>\r\n",
+ "Subject: SMTP multi example message\r\n",
+ "\r\n", /* empty line to divide headers from body, see RFC5322 */
+ "The body of the message starts here.\r\n",
+ "\r\n",
+ "It could be a lot of lines, could be MIME encoded, whatever.\r\n",
+ "Check RFC5322.\r\n",
NULL
};
-struct WriteThis {
- int counter;
+struct upload_status {
+ int lines_read;
};
-static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *userp)
+static size_t payload_source(void *ptr, size_t size, size_t nmemb, void *userp)
{
- struct WriteThis *pooh = (struct WriteThis *)userp;
+ struct upload_status *upload_ctx = (struct upload_status *)userp;
const char *data;
- if(size*nmemb < 1)
+ if((size == 0) || (nmemb == 0) || ((size*nmemb) < 1)) {
return 0;
+ }
- data = text[pooh->counter];
+ data = payload_text[upload_ctx->lines_read];
if(data) {
size_t len = strlen(data);
memcpy(ptr, data, len);
- pooh->counter++; /* advance pointer */
+ upload_ctx->lines_read++;
+
return len;
}
- return 0; /* no more data left to deliver */
+
+ return 0;
}
static struct timeval tvnow(void)
{
- /*
- ** time() returns the value of time in seconds since the Epoch.
- */
struct timeval now;
+
+ /* time() returns the value of time in seconds since the epoch */
now.tv_sec = (long)time(NULL);
now.tv_usec = 0;
+
return now;
}
static long tvdiff(struct timeval newer, struct timeval older)
{
- return (newer.tv_sec-older.tv_sec)*1000+
- (newer.tv_usec-older.tv_usec)/1000;
+ return (newer.tv_sec - older.tv_sec) * 1000 +
+ (newer.tv_usec - older.tv_usec) / 1000;
}
int main(void)
{
- CURL *curl;
- CURLM *mcurl;
- int still_running = 1;
- struct timeval mp_start;
- struct WriteThis pooh;
- struct curl_slist* rcpt_list = NULL;
+ CURL *curl;
+ CURLM *mcurl;
+ int still_running = 1;
+ struct timeval mp_start;
+ struct curl_slist *recipients = NULL;
+ struct upload_status upload_ctx;
+
+ upload_ctx.lines_read = 0;
- pooh.counter = 0;
+ curl_global_init(CURL_GLOBAL_DEFAULT);
- curl_global_init(CURL_GLOBAL_DEFAULT);
+ curl = curl_easy_init();
+ if(!curl)
+ return 1;
- curl = curl_easy_init();
- if(!curl)
- return 1;
+ mcurl = curl_multi_init();
+ if(!mcurl)
+ return 2;
- mcurl = curl_multi_init();
- if(!mcurl)
- return 2;
+ /* This is the URL for your mailserver */
+ curl_easy_setopt(curl, CURLOPT_URL, "smtp://mail.example.com");
- rcpt_list = curl_slist_append(rcpt_list, RECIPIENT);
- /* more addresses can be added here
- rcpt_list = curl_slist_append(rcpt_list, "<others@example.com>");
+ /* Note that this option isn't strictly required, omitting it will result in
+ * libcurl sending the MAIL FROM command with empty sender data. All
+ * autoresponses should have an empty reverse-path, and should be directed
+ * to the address in the reverse-path which triggered them. Otherwise, they
+ * could cause an endless loop. See RFC 5321 Section 4.5.5 for more details.
*/
+ curl_easy_setopt(curl, CURLOPT_MAIL_FROM, FROM);
- curl_easy_setopt(curl, CURLOPT_URL, "smtp://" SMTPSERVER SMTPPORT);
- curl_easy_setopt(curl, CURLOPT_USERNAME, USERNAME);
- curl_easy_setopt(curl, CURLOPT_PASSWORD, PASSWORD);
- curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback);
- curl_easy_setopt(curl, CURLOPT_MAIL_FROM, MAILFROM);
- curl_easy_setopt(curl, CURLOPT_MAIL_RCPT, rcpt_list);
- curl_easy_setopt(curl, CURLOPT_USE_SSL, (long)CURLUSESSL_ALL);
- curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
- curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
- curl_easy_setopt(curl, CURLOPT_READDATA, &pooh);
- curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
- curl_easy_setopt(curl, CURLOPT_SSLVERSION, 0L);
- curl_easy_setopt(curl, CURLOPT_SSL_SESSIONID_CACHE, 0L);
- curl_multi_add_handle(mcurl, curl);
-
- mp_start = tvnow();
-
- /* we start some action by calling perform right away */
+ /* Add two recipients, in this particular case they correspond to the
+ * To: and Cc: addressees in the header, but they could be any kind of
+ * recipient. */
+ recipients = curl_slist_append(recipients, TO);
+ recipients = curl_slist_append(recipients, CC);
+ curl_easy_setopt(curl, CURLOPT_MAIL_RCPT, recipients);
+
+ /* We're using a callback function to specify the payload (the headers and
+ * body of the message). You could just use the CURLOPT_READDATA option to
+ * specify a FILE pointer to read from. */
+ curl_easy_setopt(curl, CURLOPT_READFUNCTION, payload_source);
+ curl_easy_setopt(curl, CURLOPT_READDATA, &upload_ctx);
+ curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
+
+ /* Tell the multi stack about our easy handle */
+ curl_multi_add_handle(mcurl, curl);
+
+ /* Record the start time which we can use later */
+ mp_start = tvnow();
+
+ /* We start some action by calling perform right away */
curl_multi_perform(mcurl, &still_running);
while(still_running) {
struct timeval timeout;
- int rc; /* select() return code */
-
fd_set fdread;
fd_set fdwrite;
fd_set fdexcep;
int maxfd = -1;
+ int rc;
long curl_timeo = -1;
+ /* Initialise the file descriptors */
FD_ZERO(&fdread);
FD_ZERO(&fdwrite);
FD_ZERO(&fdexcep);
- /* set a suitable timeout to play around with */
+ /* Set a suitable timeout to play around with */
timeout.tv_sec = 1;
timeout.tv_usec = 0;
@@ -164,7 +176,7 @@ int main(void)
timeout.tv_usec = (curl_timeo % 1000) * 1000;
}
- /* get file descriptors from the transfers */
+ /* Get file descriptors from the transfers */
curl_multi_fdset(mcurl, &fdread, &fdwrite, &fdexcep, &maxfd);
/* In a real-world program you OF COURSE check the return code of the
@@ -172,32 +184,32 @@ int main(void)
greater or equal than -1. We call select(maxfd + 1, ...), specially in
case of (maxfd == -1), we call select(0, ...), which is basically equal
to sleep. */
-
rc = select(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);
- if (tvdiff(tvnow(), mp_start) > MULTI_PERFORM_HANG_TIMEOUT) {
- fprintf(stderr, "ABORTING TEST, since it seems "
- "that it would have run forever.\n");
+ if(tvdiff(tvnow(), mp_start) > MULTI_PERFORM_HANG_TIMEOUT) {
+ fprintf(stderr,
+ "ABORTING: Since it seems that we would have run forever.\n");
break;
}
switch(rc) {
- case -1:
- /* select error */
+ case -1: /* select error */
break;
- case 0: /* timeout */
- default: /* action */
+ case 0: /* timeout */
+ default: /* action */
curl_multi_perform(mcurl, &still_running);
break;
}
}
- curl_slist_free_all(rcpt_list);
+ /* Free the list of recipients */
+ curl_slist_free_all(recipients);
+
+ /* Always cleanup */
curl_multi_remove_handle(mcurl, curl);
curl_multi_cleanup(mcurl);
curl_easy_cleanup(curl);
curl_global_cleanup();
+
return 0;
}
-
-
diff --git a/docs/examples/smtp-ssl.c b/docs/examples/smtp-ssl.c
new file mode 100644
index 00000000..9a68a7ff
--- /dev/null
+++ b/docs/examples/smtp-ssl.c
@@ -0,0 +1,161 @@
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at http://curl.haxx.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ***************************************************************************/
+#include <stdio.h>
+#include <string.h>
+#include <curl/curl.h>
+
+/* This is a simple example showing how to send mail using libcurl's SMTP
+ * capabilities. It builds on the smtp-mail.c example to add authentication
+ * and, more importantly, transport security to protect the authentication
+ * details from being snooped.
+ *
+ * Note that this example requires libcurl 7.20.0 or above.
+ */
+
+#define FROM "<sender@example.org>"
+#define TO "<addressee@example.net>"
+#define CC "<info@example.org>"
+
+static const char *payload_text[] = {
+ "Date: Mon, 29 Nov 2010 21:54:29 +1100\r\n",
+ "To: " TO "\r\n",
+ "From: " FROM "(Example User)\r\n",
+ "Cc: " CC "(Another example User)\r\n",
+ "Message-ID: <dcd7cb36-11db-487a-9f3a-e652a9458efd@rfcpedant.example.org>\r\n",
+ "Subject: SMTP SSL example message\r\n",
+ "\r\n", /* empty line to divide headers from body, see RFC5322 */
+ "The body of the message starts here.\r\n",
+ "\r\n",
+ "It could be a lot of lines, could be MIME encoded, whatever.\r\n",
+ "Check RFC5322.\r\n",
+ NULL
+};
+
+struct upload_status {
+ int lines_read;
+};
+
+static size_t payload_source(void *ptr, size_t size, size_t nmemb, void *userp)
+{
+ struct upload_status *upload_ctx = (struct upload_status *)userp;
+ const char *data;
+
+ if((size == 0) || (nmemb == 0) || ((size*nmemb) < 1)) {
+ return 0;
+ }
+
+ data = payload_text[upload_ctx->lines_read];
+
+ if(data) {
+ size_t len = strlen(data);
+ memcpy(ptr, data, len);
+ upload_ctx->lines_read++;
+
+ return len;
+ }
+
+ return 0;
+}
+
+int main(void)
+{
+ CURL *curl;
+ CURLcode res = CURLE_OK;
+ struct curl_slist *recipients = NULL;
+ struct upload_status upload_ctx;
+
+ upload_ctx.lines_read = 0;
+
+ curl = curl_easy_init();
+ if(curl) {
+ /* Set username and password */
+ curl_easy_setopt(curl, CURLOPT_USERNAME, "user");
+ curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret");
+
+ /* This is the URL for your mailserver. Note the use of smtps:// rather
+ * than smtp:// to request a SSL based connection. */
+ curl_easy_setopt(curl, CURLOPT_URL, "smtps://mainserver.example.net");
+
+ /* If you want to connect to a site who isn't using a certificate that is
+ * signed by one of the certs in the CA bundle you have, you can skip the
+ * verification of the server's certificate. This makes the connection
+ * A LOT LESS SECURE.
+ *
+ * If you have a CA cert for the server stored someplace else than in the
+ * default bundle, then the CURLOPT_CAPATH option might come handy for
+ * you. */
+#ifdef SKIP_PEER_VERIFICATION
+ curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
+#endif
+
+ /* If the site you're connecting to uses a different host name that what
+ * they have mentioned in their server certificate's commonName (or
+ * subjectAltName) fields, libcurl will refuse to connect. You can skip
+ * this check, but this will make the connection less secure. */
+#ifdef SKIP_HOSTNAME_VERFICATION
+ curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
+#endif
+
+ /* Note that this option isn't strictly required, omitting it will result in
+ * libcurl sending the MAIL FROM command with empty sender data. All
+ * autoresponses should have an empty reverse-path, and should be directed
+ * to the address in the reverse-path which triggered them. Otherwise, they
+ * could cause an endless loop. See RFC 5321 Section 4.5.5 for more details.
+ */
+ curl_easy_setopt(curl, CURLOPT_MAIL_FROM, FROM);
+
+ /* Add two recipients, in this particular case they correspond to the
+ * To: and Cc: addressees in the header, but they could be any kind of
+ * recipient. */
+ recipients = curl_slist_append(recipients, TO);
+ recipients = curl_slist_append(recipients, CC);
+ curl_easy_setopt(curl, CURLOPT_MAIL_RCPT, recipients);
+
+ /* We're using a callback function to specify the payload (the headers and
+ * body of the message). You could just use the CURLOPT_READDATA option to
+ * specify a FILE pointer to read from. */
+ curl_easy_setopt(curl, CURLOPT_READFUNCTION, payload_source);
+ curl_easy_setopt(curl, CURLOPT_READDATA, &upload_ctx);
+ curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
+
+ /* Since the traffic will be encrypted, it is very useful to turn on debug
+ * information within libcurl to see what is happening during the
+ * transfer */
+ curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
+
+ /* Send the message */
+ res = curl_easy_perform(curl);
+
+ /* Check for errors */
+ if(res != CURLE_OK)
+ fprintf(stderr, "curl_easy_perform() failed: %s\n",
+ curl_easy_strerror(res));
+
+ /* Free the list of recipients */
+ curl_slist_free_all(recipients);
+
+ /* Always cleanup */
+ curl_easy_cleanup(curl);
+ }
+
+ return (int)res;
+}
diff --git a/docs/examples/smtp-tls.c b/docs/examples/smtp-tls.c
index 3635c103..4872dbdf 100644
--- a/docs/examples/smtp-tls.c
+++ b/docs/examples/smtp-tls.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -24,26 +24,29 @@
#include <curl/curl.h>
/* This is a simple example showing how to send mail using libcurl's SMTP
- * capabilities. It builds on the simplesmtp.c example, adding some
- * authentication and transport security.
+ * capabilities. It builds on the smtp-mail.c example to add authentication
+ * and, more importantly, transport security to protect the authentication
+ * details from being snooped.
+ *
+ * Note that this example requires libcurl 7.20.0 or above.
*/
#define FROM "<sender@example.org>"
#define TO "<addressee@example.net>"
#define CC "<info@example.org>"
-static const char *payload_text[]={
- "Date: Mon, 29 Nov 2010 21:54:29 +1100\n",
- "To: " TO "\n",
- "From: " FROM "(Example User)\n",
- "Cc: " CC "(Another example User)\n",
- "Message-ID: <dcd7cb36-11db-487a-9f3a-e652a9458efd@rfcpedant.example.org>\n",
- "Subject: SMTP TLS example message\n",
- "\n", /* empty line to divide headers from body, see RFC5322 */
- "The body of the message starts here.\n",
- "\n",
- "It could be a lot of lines, could be MIME encoded, whatever.\n",
- "Check RFC5322.\n",
+static const char *payload_text[] = {
+ "Date: Mon, 29 Nov 2010 21:54:29 +1100\r\n",
+ "To: " TO "\r\n",
+ "From: " FROM "(Example User)\r\n",
+ "Cc: " CC "(Another example User)\r\n",
+ "Message-ID: <dcd7cb36-11db-487a-9f3a-e652a9458efd@rfcpedant.example.org>\r\n",
+ "Subject: SMTP TLS example message\r\n",
+ "\r\n", /* empty line to divide headers from body, see RFC5322 */
+ "The body of the message starts here.\r\n",
+ "\r\n",
+ "It could be a lot of lines, could be MIME encoded, whatever.\r\n",
+ "Check RFC5322.\r\n",
NULL
};
@@ -56,33 +59,38 @@ static size_t payload_source(void *ptr, size_t size, size_t nmemb, void *userp)
struct upload_status *upload_ctx = (struct upload_status *)userp;
const char *data;
- if ((size == 0) || (nmemb == 0) || ((size*nmemb) < 1)) {
+ if((size == 0) || (nmemb == 0) || ((size*nmemb) < 1)) {
return 0;
}
data = payload_text[upload_ctx->lines_read];
- if (data) {
+ if(data) {
size_t len = strlen(data);
memcpy(ptr, data, len);
- upload_ctx->lines_read ++;
+ upload_ctx->lines_read++;
+
return len;
}
+
return 0;
}
-
int main(void)
{
CURL *curl;
- CURLcode res;
+ CURLcode res = CURLE_OK;
struct curl_slist *recipients = NULL;
struct upload_status upload_ctx;
upload_ctx.lines_read = 0;
curl = curl_easy_init();
- if (curl) {
+ if(curl) {
+ /* Set username and password */
+ curl_easy_setopt(curl, CURLOPT_USERNAME, "user");
+ curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret");
+
/* This is the URL for your mailserver. Note the use of port 587 here,
* instead of the normal SMTP port (25). Port 587 is commonly used for
* secure mail submission (see RFC4403), but you should use whatever
@@ -106,18 +114,17 @@ int main(void)
* Instead, you should get the issuer certificate (or the host certificate
* if the certificate is self-signed) and add it to the set of certificates
* that are known to libcurl using CURLOPT_CAINFO and/or CURLOPT_CAPATH. See
- * docs/SSLCERTS for more information.
- */
+ * docs/SSLCERTS for more information. */
curl_easy_setopt(curl, CURLOPT_CAINFO, "/path/to/certificate.pem");
- /* A common reason for requiring transport security is to protect
- * authentication details (user names and passwords) from being "snooped"
- * on the network. Here is how the user name and password are provided: */
- curl_easy_setopt(curl, CURLOPT_USERNAME, "user@example.net");
- curl_easy_setopt(curl, CURLOPT_PASSWORD, "P@ssw0rd");
-
- /* value for envelope reverse-path */
+ /* Note that this option isn't strictly required, omitting it will result in
+ * libcurl sending the MAIL FROM command with empty sender data. All
+ * autoresponses should have an empty reverse-path, and should be directed
+ * to the address in the reverse-path which triggered them. Otherwise, they
+ * could cause an endless loop. See RFC 5321 Section 4.5.5 for more details.
+ */
curl_easy_setopt(curl, CURLOPT_MAIL_FROM, FROM);
+
/* Add two recipients, in this particular case they correspond to the
* To: and Cc: addressees in the header, but they could be any kind of
* recipient. */
@@ -125,28 +132,32 @@ int main(void)
recipients = curl_slist_append(recipients, CC);
curl_easy_setopt(curl, CURLOPT_MAIL_RCPT, recipients);
- /* In this case, we're using a callback function to specify the data. You
- * could just use the CURLOPT_READDATA option to specify a FILE pointer to
- * read from.
- */
+ /* We're using a callback function to specify the payload (the headers and
+ * body of the message). You could just use the CURLOPT_READDATA option to
+ * specify a FILE pointer to read from. */
curl_easy_setopt(curl, CURLOPT_READFUNCTION, payload_source);
curl_easy_setopt(curl, CURLOPT_READDATA, &upload_ctx);
+ curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
/* Since the traffic will be encrypted, it is very useful to turn on debug
* information within libcurl to see what is happening during the transfer.
*/
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
- /* send the message (including headers) */
+ /* Send the message */
res = curl_easy_perform(curl);
+
/* Check for errors */
if(res != CURLE_OK)
fprintf(stderr, "curl_easy_perform() failed: %s\n",
curl_easy_strerror(res));
- /* free the list of recipients and clean up */
+ /* Free the list of recipients */
curl_slist_free_all(recipients);
+
+ /* Always cleanup */
curl_easy_cleanup(curl);
}
- return 0;
+
+ return (int)res;
}
diff --git a/docs/examples/smtp-vrfy.c b/docs/examples/smtp-vrfy.c
new file mode 100644
index 00000000..4e44cea9
--- /dev/null
+++ b/docs/examples/smtp-vrfy.c
@@ -0,0 +1,73 @@
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at http://curl.haxx.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ***************************************************************************/
+#include <stdio.h>
+#include <string.h>
+#include <curl/curl.h>
+
+/* This is a simple example showing how to verify an email address from an
+ * SMTP server.
+ *
+ * Notes:
+ *
+ * 1) This example requires libcurl 7.34.0 or above.
+ * 2) Not all email servers support this command and even if your email server
+ * does support it, it may respond with a 252 response code even though the
+ * address doesn't exist.
+ */
+
+int main(void)
+{
+ CURL *curl;
+ CURLcode res;
+ struct curl_slist *recipients = NULL;
+
+ curl = curl_easy_init();
+ if(curl) {
+ /* This is the URL for your mailserver */
+ curl_easy_setopt(curl, CURLOPT_URL, "smtp://mail.example.com");
+
+ /* Note that the CURLOPT_MAIL_RCPT takes a list, not a char array */
+ recipients = curl_slist_append(recipients, "<recipient@example.com>");
+ curl_easy_setopt(curl, CURLOPT_MAIL_RCPT, recipients);
+
+ /* Perform the VRFY */
+ res = curl_easy_perform(curl);
+
+ /* Check for errors */
+ if(res != CURLE_OK)
+ fprintf(stderr, "curl_easy_perform() failed: %s\n",
+ curl_easy_strerror(res));
+
+ /* Free the list of recipients */
+ curl_slist_free_all(recipients);
+
+ /* Curl won't send the QUIT command until you call cleanup, so you should
+ * be able to re-use this connection for additional requests. It may not be
+ * a good idea to keep the connection open for a very long time though
+ * (more than a few minutes may result in the server timing out the
+ * connection) and you do want to clean up in the end.
+ */
+ curl_easy_cleanup(curl);
+ }
+
+ return 0;
+}
diff --git a/docs/libcurl/Makefile.in b/docs/libcurl/Makefile.in
index d3172f83..1313a0de 100644
--- a/docs/libcurl/Makefile.in
+++ b/docs/libcurl/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.14 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
diff --git a/docs/libcurl/curl_easy_cleanup.pdf b/docs/libcurl/curl_easy_cleanup.pdf
index 1f5d952b..f7a7b937 100644
--- a/docs/libcurl/curl_easy_cleanup.pdf
+++ b/docs/libcurl/curl_easy_cleanup.pdf
Binary files differ
diff --git a/docs/libcurl/curl_easy_duphandle.pdf b/docs/libcurl/curl_easy_duphandle.pdf
index 5addab28..912d1ecb 100644
--- a/docs/libcurl/curl_easy_duphandle.pdf
+++ b/docs/libcurl/curl_easy_duphandle.pdf
Binary files differ
diff --git a/docs/libcurl/curl_easy_escape.pdf b/docs/libcurl/curl_easy_escape.pdf
index dcdbdb75..df2eda05 100644
--- a/docs/libcurl/curl_easy_escape.pdf
+++ b/docs/libcurl/curl_easy_escape.pdf
@@ -69,12 +69,12 @@ endobj
<?adobe-xap-filters esc="CRLF"?>
<x:xmpmeta xmlns:x='adobe:ns:meta/' x:xmptk='XMP toolkit 2.9.1-13, framework 1.6'>
<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:iX='http://ns.adobe.com/iX/1.0/'>
-<rdf:Description rdf:about='uuid:963a049a-9f0c-11ee-0000-e20d2ea3735f' xmlns:pdf='http://ns.adobe.com/pdf/1.3/' pdf:Producer='GPL Ghostscript 9.05'/>
-<rdf:Description rdf:about='uuid:963a049a-9f0c-11ee-0000-e20d2ea3735f' xmlns:xmp='http://ns.adobe.com/xap/1.0/'><xmp:ModifyDate>2013-12-17T08:51:29+01:00</xmp:ModifyDate>
-<xmp:CreateDate>2013-12-17T08:51:29+01:00</xmp:CreateDate>
+<rdf:Description rdf:about='uuid:e3478521-c0d0-11ee-0000-e20d2ea3735f' xmlns:pdf='http://ns.adobe.com/pdf/1.3/' pdf:Producer='GPL Ghostscript 9.05'/>
+<rdf:Description rdf:about='uuid:e3478521-c0d0-11ee-0000-e20d2ea3735f' xmlns:xmp='http://ns.adobe.com/xap/1.0/'><xmp:ModifyDate>2014-01-29T08:09:48+01:00</xmp:ModifyDate>
+<xmp:CreateDate>2014-01-29T08:09:48+01:00</xmp:CreateDate>
<xmp:CreatorTool>groff version 1.22.2</xmp:CreatorTool></rdf:Description>
-<rdf:Description rdf:about='uuid:963a049a-9f0c-11ee-0000-e20d2ea3735f' xmlns:xapMM='http://ns.adobe.com/xap/1.0/mm/' xapMM:DocumentID='uuid:963a049a-9f0c-11ee-0000-e20d2ea3735f'/>
-<rdf:Description rdf:about='uuid:963a049a-9f0c-11ee-0000-e20d2ea3735f' xmlns:dc='http://purl.org/dc/elements/1.1/' dc:format='application/pdf'><dc:title><rdf:Alt><rdf:li xml:lang='x-default'>Untitled</rdf:li></rdf:Alt></dc:title></rdf:Description>
+<rdf:Description rdf:about='uuid:e3478521-c0d0-11ee-0000-e20d2ea3735f' xmlns:xapMM='http://ns.adobe.com/xap/1.0/mm/' xapMM:DocumentID='uuid:e3478521-c0d0-11ee-0000-e20d2ea3735f'/>
+<rdf:Description rdf:about='uuid:e3478521-c0d0-11ee-0000-e20d2ea3735f' xmlns:dc='http://purl.org/dc/elements/1.1/' dc:format='application/pdf'><dc:title><rdf:Alt><rdf:li xml:lang='x-default'>Untitled</rdf:li></rdf:Alt></dc:title></rdf:Description>
</rdf:RDF>
</x:xmpmeta>
@@ -84,8 +84,8 @@ endstream
endobj
2 0 obj
<</Producer(GPL Ghostscript 9.05)
-/CreationDate(D:20131217085129+01'00')
-/ModDate(D:20131217085129+01'00')
+/CreationDate(D:20140129080948+01'00')
+/ModDate(D:20140129080948+01'00')
/Creator(groff version 1.22.2)>>endobj
xref
0 15
@@ -106,7 +106,7 @@ xref
0000002013 00000 n
trailer
<< /Size 15 /Root 1 0 R /Info 2 0 R
-/ID [<93699FC01B707A4A2B003439105A82E3><93699FC01B707A4A2B003439105A82E3>]
+/ID [<C642B0383E1D35318374DE21D12D6D5A><C642B0383E1D35318374DE21D12D6D5A>]
>>
startxref
3590
diff --git a/docs/libcurl/curl_easy_getinfo.pdf b/docs/libcurl/curl_easy_getinfo.pdf
index 7f96b95d..e0fde484 100644
--- a/docs/libcurl/curl_easy_getinfo.pdf
+++ b/docs/libcurl/curl_easy_getinfo.pdf
Binary files differ
diff --git a/docs/libcurl/curl_easy_init.pdf b/docs/libcurl/curl_easy_init.pdf
index e402cdbb..a67dd311 100644
--- a/docs/libcurl/curl_easy_init.pdf
+++ b/docs/libcurl/curl_easy_init.pdf
Binary files differ
diff --git a/docs/libcurl/curl_easy_pause.3 b/docs/libcurl/curl_easy_pause.3
index 402bb054..1e53477f 100644
--- a/docs/libcurl/curl_easy_pause.3
+++ b/docs/libcurl/curl_easy_pause.3
@@ -31,8 +31,8 @@ curl_easy_pause - pause and unpause a connection
Using this function, you can explicitly mark a running connection to get
paused, and you can unpause a connection that was previously paused.
-A connection can be paused by using this function or by letting the read
-or the write callbacks return the proper magic return code
+A connection can be paused by using this function or by letting the read or
+the write callbacks return the proper magic return code
(\fICURL_READFUNC_PAUSE\fP and \fICURL_WRITEFUNC_PAUSE\fP). A write callback
that returns pause signals to the library that it couldn't take care of any
data at all, and that data will then be delivered again to the callback when
@@ -68,6 +68,10 @@ Convenience define that unpauses both directions
CURLE_OK (zero) means that the option was set properly, and a non-zero return
code means something wrong occurred after the new state was set. See the
\fIlibcurl-errors(3)\fP man page for the full list with descriptions.
+.SH LIMITATIONS
+The pausing of transfers does not work with protocols that work without
+network connectivity, like FILE://. Trying to pause such a transfer, in any
+direction, will cause problems in the worst case or an error in the best case.
.SH AVAILABILITY
This function was added in libcurl 7.18.0. Before this version, there was no
explicit support for pausing transfers.
diff --git a/docs/libcurl/curl_easy_pause.html b/docs/libcurl/curl_easy_pause.html
index 85a30a2f..75fab526 100644
--- a/docs/libcurl/curl_easy_pause.html
+++ b/docs/libcurl/curl_easy_pause.html
@@ -64,7 +64,8 @@ p.roffit {
<p class="level1">Convenience define that pauses both directions.
<p class="level0"><a name="CURLPAUSECONT"></a><span class="nroffip">CURLPAUSE_CONT</span>
<p class="level1">Convenience define that unpauses both directions <a name="RETURN"></a><h2 class="nroffsh">RETURN VALUE</h2>
-<p class="level0">CURLE_OK (zero) means that the option was set properly, and a non-zero return code means something wrong occurred after the new state was set. See the <span Class="emphasis">libcurl-errors(3)</span> man page for the full list with descriptions. <a name="AVAILABILITY"></a><h2 class="nroffsh">AVAILABILITY</h2>
+<p class="level0">CURLE_OK (zero) means that the option was set properly, and a non-zero return code means something wrong occurred after the new state was set. See the <span Class="emphasis">libcurl-errors(3)</span> man page for the full list with descriptions. <a name="LIMITATIONS"></a><h2 class="nroffsh">LIMITATIONS</h2>
+<p class="level0">The pausing of transfers does not work with protocols that work without network connectivity, like FILE://. Trying to pause such a transfer, in any direction, will cause problems in the worst case or an error in the best case. <a name="AVAILABILITY"></a><h2 class="nroffsh">AVAILABILITY</h2>
<p class="level0">This function was added in libcurl 7.18.0. Before this version, there was no explicit support for pausing transfers. <a name="USAGE"></a><h2 class="nroffsh">USAGE WITH THE MULTI-SOCKET INTERFACE</h2>
<p class="level0">Before libcurl 7.32.0, when a specific handle was unpaused with this function, there was no particular forced rechecking or similar of the socket's state, which made the continuation of the transfer get delayed until next multi-socket call invoke or even longer. Alternatively, the user could forcibly call for example curl_multi_socket_all(3) - with a rather hefty performance penalty.
<p class="level0">Starting in libcurl 7.32.0, unpausing a transfer will schedule a timeout trigger for that handle 1 millisecond into the future, so that a curl_multi_socket_action( ... CURL_SOCKET_TIMEOUT) can be used immediately afterwards to get the transfer going again as desired. <a name="MEMORY"></a><h2 class="nroffsh">MEMORY USE</h2>
diff --git a/docs/libcurl/curl_easy_pause.pdf b/docs/libcurl/curl_easy_pause.pdf
index d8a662cb..0c78618c 100644
--- a/docs/libcurl/curl_easy_pause.pdf
+++ b/docs/libcurl/curl_easy_pause.pdf
Binary files differ
diff --git a/docs/libcurl/curl_easy_perform.pdf b/docs/libcurl/curl_easy_perform.pdf
index 45c24f34..59c981a4 100644
--- a/docs/libcurl/curl_easy_perform.pdf
+++ b/docs/libcurl/curl_easy_perform.pdf
Binary files differ
diff --git a/docs/libcurl/curl_easy_recv.pdf b/docs/libcurl/curl_easy_recv.pdf
index 80002e76..38c4d136 100644
--- a/docs/libcurl/curl_easy_recv.pdf
+++ b/docs/libcurl/curl_easy_recv.pdf
Binary files differ
diff --git a/docs/libcurl/curl_easy_reset.pdf b/docs/libcurl/curl_easy_reset.pdf
index 5cbac029..b4d0cd1b 100644
--- a/docs/libcurl/curl_easy_reset.pdf
+++ b/docs/libcurl/curl_easy_reset.pdf
Binary files differ
diff --git a/docs/libcurl/curl_easy_send.pdf b/docs/libcurl/curl_easy_send.pdf
index f24e6752..24c850f9 100644
--- a/docs/libcurl/curl_easy_send.pdf
+++ b/docs/libcurl/curl_easy_send.pdf
Binary files differ
diff --git a/docs/libcurl/curl_easy_setopt.3 b/docs/libcurl/curl_easy_setopt.3
index 64101b8a..9b9e62e3 100644
--- a/docs/libcurl/curl_easy_setopt.3
+++ b/docs/libcurl/curl_easy_setopt.3
@@ -5,7 +5,7 @@
.\" * | (__| |_| | _ <| |___
.\" * \___|\___/|_| \_\_____|
.\" *
-.\" * Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
.\" *
.\" * This software is licensed as described in the file COPYING, which
.\" * you should have received as part of this distribution. The terms
@@ -1150,7 +1150,7 @@ connections or \fICURLOPT_LOGIN_OPTIONS\fP to control IMAP, POP3 and SMTP
options.
The user and password strings are not URL decoded, so there's no way to send
-in a user name containing a colon using this option. Use \fCURLOPT_USERNAME\fP
+in a user name containing a colon using this option. Use \fICURLOPT_USERNAME\fP
for that, or include it in the URL.
.IP CURLOPT_PROXYUSERPWD
Pass a char * as parameter, which should be [user name]:[password] to use for
@@ -1184,7 +1184,7 @@ At present only IMAP, POP3 and SMTP support login options. For more
information about the login options please see RFC2384, RFC5092 and IETF draft
draft-earhart-url-smtp-00.txt
-\CURLOPT_LOGIN_OPTIONS\fP can be used to set protocol specific login options,
+\fBCURLOPT_LOGIN_OPTIONS\fP can be used to set protocol specific login options,
such as the preferred authentication mechanism via "AUTH=NTLM" or "AUTH=*",
and should be used in conjunction with the \fICURLOPT_USERNAME\fP option.
.IP CURLOPT_PROXYUSERNAME
@@ -1306,8 +1306,7 @@ authentication methods it supports and then pick the best one you allow it to
use. For some methods, this will induce an extra network round-trip. Set the
actual name and password with the \fICURLOPT_PROXYUSERPWD\fP option. The
bitmask can be constructed by or'ing together the bits listed above for the
-\fICURLOPT_HTTPAUTH\fP option. As of this writing, only Basic, Digest and NTLM
-work. (Added in 7.10.7)
+\fICURLOPT_HTTPAUTH\fP option. \fICURLOPT_PROXYAUTH\fP was added in 7.10.7
.IP CURLOPT_SASL_IR
Pass a long. If the value is 1, curl will send the initial response to the
server in the first authentication packet in order to reduce the number of
@@ -1317,10 +1316,10 @@ mechanisms and to the IMAP, POP3 and SMTP protocols. (Added in 7.31.0)
Note: Whilst IMAP supports this option there is no need to explicitly set it,
as libcurl can determine the feature itself when the server supports the
SASL-IR CAPABILITY.
-.IP CURLOPT_BEARER
-Pass a char * as parameter, which should point to the zero terminated OAUTH
-2.0 Bearer Access Token for use with IMAP. POP3 and SMTP servers that support
-the OAUTH 2.0 Authorization Framework. (Added in 7.33.0)
+.IP CURLOPT_XOAUTH2_BEARER
+Pass a char * as parameter, which should point to the zero terminated OAuth
+2.0 Bearer Access Token for use with IMAP, POP3 and SMTP servers that support
+the OAuth 2.0 Authorization Framework. (Added in 7.33.0)
Note: The user name used to generate the Bearer Token should be supplied via
the \fICURLOPT_USERNAME\fP option.
@@ -2134,6 +2133,8 @@ as a long. See also \fICURLOPT_INFILESIZE_LARGE\fP.
For uploading using SCP, this option or \fICURLOPT_INFILESIZE_LARGE\fP is
mandatory.
+To "unset" this value again, set it to -1.
+
When sending emails using SMTP, this command can be used to specify the
optional SIZE parameter for the MAIL FROM command. (Added in 7.23.0)
@@ -2146,6 +2147,11 @@ as a curl_off_t. (Added in 7.11.0)
For uploading using SCP, this option or \fICURLOPT_INFILESIZE\fP is mandatory.
+To "unset" this value again, set it to -1.
+
+When sending emails using SMTP, this command can be used to specify the
+optional SIZE parameter for the MAIL FROM command. (Added in 7.23.0)
+
This option does not limit how much data libcurl will actually send, as that
is controlled entirely by what the read callback returns.
.IP CURLOPT_UPLOAD
@@ -2229,12 +2235,18 @@ it too slow and abort.
Pass a curl_off_t as parameter. If an upload exceeds this speed (counted in
bytes per second) on cumulative average during the transfer, the transfer will
pause to keep the average rate less than or equal to the parameter value.
-Defaults to unlimited speed. (Added in 7.15.5)
+Defaults to unlimited speed.
+
+This option doesn't affect transfer speeds done with FILE:// URLs. (Added in
+ 7.15.5)
.IP CURLOPT_MAX_RECV_SPEED_LARGE
Pass a curl_off_t as parameter. If a download exceeds this speed (counted in
bytes per second) on cumulative average during the transfer, the transfer will
pause to keep the average rate less than or equal to the parameter
-value. Defaults to unlimited speed. (Added in 7.15.5)
+value. Defaults to unlimited speed.
+
+This option doesn't affect transfer speeds done with FILE:// URLs. (Added in
+7.15.5)
.IP CURLOPT_MAXCONNECTS
Pass a long. The set number will be the persistent connection cache size. The
set amount will be the maximum amount of simultaneously open connections that
diff --git a/docs/libcurl/curl_easy_setopt.html b/docs/libcurl/curl_easy_setopt.html
index b01c7a17..4bcad60e 100644
--- a/docs/libcurl/curl_easy_setopt.html
+++ b/docs/libcurl/curl_easy_setopt.html
@@ -412,7 +412,7 @@ p.roffit {
<p class="level1">When using NTLM, you can set the domain by prepending it to the user name and separating the domain and name with a forward (/) or backward slash (\). Like this: "domain/user:password" or "domain\user:password". Some HTTP servers (on Windows) support this style even for Basic authentication.
<p class="level1">When using HTTP and <a class="emphasis" href="#CURLOPTFOLLOWLOCATION">CURLOPT_FOLLOWLOCATION</a>, libcurl might perform several requests to possibly different hosts. libcurl will only send this user and password information to hosts using the initial host name (unless <a class="emphasis" href="#CURLOPTUNRESTRICTEDAUTH">CURLOPT_UNRESTRICTED_AUTH</a> is set), so if libcurl follows locations to other hosts it will not send the user and password to those. This is enforced to prevent accidental information leakage.
<p class="level1">Use <a class="emphasis" href="#CURLOPTHTTPAUTH">CURLOPT_HTTPAUTH</a> to specify the authentication method for HTTP based connections or <a class="emphasis" href="#CURLOPTLOGINOPTIONS">CURLOPT_LOGIN_OPTIONS</a> to control IMAP, POP3 and SMTP options.
-<p class="level1">The user and password strings are not URL decoded, so there's no way to send in a user name containing a colon using this option. Use fCURLOPT_USERNAME</span> for that, or include it in the URL.
+<p class="level1">The user and password strings are not URL decoded, so there's no way to send in a user name containing a colon using this option. Use <a class="emphasis" href="#CURLOPTUSERNAME">CURLOPT_USERNAME</a> for that, or include it in the URL.
<p class="level0"><a name="CURLOPTPROXYUSERPWD"></a><span class="nroffip">CURLOPT_PROXYUSERPWD</span>
<p class="level1">Pass a char * as parameter, which should be [user name]:[password] to use for the connection to the HTTP proxy. Both the name and the password will be URL decoded before use, so to include for example a colon in the user name you should encode it as %3A.
<p class="level1">Use <a class="emphasis" href="#CURLOPTPROXYAUTH">CURLOPT_PROXYAUTH</a> to specify the authentication method.
@@ -426,7 +426,7 @@ p.roffit {
<p class="level0"><a name="CURLOPTLOGINOPTIONS"></a><span class="nroffip">CURLOPT_LOGIN_OPTIONS</span>
<p class="level1">(Added in 7.34.0) Pass a char * as parameter, which should be pointing to the zero terminated options string to use for the transfer.
<p class="level1">At present only IMAP, POP3 and SMTP support login options. For more information about the login options please see <a href="http://www.ietf.org/rfc/rfc2384.txt">RFC 2384</a>, RFC5092 and IETF draft draft-earhart-url-smtp-00.txt
-<p class="level1">CURLOPT_LOGIN_OPTIONS</span> can be used to set protocol specific login options, such as the preferred authentication mechanism via "AUTH=NTLM" or "AUTH=*", and should be used in conjunction with the <a class="emphasis" href="#CURLOPTUSERNAME">CURLOPT_USERNAME</a> option.
+<p class="level1"><a class="bold" href="#CURLOPTLOGINOPTIONS">CURLOPT_LOGIN_OPTIONS</a> can be used to set protocol specific login options, such as the preferred authentication mechanism via "AUTH=NTLM" or "AUTH=*", and should be used in conjunction with the <a class="emphasis" href="#CURLOPTUSERNAME">CURLOPT_USERNAME</a> option.
<p class="level0"><a name="CURLOPTPROXYUSERNAME"></a><span class="nroffip">CURLOPT_PROXYUSERNAME</span>
<p class="level1">Pass a char * as parameter, which should be pointing to the zero terminated user name to use for the transfer while connecting to Proxy.
<p class="level1">The CURLOPT_PROXYUSERNAME option should be used in same way as the <a class="emphasis" href="#CURLOPTPROXYUSERPWD">CURLOPT_PROXYUSERPWD</a> is used. In comparison to <a class="emphasis" href="#CURLOPTPROXYUSERPWD">CURLOPT_PROXYUSERPWD</a> the CURLOPT_PROXYUSERNAME allows the username to contain a colon, like in the following example: "sip:user@example.com". The CURLOPT_PROXYUSERNAME option is an alternative way to set the user name while connecting to Proxy. There is no meaning to use it together with the <a class="emphasis" href="#CURLOPTPROXYUSERPWD">CURLOPT_PROXYUSERPWD</a> option.
@@ -471,12 +471,12 @@ p.roffit {
<p class="level0"><a name="CURLOPTTLSAUTHPASSWORD"></a><span class="nroffip">CURLOPT_TLSAUTH_PASSWORD</span>
<p class="level1">Pass a char * as parameter, which should point to the zero terminated password to use for the TLS authentication method specified with the <a class="emphasis" href="#CURLOPTTLSAUTHTYPE">CURLOPT_TLSAUTH_TYPE</a> option. Requires that the <span Class="emphasis">CURLOPT_TLS_USERNAME</span> option also be set. (Added in 7.21.4)
<p class="level0"><a name="CURLOPTPROXYAUTH"></a><span class="nroffip">CURLOPT_PROXYAUTH</span>
-<p class="level1">Pass a long as parameter, which is set to a bitmask, to tell libcurl which authentication method(s) you want it to use for your proxy authentication. If more than one bit is set, libcurl will first query the site to see what authentication methods it supports and then pick the best one you allow it to use. For some methods, this will induce an extra network round-trip. Set the actual name and password with the <a class="emphasis" href="#CURLOPTPROXYUSERPWD">CURLOPT_PROXYUSERPWD</a> option. The bitmask can be constructed by or'ing together the bits listed above for the <a class="emphasis" href="#CURLOPTHTTPAUTH">CURLOPT_HTTPAUTH</a> option. As of this writing, only Basic, Digest and NTLM work. (Added in 7.10.7)
+<p class="level1">Pass a long as parameter, which is set to a bitmask, to tell libcurl which authentication method(s) you want it to use for your proxy authentication. If more than one bit is set, libcurl will first query the site to see what authentication methods it supports and then pick the best one you allow it to use. For some methods, this will induce an extra network round-trip. Set the actual name and password with the <a class="emphasis" href="#CURLOPTPROXYUSERPWD">CURLOPT_PROXYUSERPWD</a> option. The bitmask can be constructed by or'ing together the bits listed above for the <a class="emphasis" href="#CURLOPTHTTPAUTH">CURLOPT_HTTPAUTH</a> option. <a class="emphasis" href="#CURLOPTPROXYAUTH">CURLOPT_PROXYAUTH</a> was added in 7.10.7
<p class="level0"><a name="CURLOPTSASLIR"></a><span class="nroffip">CURLOPT_SASL_IR</span>
<p class="level1">Pass a long. If the value is 1, curl will send the initial response to the server in the first authentication packet in order to reduce the number of ping pong requests. Only applicable to supporting SASL authentication mechanisms and to the IMAP, POP3 and SMTP protocols. (Added in 7.31.0)
<p class="level1">Note: Whilst IMAP supports this option there is no need to explicitly set it, as libcurl can determine the feature itself when the server supports the SASL-IR CAPABILITY.
-<p class="level0"><a name="CURLOPTBEARER"></a><span class="nroffip">CURLOPT_BEARER</span>
-<p class="level1">Pass a char * as parameter, which should point to the zero terminated OAUTH 2.0 Bearer Access Token for use with IMAP. POP3 and SMTP servers that support the OAUTH 2.0 Authorization Framework. (Added in 7.33.0)
+<p class="level0"><a name="CURLOPTXOAUTH2BEARER"></a><span class="nroffip">CURLOPT_XOAUTH2_BEARER</span>
+<p class="level1">Pass a char * as parameter, which should point to the zero terminated OAuth 2.0 Bearer Access Token for use with IMAP, POP3 and SMTP servers that support the OAuth 2.0 Authorization Framework. (Added in 7.33.0)
<p class="level1">Note: The user name used to generate the Bearer Token should be supplied via the <a class="emphasis" href="#CURLOPTUSERNAME">CURLOPT_USERNAME</a> option. <a name="HTTP"></a><h2 class="nroffsh">HTTP OPTIONS</h2>
<p class="level0">
<p class="level0"><a name="CURLOPTAUTOREFERER"></a><span class="nroffip">CURLOPT_AUTOREFERER</span>
@@ -768,11 +768,14 @@ p.roffit {
<p class="level0"><a name="CURLOPTINFILESIZE"></a><span class="nroffip">CURLOPT_INFILESIZE</span>
<p class="level1">When uploading a file to a remote site, this option should be used to tell libcurl what the expected size of the infile is. This value should be passed as a long. See also <a class="emphasis" href="#CURLOPTINFILESIZELARGE">CURLOPT_INFILESIZE_LARGE</a>.
<p class="level1">For uploading using SCP, this option or <a class="emphasis" href="#CURLOPTINFILESIZELARGE">CURLOPT_INFILESIZE_LARGE</a> is mandatory.
+<p class="level1">To "unset" this value again, set it to -1.
<p class="level1">When sending emails using SMTP, this command can be used to specify the optional SIZE parameter for the MAIL FROM command. (Added in 7.23.0)
<p class="level1">This option does not limit how much data libcurl will actually send, as that is controlled entirely by what the read callback returns.
<p class="level0"><a name="CURLOPTINFILESIZELARGE"></a><span class="nroffip">CURLOPT_INFILESIZE_LARGE</span>
<p class="level1">When uploading a file to a remote site, this option should be used to tell libcurl what the expected size of the infile is. This value should be passed as a curl_off_t. (Added in 7.11.0)
<p class="level1">For uploading using SCP, this option or <a class="emphasis" href="#CURLOPTINFILESIZE">CURLOPT_INFILESIZE</a> is mandatory.
+<p class="level1">To "unset" this value again, set it to -1.
+<p class="level1">When sending emails using SMTP, this command can be used to specify the optional SIZE parameter for the MAIL FROM command. (Added in 7.23.0)
<p class="level1">This option does not limit how much data libcurl will actually send, as that is controlled entirely by what the read callback returns.
<p class="level0"><a name="CURLOPTUPLOAD"></a><span class="nroffip">CURLOPT_UPLOAD</span>
<p class="level1">A parameter set to 1 tells the library to prepare for an upload. The <a class="emphasis" href="#CURLOPTREADDATA">CURLOPT_READDATA</a> and <a class="emphasis" href="#CURLOPTINFILESIZE">CURLOPT_INFILESIZE</a> or <a class="emphasis" href="#CURLOPTINFILESIZELARGE">CURLOPT_INFILESIZE_LARGE</a> options are also interesting for uploads. If the protocol is HTTP, uploading means using the PUT request unless you tell libcurl otherwise.
@@ -803,9 +806,11 @@ p.roffit {
<p class="level0"><a name="CURLOPTLOWSPEEDTIME"></a><span class="nroffip">CURLOPT_LOW_SPEED_TIME</span>
<p class="level1">Pass a long as parameter. It contains the time in seconds that the transfer should be below the <a class="emphasis" href="#CURLOPTLOWSPEEDLIMIT">CURLOPT_LOW_SPEED_LIMIT</a> for the library to consider it too slow and abort.
<p class="level0"><a name="CURLOPTMAXSENDSPEEDLARGE"></a><span class="nroffip">CURLOPT_MAX_SEND_SPEED_LARGE</span>
-<p class="level1">Pass a curl_off_t as parameter. If an upload exceeds this speed (counted in bytes per second) on cumulative average during the transfer, the transfer will pause to keep the average rate less than or equal to the parameter value. Defaults to unlimited speed. (Added in 7.15.5)
+<p class="level1">Pass a curl_off_t as parameter. If an upload exceeds this speed (counted in bytes per second) on cumulative average during the transfer, the transfer will pause to keep the average rate less than or equal to the parameter value. Defaults to unlimited speed.
+<p class="level1">This option doesn't affect transfer speeds done with FILE:// URLs. (Added in &nbsp;7.15.5)
<p class="level0"><a name="CURLOPTMAXRECVSPEEDLARGE"></a><span class="nroffip">CURLOPT_MAX_RECV_SPEED_LARGE</span>
-<p class="level1">Pass a curl_off_t as parameter. If a download exceeds this speed (counted in bytes per second) on cumulative average during the transfer, the transfer will pause to keep the average rate less than or equal to the parameter value. Defaults to unlimited speed. (Added in 7.15.5)
+<p class="level1">Pass a curl_off_t as parameter. If a download exceeds this speed (counted in bytes per second) on cumulative average during the transfer, the transfer will pause to keep the average rate less than or equal to the parameter value. Defaults to unlimited speed.
+<p class="level1">This option doesn't affect transfer speeds done with FILE:// URLs. (Added in 7.15.5)
<p class="level0"><a name="CURLOPTMAXCONNECTS"></a><span class="nroffip">CURLOPT_MAXCONNECTS</span>
<p class="level1">Pass a long. The set number will be the persistent connection cache size. The set amount will be the maximum amount of simultaneously open connections that libcurl may cache in this easy handle. Default is 5, and there isn't much point in changing this value unless you are perfectly aware of how this works and changes libcurl's behaviour. This concerns connections using any of the protocols that support persistent connections.
<p class="level1">When reaching the maximum limit, curl closes the oldest one in the cache to prevent increasing the number of open connections.
diff --git a/docs/libcurl/curl_easy_setopt.pdf b/docs/libcurl/curl_easy_setopt.pdf
index bbed0f00..10b3d74c 100644
--- a/docs/libcurl/curl_easy_setopt.pdf
+++ b/docs/libcurl/curl_easy_setopt.pdf
Binary files differ
diff --git a/docs/libcurl/curl_easy_strerror.pdf b/docs/libcurl/curl_easy_strerror.pdf
index 54baf83b..ecc24d57 100644
--- a/docs/libcurl/curl_easy_strerror.pdf
+++ b/docs/libcurl/curl_easy_strerror.pdf
Binary files differ
diff --git a/docs/libcurl/curl_easy_unescape.pdf b/docs/libcurl/curl_easy_unescape.pdf
index 9cc73304..0a908146 100644
--- a/docs/libcurl/curl_easy_unescape.pdf
+++ b/docs/libcurl/curl_easy_unescape.pdf
Binary files differ
diff --git a/docs/libcurl/curl_escape.pdf b/docs/libcurl/curl_escape.pdf
index 75ac4fb8..cd5b95d2 100644
--- a/docs/libcurl/curl_escape.pdf
+++ b/docs/libcurl/curl_escape.pdf
Binary files differ
diff --git a/docs/libcurl/curl_formadd.pdf b/docs/libcurl/curl_formadd.pdf
index fa659eaa..29029c27 100644
--- a/docs/libcurl/curl_formadd.pdf
+++ b/docs/libcurl/curl_formadd.pdf
Binary files differ
diff --git a/docs/libcurl/curl_formfree.pdf b/docs/libcurl/curl_formfree.pdf
index e2a8db0a..191559fa 100644
--- a/docs/libcurl/curl_formfree.pdf
+++ b/docs/libcurl/curl_formfree.pdf
Binary files differ
diff --git a/docs/libcurl/curl_formget.pdf b/docs/libcurl/curl_formget.pdf
index 187cad7f..8fc336e6 100644
--- a/docs/libcurl/curl_formget.pdf
+++ b/docs/libcurl/curl_formget.pdf
Binary files differ
diff --git a/docs/libcurl/curl_free.pdf b/docs/libcurl/curl_free.pdf
index f28dfe80..a2d8bae3 100644
--- a/docs/libcurl/curl_free.pdf
+++ b/docs/libcurl/curl_free.pdf
@@ -63,12 +63,12 @@ endobj
<?adobe-xap-filters esc="CRLF"?>
<x:xmpmeta xmlns:x='adobe:ns:meta/' x:xmptk='XMP toolkit 2.9.1-13, framework 1.6'>
<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:iX='http://ns.adobe.com/iX/1.0/'>
-<rdf:Description rdf:about='uuid:9470411a-9f0c-11ee-0000-156c038b2dc2' xmlns:pdf='http://ns.adobe.com/pdf/1.3/' pdf:Producer='GPL Ghostscript 9.05'/>
-<rdf:Description rdf:about='uuid:9470411a-9f0c-11ee-0000-156c038b2dc2' xmlns:xmp='http://ns.adobe.com/xap/1.0/'><xmp:ModifyDate>2013-12-17T08:51:26+01:00</xmp:ModifyDate>
-<xmp:CreateDate>2013-12-17T08:51:26+01:00</xmp:CreateDate>
+<rdf:Description rdf:about='uuid:e2165821-c0d0-11ee-0000-156c038b2dc2' xmlns:pdf='http://ns.adobe.com/pdf/1.3/' pdf:Producer='GPL Ghostscript 9.05'/>
+<rdf:Description rdf:about='uuid:e2165821-c0d0-11ee-0000-156c038b2dc2' xmlns:xmp='http://ns.adobe.com/xap/1.0/'><xmp:ModifyDate>2014-01-29T08:09:46+01:00</xmp:ModifyDate>
+<xmp:CreateDate>2014-01-29T08:09:46+01:00</xmp:CreateDate>
<xmp:CreatorTool>groff version 1.22.2</xmp:CreatorTool></rdf:Description>
-<rdf:Description rdf:about='uuid:9470411a-9f0c-11ee-0000-156c038b2dc2' xmlns:xapMM='http://ns.adobe.com/xap/1.0/mm/' xapMM:DocumentID='uuid:9470411a-9f0c-11ee-0000-156c038b2dc2'/>
-<rdf:Description rdf:about='uuid:9470411a-9f0c-11ee-0000-156c038b2dc2' xmlns:dc='http://purl.org/dc/elements/1.1/' dc:format='application/pdf'><dc:title><rdf:Alt><rdf:li xml:lang='x-default'>Untitled</rdf:li></rdf:Alt></dc:title></rdf:Description>
+<rdf:Description rdf:about='uuid:e2165821-c0d0-11ee-0000-156c038b2dc2' xmlns:xapMM='http://ns.adobe.com/xap/1.0/mm/' xapMM:DocumentID='uuid:e2165821-c0d0-11ee-0000-156c038b2dc2'/>
+<rdf:Description rdf:about='uuid:e2165821-c0d0-11ee-0000-156c038b2dc2' xmlns:dc='http://purl.org/dc/elements/1.1/' dc:format='application/pdf'><dc:title><rdf:Alt><rdf:li xml:lang='x-default'>Untitled</rdf:li></rdf:Alt></dc:title></rdf:Description>
</rdf:RDF>
</x:xmpmeta>
@@ -78,8 +78,8 @@ endstream
endobj
2 0 obj
<</Producer(GPL Ghostscript 9.05)
-/CreationDate(D:20131217085126+01'00')
-/ModDate(D:20131217085126+01'00')
+/CreationDate(D:20140129080946+01'00')
+/ModDate(D:20140129080946+01'00')
/Creator(groff version 1.22.2)>>endobj
xref
0 14
@@ -99,7 +99,7 @@ xref
0000001273 00000 n
trailer
<< /Size 14 /Root 1 0 R /Info 2 0 R
-/ID [<6F2A51BBEF735CD195DBA074822EFD97><6F2A51BBEF735CD195DBA074822EFD97>]
+/ID [<234578308CBDACCE73B2977122757665><234578308CBDACCE73B2977122757665>]
>>
startxref
2850
diff --git a/docs/libcurl/curl_getdate.3 b/docs/libcurl/curl_getdate.3
index 65eed9c5..47ae2fd0 100644
--- a/docs/libcurl/curl_getdate.3
+++ b/docs/libcurl/curl_getdate.3
@@ -5,7 +5,7 @@
.\" * | (__| |_| | _ <| |___
.\" * \___|\___/|_| \_\_____|
.\" *
-.\" * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
.\" *
.\" * This software is licensed as described in the file COPYING, which
.\" * you should have received as part of this distribution. The terms
@@ -21,22 +21,17 @@
.\" **************************************************************************
.TH curl_getdate 3 "12 Aug 2005" "libcurl 7.0" "libcurl Manual"
.SH NAME
-curl_getdate - Convert a date string to number of seconds since January 1,
-1970
+curl_getdate - Convert a date string to number of seconds
.SH SYNOPSIS
.B #include <curl/curl.h>
.sp
.BI "time_t curl_getdate(char *" datestring ", time_t *"now " );"
.ad
.SH DESCRIPTION
-This function returns the number of seconds since January 1st 1970 in the UTC
-time zone, for the date and time that the \fIdatestring\fP parameter
-specifies. The \fInow\fP parameter is not used, pass a NULL there.
-
-\fBNOTE:\fP This function was rewritten for the 7.12.2 release and this
-documentation covers the functionality of the new one. The new one is not
-feature-complete with the old one, but most of the formats supported by the
-new one was supported by the old too.
+\fIcurl_getdate(3)\fP returns the number of seconds since the Epoch, January
+1st 1970 00:00:00 in the UTC time zone, for the date and time that the
+\fIdatestring\fP parameter specifies. The \fInow\fP parameter is not used,
+pass a NULL there.
.SH PARSING DATES AND TIMES
A "date" is a string containing several items separated by whitespace. The
order of the items is immaterial. A date string may contain many flavors of
@@ -108,10 +103,3 @@ number).
Having a 64 bit time_t is not a guarantee that dates beyond 03:14:07 UTC,
January 19, 2038 will work fine. On systems with a 64 bit time_t but with a
crippled mktime(), \fIcurl_getdate\fP will return -1 in this case.
-.SH REWRITE
-The former version of this function was built with yacc and was not only very
-large, it was also never quite understood and it wasn't possible to build with
-non-GNU tools since only GNU Bison could make it thread-safe!
-
-The rewrite was done for 7.12.2. The new one is much smaller and uses simpler
-code.
diff --git a/docs/libcurl/curl_getdate.html b/docs/libcurl/curl_getdate.html
index f2ece239..5bf446d6 100644
--- a/docs/libcurl/curl_getdate.html
+++ b/docs/libcurl/curl_getdate.html
@@ -46,12 +46,11 @@ p.roffit {
</head><body>
<p class="level0"><a name="NAME"></a><h2 class="nroffsh">NAME</h2>
-<p class="level0">curl_getdate - Convert a date string to number of seconds since January 1, 1970 <a name="SYNOPSIS"></a><h2 class="nroffsh">SYNOPSIS</h2>
+<p class="level0">curl_getdate - Convert a date string to number of seconds <a name="SYNOPSIS"></a><h2 class="nroffsh">SYNOPSIS</h2>
<p class="level0"><span Class="bold">#include &lt;curl/curl.h&gt;</span>
<p class="level0"><span Class="bold">time_t curl_getdate(char * datestring , time_t *now );</span>
<p class="level0"><a name="DESCRIPTION"></a><h2 class="nroffsh">DESCRIPTION</h2>
-<p class="level0">This function returns the number of seconds since January 1st 1970 in the UTC time zone, for the date and time that the <span Class="emphasis">datestring</span> parameter specifies. The <span Class="emphasis">now</span> parameter is not used, pass a NULL there.
-<p class="level0"><span Class="bold">NOTE:</span> This function was rewritten for the 7.12.2 release and this documentation covers the functionality of the new one. The new one is not feature-complete with the old one, but most of the formats supported by the new one was supported by the old too. <a name="PARSING"></a><h2 class="nroffsh">PARSING DATES AND TIMES</h2>
+<p class="level0"><a class="emphasis" href="./curl_getdate.html">curl_getdate(3)</a> returns the number of seconds since the Epoch, January 1st 1970 00:00:00 in the UTC time zone, for the date and time that the <span Class="emphasis">datestring</span> parameter specifies. The <span Class="emphasis">now</span> parameter is not used, pass a NULL there. <a name="PARSING"></a><h2 class="nroffsh">PARSING DATES AND TIMES</h2>
<p class="level0">A "date" is a string containing several items separated by whitespace. The order of the items is immaterial. A date string may contain many flavors of items:
<p class="level0"><span Class="bold">calendar date items</span> Can be specified several ways. Month names can only be three-letter english abbreviations, numbers can be zero-prefixed and the year may use 2 or 4 digits. Examples: 06 Nov 1994, 06-Nov-94 and Nov-94 6.
<p class="level0"><span Class="bold">time of the day items</span> This string specifies the time on a given day. You must specify it with 6 digits with two colons: HH:MM:SS. To not include the time in a date string, will make the function assume 00:00:00. Example: 18:19:21.
@@ -88,8 +87,6 @@ p.roffit {
<p class="level0">This parser was written to handle date formats specified in <a href="http://www.ietf.org/rfc/rfc822.txt">RFC 822</a> (including the update in <a href="http://www.ietf.org/rfc/rfc1123.txt">RFC 1123</a>) using time zone name or time zone delta and RFC 850 (obsoleted by <a href="http://www.ietf.org/rfc/rfc1036.txt">RFC 1036</a>) and ANSI C's asctime() format. These formats are the only ones <a href="http://www.ietf.org/rfc/rfc2616.txt">RFC 2616</a> says HTTP applications may use. <a name="RETURN"></a><h2 class="nroffsh">RETURN VALUE</h2>
<p class="level0">This function returns -1 when it fails to parse the date string. Otherwise it returns the number of seconds as described.
<p class="level0">If the year is larger than 2037 on systems with 32 bit time_t, this function will return 0x7fffffff (since that is the largest possible signed 32 bit number).
-<p class="level0">Having a 64 bit time_t is not a guarantee that dates beyond 03:14:07 UTC, January 19, 2038 will work fine. On systems with a 64 bit time_t but with a crippled mktime(), <span Class="emphasis">curl_getdate</span> will return -1 in this case. <a name="REWRITE"></a><h2 class="nroffsh">REWRITE</h2>
-<p class="level0">The former version of this function was built with yacc and was not only very large, it was also never quite understood and it wasn't possible to build with non-GNU tools since only GNU Bison could make it thread-safe!
-<p class="level0">The rewrite was done for 7.12.2. The new one is much smaller and uses simpler code. <p class="roffit">
+<p class="level0">Having a 64 bit time_t is not a guarantee that dates beyond 03:14:07 UTC, January 19, 2038 will work fine. On systems with a 64 bit time_t but with a crippled mktime(), <span Class="emphasis">curl_getdate</span> will return -1 in this case. <p class="roffit">
This HTML page was made with <a href="http://daniel.haxx.se/projects/roffit/">roffit</a>.
</body></html>
diff --git a/docs/libcurl/curl_getdate.pdf b/docs/libcurl/curl_getdate.pdf
index 6a5243dc..f246757c 100644
--- a/docs/libcurl/curl_getdate.pdf
+++ b/docs/libcurl/curl_getdate.pdf
Binary files differ
diff --git a/docs/libcurl/curl_getenv.pdf b/docs/libcurl/curl_getenv.pdf
index 107a2471..b3dfc801 100644
--- a/docs/libcurl/curl_getenv.pdf
+++ b/docs/libcurl/curl_getenv.pdf
Binary files differ
diff --git a/docs/libcurl/curl_global_cleanup.pdf b/docs/libcurl/curl_global_cleanup.pdf
index e6576ed9..b012af4a 100644
--- a/docs/libcurl/curl_global_cleanup.pdf
+++ b/docs/libcurl/curl_global_cleanup.pdf
Binary files differ
diff --git a/docs/libcurl/curl_global_init.pdf b/docs/libcurl/curl_global_init.pdf
index cf47aa13..11ad75d6 100644
--- a/docs/libcurl/curl_global_init.pdf
+++ b/docs/libcurl/curl_global_init.pdf
Binary files differ
diff --git a/docs/libcurl/curl_global_init_mem.pdf b/docs/libcurl/curl_global_init_mem.pdf
index f3298694..24e878c8 100644
--- a/docs/libcurl/curl_global_init_mem.pdf
+++ b/docs/libcurl/curl_global_init_mem.pdf
Binary files differ
diff --git a/docs/libcurl/curl_mprintf.pdf b/docs/libcurl/curl_mprintf.pdf
index 00493501..2c21bc70 100644
--- a/docs/libcurl/curl_mprintf.pdf
+++ b/docs/libcurl/curl_mprintf.pdf
Binary files differ
diff --git a/docs/libcurl/curl_multi_add_handle.pdf b/docs/libcurl/curl_multi_add_handle.pdf
index 17cd7f3d..9e6595b3 100644
--- a/docs/libcurl/curl_multi_add_handle.pdf
+++ b/docs/libcurl/curl_multi_add_handle.pdf
Binary files differ
diff --git a/docs/libcurl/curl_multi_assign.pdf b/docs/libcurl/curl_multi_assign.pdf
index 8ecc5f5b..612a7eab 100644
--- a/docs/libcurl/curl_multi_assign.pdf
+++ b/docs/libcurl/curl_multi_assign.pdf
Binary files differ
diff --git a/docs/libcurl/curl_multi_cleanup.pdf b/docs/libcurl/curl_multi_cleanup.pdf
index f875db14..ba58df0c 100644
--- a/docs/libcurl/curl_multi_cleanup.pdf
+++ b/docs/libcurl/curl_multi_cleanup.pdf
Binary files differ
diff --git a/docs/libcurl/curl_multi_fdset.pdf b/docs/libcurl/curl_multi_fdset.pdf
index 1940d0b1..31e6d48e 100644
--- a/docs/libcurl/curl_multi_fdset.pdf
+++ b/docs/libcurl/curl_multi_fdset.pdf
Binary files differ
diff --git a/docs/libcurl/curl_multi_info_read.pdf b/docs/libcurl/curl_multi_info_read.pdf
index 014061a7..c8692357 100644
--- a/docs/libcurl/curl_multi_info_read.pdf
+++ b/docs/libcurl/curl_multi_info_read.pdf
Binary files differ
diff --git a/docs/libcurl/curl_multi_init.pdf b/docs/libcurl/curl_multi_init.pdf
index 8b8640df..06d30c58 100644
--- a/docs/libcurl/curl_multi_init.pdf
+++ b/docs/libcurl/curl_multi_init.pdf
Binary files differ
diff --git a/docs/libcurl/curl_multi_perform.pdf b/docs/libcurl/curl_multi_perform.pdf
index a81b8ce3..0ad1a132 100644
--- a/docs/libcurl/curl_multi_perform.pdf
+++ b/docs/libcurl/curl_multi_perform.pdf
Binary files differ
diff --git a/docs/libcurl/curl_multi_remove_handle.pdf b/docs/libcurl/curl_multi_remove_handle.pdf
index 36f6302c..e1084f84 100644
--- a/docs/libcurl/curl_multi_remove_handle.pdf
+++ b/docs/libcurl/curl_multi_remove_handle.pdf
Binary files differ
diff --git a/docs/libcurl/curl_multi_setopt.pdf b/docs/libcurl/curl_multi_setopt.pdf
index 351b296e..5fb8b0e8 100644
--- a/docs/libcurl/curl_multi_setopt.pdf
+++ b/docs/libcurl/curl_multi_setopt.pdf
Binary files differ
diff --git a/docs/libcurl/curl_multi_socket.pdf b/docs/libcurl/curl_multi_socket.pdf
index 8555b459..f485ad2b 100644
--- a/docs/libcurl/curl_multi_socket.pdf
+++ b/docs/libcurl/curl_multi_socket.pdf
Binary files differ
diff --git a/docs/libcurl/curl_multi_socket_action.pdf b/docs/libcurl/curl_multi_socket_action.pdf
index d38d2fa2..8bc17db2 100644
--- a/docs/libcurl/curl_multi_socket_action.pdf
+++ b/docs/libcurl/curl_multi_socket_action.pdf
Binary files differ
diff --git a/docs/libcurl/curl_multi_strerror.pdf b/docs/libcurl/curl_multi_strerror.pdf
index a6fa826f..594d2042 100644
--- a/docs/libcurl/curl_multi_strerror.pdf
+++ b/docs/libcurl/curl_multi_strerror.pdf
Binary files differ
diff --git a/docs/libcurl/curl_multi_timeout.pdf b/docs/libcurl/curl_multi_timeout.pdf
index 90b58db4..a090aaae 100644
--- a/docs/libcurl/curl_multi_timeout.pdf
+++ b/docs/libcurl/curl_multi_timeout.pdf
Binary files differ
diff --git a/docs/libcurl/curl_multi_wait.pdf b/docs/libcurl/curl_multi_wait.pdf
index 191ab685..7cb4d07d 100644
--- a/docs/libcurl/curl_multi_wait.pdf
+++ b/docs/libcurl/curl_multi_wait.pdf
Binary files differ
diff --git a/docs/libcurl/curl_share_cleanup.pdf b/docs/libcurl/curl_share_cleanup.pdf
index e3430a1e..6eedf0a9 100644
--- a/docs/libcurl/curl_share_cleanup.pdf
+++ b/docs/libcurl/curl_share_cleanup.pdf
Binary files differ
diff --git a/docs/libcurl/curl_share_init.pdf b/docs/libcurl/curl_share_init.pdf
index 61dc11f2..c9149fa5 100644
--- a/docs/libcurl/curl_share_init.pdf
+++ b/docs/libcurl/curl_share_init.pdf
Binary files differ
diff --git a/docs/libcurl/curl_share_setopt.pdf b/docs/libcurl/curl_share_setopt.pdf
index fe24de4f..86f5c949 100644
--- a/docs/libcurl/curl_share_setopt.pdf
+++ b/docs/libcurl/curl_share_setopt.pdf
Binary files differ
diff --git a/docs/libcurl/curl_share_strerror.pdf b/docs/libcurl/curl_share_strerror.pdf
index a8ecbceb..ffb12963 100644
--- a/docs/libcurl/curl_share_strerror.pdf
+++ b/docs/libcurl/curl_share_strerror.pdf
Binary files differ
diff --git a/docs/libcurl/curl_slist_append.pdf b/docs/libcurl/curl_slist_append.pdf
index 50de9eed..9121f3c7 100644
--- a/docs/libcurl/curl_slist_append.pdf
+++ b/docs/libcurl/curl_slist_append.pdf
@@ -72,12 +72,12 @@ endobj
<?adobe-xap-filters esc="CRLF"?>
<x:xmpmeta xmlns:x='adobe:ns:meta/' x:xmptk='XMP toolkit 2.9.1-13, framework 1.6'>
<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:iX='http://ns.adobe.com/iX/1.0/'>
-<rdf:Description rdf:about='uuid:9470411a-9f0c-11ee-0000-b52b3dcd9ad6' xmlns:pdf='http://ns.adobe.com/pdf/1.3/' pdf:Producer='GPL Ghostscript 9.05'/>
-<rdf:Description rdf:about='uuid:9470411a-9f0c-11ee-0000-b52b3dcd9ad6' xmlns:xmp='http://ns.adobe.com/xap/1.0/'><xmp:ModifyDate>2013-12-17T08:51:26+01:00</xmp:ModifyDate>
-<xmp:CreateDate>2013-12-17T08:51:26+01:00</xmp:CreateDate>
+<rdf:Description rdf:about='uuid:e17dc1a1-c0d0-11ee-0000-b52b3dcd9ad6' xmlns:pdf='http://ns.adobe.com/pdf/1.3/' pdf:Producer='GPL Ghostscript 9.05'/>
+<rdf:Description rdf:about='uuid:e17dc1a1-c0d0-11ee-0000-b52b3dcd9ad6' xmlns:xmp='http://ns.adobe.com/xap/1.0/'><xmp:ModifyDate>2014-01-29T08:09:45+01:00</xmp:ModifyDate>
+<xmp:CreateDate>2014-01-29T08:09:45+01:00</xmp:CreateDate>
<xmp:CreatorTool>groff version 1.22.2</xmp:CreatorTool></rdf:Description>
-<rdf:Description rdf:about='uuid:9470411a-9f0c-11ee-0000-b52b3dcd9ad6' xmlns:xapMM='http://ns.adobe.com/xap/1.0/mm/' xapMM:DocumentID='uuid:9470411a-9f0c-11ee-0000-b52b3dcd9ad6'/>
-<rdf:Description rdf:about='uuid:9470411a-9f0c-11ee-0000-b52b3dcd9ad6' xmlns:dc='http://purl.org/dc/elements/1.1/' dc:format='application/pdf'><dc:title><rdf:Alt><rdf:li xml:lang='x-default'>Untitled</rdf:li></rdf:Alt></dc:title></rdf:Description>
+<rdf:Description rdf:about='uuid:e17dc1a1-c0d0-11ee-0000-b52b3dcd9ad6' xmlns:xapMM='http://ns.adobe.com/xap/1.0/mm/' xapMM:DocumentID='uuid:e17dc1a1-c0d0-11ee-0000-b52b3dcd9ad6'/>
+<rdf:Description rdf:about='uuid:e17dc1a1-c0d0-11ee-0000-b52b3dcd9ad6' xmlns:dc='http://purl.org/dc/elements/1.1/' dc:format='application/pdf'><dc:title><rdf:Alt><rdf:li xml:lang='x-default'>Untitled</rdf:li></rdf:Alt></dc:title></rdf:Description>
</rdf:RDF>
</x:xmpmeta>
@@ -87,8 +87,8 @@ endstream
endobj
2 0 obj
<</Producer(GPL Ghostscript 9.05)
-/CreationDate(D:20131217085126+01'00')
-/ModDate(D:20131217085126+01'00')
+/CreationDate(D:20140129080945+01'00')
+/ModDate(D:20140129080945+01'00')
/Creator(groff version 1.22.2)>>endobj
xref
0 15
@@ -109,7 +109,7 @@ xref
0000001787 00000 n
trailer
<< /Size 15 /Root 1 0 R /Info 2 0 R
-/ID [<036C0C77B22DBABDC0F249083DE1362D><036C0C77B22DBABDC0F249083DE1362D>]
+/ID [<7DF4F7DABC813681909BC74164D1D588><7DF4F7DABC813681909BC74164D1D588>]
>>
startxref
3364
diff --git a/docs/libcurl/curl_slist_free_all.pdf b/docs/libcurl/curl_slist_free_all.pdf
index 50c31a50..16034e34 100644
--- a/docs/libcurl/curl_slist_free_all.pdf
+++ b/docs/libcurl/curl_slist_free_all.pdf
@@ -62,12 +62,12 @@ endobj
<?adobe-xap-filters esc="CRLF"?>
<x:xmpmeta xmlns:x='adobe:ns:meta/' x:xmptk='XMP toolkit 2.9.1-13, framework 1.6'>
<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:iX='http://ns.adobe.com/iX/1.0/'>
-<rdf:Description rdf:about='uuid:9470411a-9f0c-11ee-0000-224f381b10d2' xmlns:pdf='http://ns.adobe.com/pdf/1.3/' pdf:Producer='GPL Ghostscript 9.05'/>
-<rdf:Description rdf:about='uuid:9470411a-9f0c-11ee-0000-224f381b10d2' xmlns:xmp='http://ns.adobe.com/xap/1.0/'><xmp:ModifyDate>2013-12-17T08:51:26+01:00</xmp:ModifyDate>
-<xmp:CreateDate>2013-12-17T08:51:26+01:00</xmp:CreateDate>
+<rdf:Description rdf:about='uuid:e17dc1a1-c0d0-11ee-0000-224f381b10d2' xmlns:pdf='http://ns.adobe.com/pdf/1.3/' pdf:Producer='GPL Ghostscript 9.05'/>
+<rdf:Description rdf:about='uuid:e17dc1a1-c0d0-11ee-0000-224f381b10d2' xmlns:xmp='http://ns.adobe.com/xap/1.0/'><xmp:ModifyDate>2014-01-29T08:09:45+01:00</xmp:ModifyDate>
+<xmp:CreateDate>2014-01-29T08:09:45+01:00</xmp:CreateDate>
<xmp:CreatorTool>groff version 1.22.2</xmp:CreatorTool></rdf:Description>
-<rdf:Description rdf:about='uuid:9470411a-9f0c-11ee-0000-224f381b10d2' xmlns:xapMM='http://ns.adobe.com/xap/1.0/mm/' xapMM:DocumentID='uuid:9470411a-9f0c-11ee-0000-224f381b10d2'/>
-<rdf:Description rdf:about='uuid:9470411a-9f0c-11ee-0000-224f381b10d2' xmlns:dc='http://purl.org/dc/elements/1.1/' dc:format='application/pdf'><dc:title><rdf:Alt><rdf:li xml:lang='x-default'>Untitled</rdf:li></rdf:Alt></dc:title></rdf:Description>
+<rdf:Description rdf:about='uuid:e17dc1a1-c0d0-11ee-0000-224f381b10d2' xmlns:xapMM='http://ns.adobe.com/xap/1.0/mm/' xapMM:DocumentID='uuid:e17dc1a1-c0d0-11ee-0000-224f381b10d2'/>
+<rdf:Description rdf:about='uuid:e17dc1a1-c0d0-11ee-0000-224f381b10d2' xmlns:dc='http://purl.org/dc/elements/1.1/' dc:format='application/pdf'><dc:title><rdf:Alt><rdf:li xml:lang='x-default'>Untitled</rdf:li></rdf:Alt></dc:title></rdf:Description>
</rdf:RDF>
</x:xmpmeta>
@@ -77,8 +77,8 @@ endstream
endobj
2 0 obj
<</Producer(GPL Ghostscript 9.05)
-/CreationDate(D:20131217085126+01'00')
-/ModDate(D:20131217085126+01'00')
+/CreationDate(D:20140129080945+01'00')
+/ModDate(D:20140129080945+01'00')
/Creator(groff version 1.22.2)>>endobj
xref
0 14
@@ -98,7 +98,7 @@ xref
0000001254 00000 n
trailer
<< /Size 14 /Root 1 0 R /Info 2 0 R
-/ID [<CD1064C5F643DADC95910BA85872BA1A><CD1064C5F643DADC95910BA85872BA1A>]
+/ID [<5CE0AD80C9DF131D6692271939551BB9><5CE0AD80C9DF131D6692271939551BB9>]
>>
startxref
2831
diff --git a/docs/libcurl/curl_strequal.pdf b/docs/libcurl/curl_strequal.pdf
index 9f45b9cb..60981593 100644
--- a/docs/libcurl/curl_strequal.pdf
+++ b/docs/libcurl/curl_strequal.pdf
Binary files differ
diff --git a/docs/libcurl/curl_unescape.pdf b/docs/libcurl/curl_unescape.pdf
index c6d57777..da69acdc 100644
--- a/docs/libcurl/curl_unescape.pdf
+++ b/docs/libcurl/curl_unescape.pdf
Binary files differ
diff --git a/docs/libcurl/curl_version.pdf b/docs/libcurl/curl_version.pdf
index 0ee0cf1d..3d51104e 100644
--- a/docs/libcurl/curl_version.pdf
+++ b/docs/libcurl/curl_version.pdf
Binary files differ
diff --git a/docs/libcurl/curl_version_info.pdf b/docs/libcurl/curl_version_info.pdf
index fe0c613a..f7b3f9ad 100644
--- a/docs/libcurl/curl_version_info.pdf
+++ b/docs/libcurl/curl_version_info.pdf
Binary files differ
diff --git a/docs/libcurl/libcurl-easy.pdf b/docs/libcurl/libcurl-easy.pdf
index 45ca730c..4cf2e067 100644
--- a/docs/libcurl/libcurl-easy.pdf
+++ b/docs/libcurl/libcurl-easy.pdf
Binary files differ
diff --git a/docs/libcurl/libcurl-errors.pdf b/docs/libcurl/libcurl-errors.pdf
index e6787b16..35c3e2cf 100644
--- a/docs/libcurl/libcurl-errors.pdf
+++ b/docs/libcurl/libcurl-errors.pdf
Binary files differ
diff --git a/docs/libcurl/libcurl-multi.pdf b/docs/libcurl/libcurl-multi.pdf
index 556e25ec..cf6784f9 100644
--- a/docs/libcurl/libcurl-multi.pdf
+++ b/docs/libcurl/libcurl-multi.pdf
Binary files differ
diff --git a/docs/libcurl/libcurl-share.pdf b/docs/libcurl/libcurl-share.pdf
index 151252c3..36da6e8b 100644
--- a/docs/libcurl/libcurl-share.pdf
+++ b/docs/libcurl/libcurl-share.pdf
Binary files differ
diff --git a/docs/libcurl/libcurl-tutorial.pdf b/docs/libcurl/libcurl-tutorial.pdf
index 7fe489f4..95517a4f 100644
--- a/docs/libcurl/libcurl-tutorial.pdf
+++ b/docs/libcurl/libcurl-tutorial.pdf
Binary files differ
diff --git a/docs/libcurl/libcurl.pdf b/docs/libcurl/libcurl.pdf
index 41c5efbc..d7eb7db4 100644
--- a/docs/libcurl/libcurl.pdf
+++ b/docs/libcurl/libcurl.pdf
Binary files differ
diff --git a/docs/mk-ca-bundle.html b/docs/mk-ca-bundle.html
index fbdd5895..a9c55154 100644
--- a/docs/mk-ca-bundle.html
+++ b/docs/mk-ca-bundle.html
@@ -54,6 +54,8 @@ p.roffit {
<p class="level0">The following options are supported:
<p class="level0"><a name="-b"></a><span class="nroffip">-b</span>
<p class="level1">backup an existing version of <span Class="emphasis">outputfilename</span>
+<p class="level0"><a name="-d"></a><span class="nroffip">-d [name]</span>
+<p class="level1">specify which Mozilla tree to pull certdata.txt from (or a custom URL). Valid names are: aurora, beta, central, mozilla, nss, release (default). They are shortcuts for which source tree to get the cert data from.
<p class="level0"><a name="-f"></a><span class="nroffip">-f</span>
<p class="level1">force rebuild even if certdata.txt is current (Added in version 1.17)
<p class="level0"><a name="-i"></a><span class="nroffip">-i</span>
diff --git a/docs/mk-ca-bundle.pdf b/docs/mk-ca-bundle.pdf
index f7864fc5..caafb936 100644
--- a/docs/mk-ca-bundle.pdf
+++ b/docs/mk-ca-bundle.pdf
Binary files differ