Permalink
Browse files

introducing IMAP, POP3 and SMTP support (still lots of polish left to…

… do)
  • Loading branch information...
bagder committed Dec 12, 2009
1 parent 463d2d3 commit ec3bb8f727405642a471b4b1b9eb0118fc003104
Showing with 4,530 additions and 752 deletions.
  1. +13 −0 include/curl/curl.h
  2. +1 −1 lib/Makefile.am
  3. +2 −3 lib/Makefile.inc
  4. +30 −0 lib/README.pingpong
  5. +100 −495 lib/ftp.c
  6. +104 −2 lib/ftp.h
  7. +1,026 −0 lib/imap.c
  8. +56 −0 lib/imap.h
  9. +536 −0 lib/pingpong.c
  10. +148 −0 lib/pingpong.h
  11. +961 −0 lib/pop3.c
  12. +62 −0 lib/pop3.h
  13. +921 −0 lib/smtp.c
  14. +61 −0 lib/smtp.h
  15. +9 −1 lib/transfer.c
  16. +39 −5 lib/url.c
  17. +40 −125 lib/urldata.h
  18. +21 −0 lib/version.c
  19. +19 −0 src/main.c
  20. +1 −1 tests/data/Makefile.am
  21. +47 −0 tests/data/test800
  22. +226 −57 tests/ftpserver.pl
  23. +107 −62 tests/runtests.pl
View
@@ -613,6 +613,12 @@ typedef enum {
#define CURLPROTO_DICT (1<<9)
#define CURLPROTO_FILE (1<<10)
#define CURLPROTO_TFTP (1<<11)
+#define CURLPROTO_IMAP (1<<12)
+#define CURLPROTO_IMAPS (1<<13)
+#define CURLPROTO_POP3 (1<<14)
+#define CURLPROTO_POP3S (1<<15)
+#define CURLPROTO_SMTP (1<<16)
+#define CURLPROTO_SMTPS (1<<17)
#define CURLPROTO_ALL (~0) /* enable everything */
/* long may be 32 or 64 bits, but we should never depend on anything else
@@ -1028,6 +1034,7 @@ typedef enum {
essentially places a demand on the FTP server to acknowledge commands
in a timely manner. */
CINIT(FTP_RESPONSE_TIMEOUT, LONG, 112),
+#define CURLOPT_SERVER_RESPONSE_TIMEOUT CURLOPT_FTP_RESPONSE_TIMEOUT
/* Set this option to one of the CURL_IPRESOLVE_* defines (see below) to
tell libcurl to resolve names to those IP versions only. This only has
@@ -1272,6 +1279,12 @@ typedef enum {
/* set the SSH host key callback custom pointer */
CINIT(SSH_KEYDATA, OBJECTPOINT, 185),
+ /* set the SMTP mail originator */
+ CINIT(MAIL_FROM, OBJECTPOINT, 186),
+
+ /* set the SMTP mail receiver(s) */
+ CINIT(MAIL_RCPT, OBJECTPOINT, 187),
+
CURLOPT_LASTENTRY /* the last unused */
} CURLoption;
View
@@ -27,7 +27,7 @@ VCPROJ = libcurl.vcproj
DOCS = README.encoding README.memoryleak README.ares README.curlx \
README.hostip README.multi_socket README.httpauth README.pipelining \
- README.curl_off_t README.cmake
+ README.curl_off_t README.cmake README.pingpong
CMAKE_DIST = CMakeLists.txt curl_config.h.cmake
View
@@ -11,7 +11,7 @@ CSOURCES = file.c timeval.c base64.c hostip.c progress.c formdata.c \
inet_ntop.c parsedate.c select.c gtls.c sslgen.c tftp.c splay.c \
strdup.c socks.c ssh.c nss.c qssl.c rawstr.c curl_addrinfo.c \
socks_gssapi.c socks_sspi.c curl_sspi.c slist.c nonblock.c \
- curl_memrchr.c
+ curl_memrchr.c imap.c pop3.c smtp.c pingpong.c
HHEADERS = arpa_telnet.h netrc.h file.h timeval.h qssl.h hostip.h \
progress.h formdata.h cookie.h http.h sendf.h ftp.h url.h dict.h \
@@ -23,5 +23,4 @@ HHEADERS = arpa_telnet.h netrc.h file.h timeval.h qssl.h hostip.h \
transfer.h select.h easyif.h multiif.h parsedate.h sslgen.h gtls.h \
tftp.h sockaddr.h splay.h strdup.h setup_once.h socks.h ssh.h nssg.h \
curl_base64.h rawstr.h curl_addrinfo.h curl_sspi.h slist.h nonblock.h \
- curl_memrchr.h
-
+ curl_memrchr.h imap.h pop3.h smtp.h pingpong.h
View
@@ -0,0 +1,30 @@
+Date: December 5, 2009
+
+Pingpong
+========
+
+ Pingpong is just my (Daniel's) jestful collective name on the protocols that
+ share a very similar kind of back-and-forth procedure with command and
+ responses to and from the server. FTP was previously the only protocol in
+ that family that libcurl supported, but when POP3, IMAP and SMTP joined the
+ team I moved some of the internals into a separate pingpong module to be
+ easier to get used by all these protocols to reduce code duplication and ease
+ code re-use between these protocols.
+
+FTP
+
+ In 7.20.0 we converted code to use the new pingpong code from previously
+ having been all "native" FTP code.
+
+POP3
+
+ There's no support in the documented URL format to specify the exact mail to
+ get, but we support that as the path specified in the URL.
+
+IMAP
+
+SMTP
+
+ There's no official URL syntax defined for SMTP, but we use only the generic
+ one and we provide two additional libcurl options to specify receivers and
+ sender of the actual mail.
Oops, something went wrong.

0 comments on commit ec3bb8f

Please sign in to comment.