summaryrefslogtreecommitdiff
path: root/lib/smtp.c
Commit message (Collapse)AuthorAgeFilesLines
* smtp: fix memory leak in OOMDaniel Stenberg2017-09-201-1/+4
| | | | | | | Regression since ce0881edee Coverity CID 1418139 and CID 1418136 found it, but it was also seen in torture testing.
* mime: new MIME API.Patrick Monnerat2017-09-021-3/+34
| | | | | | | Available in HTTP, SMTP and IMAP. Deprecates the FORM API. See CURLOPT_MIMEPOST. Lib code and associated documentation.
* handler: refactor connection checkingMax Dymond2017-06-301-0/+2
| | | | | | Add a new type of callback to Curl_handler which performs checks on the connection. Alter RTSP so that it uses this callback to do its own check on connection health.
* http-proxy: only attempt FTP over HTTP proxyDaniel Stenberg2017-06-151-76/+0
| | | | | | | | | | ... all other non-HTTP protocol schemes are now defaulting to "tunnel trough" mode if a HTTP proxy is specified. In reality there are no HTTP proxies out there that allow those other schemes. Assisted-by: Ray Satiro, Michael Kaufmann Closes #1505
* buffer: use data->set.buffer_size instead of BUFSIZEDaniel Stenberg2017-05-011-1/+1
| | | | ... to properly use the dynamically set buffer size!
* URL: only accept ";options" in SMTP/POP3/IMAP URL schemesDaniel Stenberg2017-02-101-3/+4
| | | | Fixes #1252
* smtp: Fix STARTTLS denied error messageJay Satiro2017-01-121-1/+1
| | | | - Format the numeric denial code as an integer instead of a character.
* checksrc: white space edits to comply to stricter checksrcDaniel Stenberg2016-11-241-1/+1
|
* checksrc: code style: use 'char *name' styleDaniel Stenberg2016-11-241-2/+2
|
* strcasecompare: all case insensitive string compares ignore locale nowDaniel Stenberg2016-10-311-1/+0
| | | | | We had some confusions on when each function was used. We should not act differently on different locales anyway.
* strcasecompare: is the new name for strequal()Daniel Stenberg2016-10-311-3/+2
| | | | | | | ... to make it less likely that we forget that the function actually does case insentive compares. Also replaced several invokes of the function with a plain strcmp when case sensitivity is not an issue (like comparing with "-").
* errors: new alias CURLE_WEIRD_SERVER_REPLY (8)Jay Satiro2016-09-071-1/+1
| | | | | | | | Since we're using CURLE_FTP_WEIRD_SERVER_REPLY in imap, pop3 and smtp as more of a generic "failed to parse" introduce an alias without FTP in the name. Closes https://github.com/curl/curl/pull/975
* internals: rename the SessionHandle struct to Curl_easyDaniel Stenberg2016-06-221-22/+22
|
* smtp: minor ident (white space) fixesDaniel Stenberg2016-05-231-8/+8
|
* lib: include curl_printf.h as one of the last headersDaniel Stenberg2016-04-291-1/+1
| | | | | | | | | | | | | | | | | | | | curl_printf.h defines printf to curl_mprintf, etc. This can cause problems with external headers which may use __attribute__((format(printf, ...))) markers etc. To avoid that they cause problems with system includes, we include curl_printf.h after any system headers. That makes the three last headers to always be, and we keep them in this order: curl_printf.h curl_memory.h memdebug.h None of them include system headers, they all do funny #defines. Reported-by: David Benjamin Fixes #743
* multi: turn Curl_done into file local multi_doneDaniel Stenberg2016-03-301-6/+1
| | | | ... as it now is used by multi.c only.
* ftp/imap/pop3/smtp: Fixed compilation warning when /Wall enabledSteve Holme2016-03-191-2/+2
| | | | warning C4706: assignment within conditional expression
* imap/pop3/smtp: Fixed connections upgraded with TLS are not reusedSteve Holme2016-03-081-1/+9
| | | | | | | Regression since commit 710f14edba. Bug: https://github.com/curl/curl/issues/422 Reported-by: Justin Ehlert
* URLs: change all http:// URLs to https://Daniel Stenberg2016-02-031-1/+1
|
* Revert "cleanup: general removal of TODO (and similar) comments"Daniel Stenberg2015-11-241-2/+4
| | | | | | | This reverts commit 64e959ffe37c436503f9fed1ce2d6ee6ae50bd9a. Feedback-by: Dan Fandrich URL: http://curl.haxx.se/mail/lib-2015-11/0062.html
* cleanup: general removal of TODO (and similar) commentsDaniel Stenberg2015-11-131-4/+2
| | | | | | They tend to never get updated anyway so they're frequently inaccurate and we never go back to revisit them anyway. We document issues to work on properly in KNOWN_BUGS and TODO instead.
* free: instead of Curl_safefree()Daniel Stenberg2015-03-161-8/+8
| | | | | | | | | | | | Since we just started make use of free(NULL) in order to simplify code, this change takes it a step further and: - converts lots of Curl_safefree() calls to good old free() - makes Curl_safefree() not check the pointer before free() The (new) rule of thumb is: if you really want a function call that frees a pointer and then assigns it to NULL, then use Curl_safefree(). But we will prefer just using free() from now on.
* mprintf.h: remove #ifdef CURLDEBUGDaniel Stenberg2015-03-031-4/+1
| | | | | ... and as a consequence, introduce curl_printf.h with that re-define magic instead and make all libcurl code use that instead.
* sasl: implement EXTERNAL authentication mechanism.Patrick Monnerat2015-01-271-2/+3
| | | | | Its use is only enabled by explicit requirement in URL (;AUTH=EXTERNAL) and by not setting the password.
* SASL: common state engine for imap/pop3/smtpPatrick Monnerat2015-01-201-759/+53
|
* SASL: common URL option and auth capabilities decoders for all protocolsPatrick Monnerat2015-01-201-55/+23
|
* IMAP/POP3/SMTP: use a per-connection sub-structure for SASL parameters.Patrick Monnerat2015-01-201-56/+57
|
* IPV6: address scope != scope idPatrick Monnerat2014-12-161-1/+0
| | | | | | | | | | | | | | | | | | There was a confusion between these: this commit tries to disambiguate them. - Scope can be computed from the address itself. - Scope id is scope dependent: it is currently defined as 1-based local interface index for link-local scoped addresses, and as a site index(?) for (obsolete) site-local addresses. Linux only supports it for link-local addresses. The URL parser properly parses a scope id as an interface index, but stores it in a field named "scope": confusion. The field has been renamed into "scope_id". Curl_if2ip() used the scope id as it was a scope. This caused failures to bind to an interface. Scope is now computed from the addresses and Curl_if2ip() matches them. If redundantly specified in the URL, scope id is check for mismatch with the interface index. This commit should fix SF bug #1451.
* smtp.c: Fixed compilation warningsSteve Holme2014-12-121-3/+3
| | | | | | | | | | | smtp.c:2357 warning: adding 'size_t' (aka 'unsigned long') to a string does not append to the string smtp.c:2375 warning: adding 'size_t' (aka 'unsigned long') to a string does not append to the string smtp.c:2386 warning: adding 'size_t' (aka 'unsigned long') to a string does not append to the string Used array index notation instead.
* smtp.c: Fixed line longer than 79 columnsSteve Holme2014-12-121-1/+2
|
* smtp: Fixed inappropriate free of the scratch bufferSteve Holme2014-12-121-3/+4
| | | | | | | | | | If the scratch buffer was allocated in a previous call to Curl_smtp_escape_eob(), a new buffer not allocated in the subsequent call and no action taken by that call, then an attempt would be made to try and free the buffer which, by now, would be part of the data->state structure. This bug was introduced in commit 4bd860a001.
* smtp: Fixed dot stuffing when EOL characters were at end of input buffersSteve Holme2014-12-121-8/+14
| | | | | | | | | | | | | | Fixed a problem with the CRLF. detection when multiple buffers were used to upload an email to libcurl and the line ending character(s) appeared at the end of each buffer. This meant any lines which started with . would not be escaped into .. and could be interpreted as the end of transmission string instead. This only affected libcurl based applications that used a read function and wasn't reproducible with the curl command-line tool. Bug: http://curl.haxx.se/bug/view.cgi?id=1456 Assisted-by: Patrick Monnerat
* smtp: Fixed const'ness of nread parameter in Curl_smtp_escape_eob()Steve Holme2014-11-261-6/+4
| | | | ...and some comment typos!
* smtp: Added support for the conversion of Unix newlines during mail sendSteve Holme2014-11-261-9/+21
| | | | | | | Added support for the automatic conversion of Unix newlines to CRLF during mail uploads. Feature: http://curl.haxx.se/bug/view.cgi?id=1456
* kerberos: Use symbol qualified with _KERBEROS5Michael Osipov2014-11-161-3/+3
| | | | For consistency renamed USE_KRB5 to USE_KERBEROS5.
* sasl: Fixed Kerberos V5 inclusion when CURL_DISABLE_CRYPTO_AUTH is usedSteve Holme2014-11-021-3/+3
| | | | | | | | | | | Typically the USE_WINDOWS_SSPI definition would not be used when the CURL_DISABLE_CRYPTO_AUTH define is, however, it is still a valid build configuration and, as such, the SASL Kerberos V5 (GSSAPI) authentication data structures and functions would incorrectly be used when they shouldn't be. Introduced a new USE_KRB5 definition that takes into account the use of CURL_DISABLE_CRYPTO_AUTH like USE_SPNEGO and USE_NTLM do.
* smtp: Fixed intermittent "SSL3_WRITE_PENDING: bad write retry" errorBill Nagel2014-09-301-9/+24
| | | | | | | | | This patch fixes the "SSL3_WRITE_PENDING: bad write retry" error that sometimes occurs when sending an email over SMTPS with OpenSSL. OpenSSL appears to require the same pointer on a write that follows a retry (CURLE_AGAIN) as discussed here: http://stackoverflow.com/questions/2997218/why-am-i-getting-error1409f07fssl-routinesssl3-write-pending-bad-write-retr
* Ensure progress.size_dl/progress.size_ul are always >= 0Brandon Casey2014-09-071-2/+2
| | | | | | | | | | | | | | | | | | | | Historically the default "unknown" value for progress.size_dl and progress.size_ul has been zero, since these values are initialized implicitly by the calloc that allocates the curl handle that these variables are a part of. Users of curl that install progress callbacks may expect these values to always be >= 0. Currently it is possible for progress.size_dl and progress.size_ul to by set to a value of -1, if Curl_pgrsSetDownloadSize() or Curl_pgrsSetUploadSize() are passed a "size" of -1 (which a few places currently do, and a following patch will add more). So lets update Curl_pgrsSetDownloadSize() and Curl_pgrsSetUploadSize() so they make sure that these variables always contain a value that is >= 0. Updates test579 and test599. Signed-off-by: Brandon Casey <drafnel@gmail.com>
* smtp: Added support for GSSAPI (Kerberos V5) authentication via Windows SSPISteve Holme2014-08-151-0/+186
|
* email: Introduced the GSSAPI statesSteve Holme2014-08-141-0/+4
|
* smtp: fixed a segfault during test 1320 torture testDan Fandrich2014-07-301-1/+1
| | | | | | Under these circumstances, the connection hasn't been fully established and smtp_connect hasn't been called, yet smtp_done still calls the state machine which dereferences the NULL conn pointer in struct pingpong.
* bits.close: introduce connection close trackingDaniel Stenberg2014-05-221-2/+2
| | | | | | | Make all code use connclose() and connkeep() when changing the "close state" for a connection. These two macros take a string argument with an explanation, and debug builds of curl will include that in the debug output. Helps tracking connection re-use/close issues.
* INFILESIZE: fields in UserDefined must not be changed run-timeDaniel Stenberg2014-04-261-4/+4
| | | | | | set.infilesize in this case was modified in several places, which could lead to repeated requests using the same handle to get unintendent/wrong consequences based on what the previous request did!
* handler: make 'protocol' always specified as a single bitDaniel Stenberg2014-04-231-1/+1
| | | | | | | | | | | | | | | | This makes the findprotocol() function work as intended so that libcurl can properly be restricted to not support HTTP while still supporting HTTPS - since the HTTPS handler previously set both the HTTP and HTTPS bits in the protocol field. This fixes --proto and --proto-redir for most SSL protocols. This is done by adding a few new convenience defines that groups HTTP and HTTPS, FTP and FTPS etc that should then be used when the code wants to check for both protocols at once. PROTO_FAMILY_[protocol] style. Bug: https://github.com/bagder/curl/pull/97 Reported-by: drizzt
* sasl: Combined DIGEST-MD5 message decoding and generationSteve Holme2014-04-051-23/+15
|
* smtp: Fixed login denied with a RFC-821 based serverSteve Holme2014-04-011-2/+1
| | | | | | In addition to commit fe260b75e7 fixed the same issue for RFC-821 based SMTP servers and allow the credientials to be given to curl even though they are not used with the server.
* smtp: Fixed login denied when server doesn't support AUTH capabilitySteve Holme2014-03-281-9/+14
| | | | | | | | | Specifying user credentials when the SMTP server doesn't support authentication would cause curl to display "No known authentication mechanisms supported!" and return CURLE_LOGIN_DENIED. Reported-by: Tom Sparrow Bug: http://curl.haxx.se/mail/lib-2014-03/0173.html
* mprintf: Replaced internal usage of FORMAT_OFF_T and FORMAT_OFF_TUSteve Holme2013-12-311-1/+1
| | | | | | | | | Following commit 0aafd77fa4c6f2, replaced the internal usage of FORMAT_OFF_T and FORMAT_OFF_TU with the external versions that we expect API programmers to use. This negates the need for separate definitions which were subtly different under different platforms/compilers.
* email: Fixed segfault introduced in commit 195b63f99c2fe3Steve Holme2013-12-221-1/+1
|
* code police: fix indent level to silence checksrc complaintsDaniel Stenberg2013-12-221-2/+2
|