summaryrefslogtreecommitdiff
path: root/lib/imap.c
Commit message (Collapse)AuthorAgeFilesLines
* cleanup: remove the 'numsocks' argument used in many placesDaniel Stenberg2019-07-301-5/+3
| | | | | | | | | It was used (intended) to pass in the size of the 'socks' array that is also passed to these functions, but was rarely actually checked/used and the array is defined to a fixed size of MAX_SOCKSPEREASYHANDLE entries that should be used instead. Closes #4169
* build: fix Codacy warningsMarcel Raad2019-06-051-10/+5
| | | | | | Reduce variable scopes and remove redundant variable stores. Closes https://github.com/curl/curl/pull/3975
* cleanup: remove FIXME and TODO commentsDaniel Stenberg2019-05-161-8/+3
| | | | | | | | | They serve very little purpose and mostly just add noise. Most of them have been around for a very long time. I read them all before removing or rephrasing them. Ref: #3876 Closes #3883
* imap: Fix typo in commentDaniel Gustafsson2019-05-141-1/+1
|
* emailL Added reference to RFC8314 for implicit TLSSteve Holme2019-04-111-0/+1
|
* urldata: simplify bytecountersDaniel Stenberg2019-03-011-4/+4
| | | | | | | | | | | | | - no need to have them protocol specific - no need to set pointers to them with the Curl_setup_transfer() call - make Curl_setup_transfer() operate on a transfer pointer, not connection - switch some counters from long to the more proper curl_off_t type Closes #3627
* memcmp: avoid doing single char memcmpDaniel Gustafsson2019-01-201-2/+2
| | | | | | | | | | There is no real gain in performing memcmp() comparisons on single characters, so change these to array subscript inspections which saves a call and makes the code clearer. Closes #3486 Reviewed-by: Daniel Stenberg <daniel@haxx.se> Reviewed-by: Jay Satiro <raysatiro@yahoo.com>
* pingpong: ignore regular timeout in disconnect phaseDaniel Stenberg2018-12-171-5/+6
| | | | | | | | | | | The timeout set with CURLOPT_TIMEOUT is no longer used when disconnecting from one of the pingpong protocols (FTP, IMAP, SMTP, POP3). Reported-by: jasal82 on github Fixes #3264 Closes #3374
* snprintf: renamed and we now only use msnprintf()Daniel Stenberg2018-11-231-2/+2
| | | | | | | | | | | The function does not return the same value as snprintf() normally does, so readers may be mislead into thinking the code works differently than it actually does. A different function name makes this easier to detect. Reported-by: Tomas Hoger Assisted-by: Daniel Gustafsson Fixes #3296 Closes #3297
* url: use the URL API internally as wellDaniel Stenberg2018-09-221-15/+5
| | | | | | ... to make it a truly unified URL parser. Closes #3017
* URL-APIDaniel Stenberg2018-09-081-1/+2
| | | | | | | See header file and man pages for API. All documented API details work and are tested in the 1560 test case. Closes #2842
* imap: change from "FETCH" to "UID FETCH"Nicklas Avén2018-09-061-21/+42
| | | | | | | | | | | | ... and add "MAILINDEX". As described in #2789, this is a suggested solution. Changing UID=xx to actually get mail with UID xx and add "MAILINDEX" to get a mail with a special index in the mail box (old behavior). So MAILINDEX=1 gives the first non deleted mail in the mail box. Fixes #2789 Closes #2815
* cppcheck: fix warningsMarian Klymov2018-06-111-4/+4
| | | | | | | | | | | | | - Get rid of variable that was generating false positive warning (unitialized) - Fix issues in tests - Reduce scope of several variables all over etc Closes #2631
* strictness: correct {infof, failf} format specifiersRikard Falkeborn2018-05-311-5/+3
| | | | Closes #2623
* smtp/pop3/imap_get_message: decrease the data length too...Daniel Stenberg2018-01-151-3/+5
| | | | | | | | Follow-up commit to 615edc1f73 which was incomplete. Assisted-by: Max Dymond Detected by OSS-fuzz Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=5206
* sasl_getmesssage: make sure we have a long enough string to passDaniel Stenberg2017-12-051-12/+17
| | | | | | | | | | For pop3/imap/smtp, added test 891 to somewhat verify the pop3 case. For this, I enhanced the pingpong test server to be able to send back responses with LF-only instead of always using CRLF. Closes #2150
* imap: deal with commands case insensitivelyDaniel Stenberg2017-11-091-11/+11
| | | | | | | As documented in RFC 3501 section 9: https://tools.ietf.org/html/rfc3501#section-9 Closes #2061
* imap: if a FETCH response has no size, don't call write callbackDaniel Stenberg2017-10-221-0/+5
| | | | | | | CVE-2017-1000257 Reported-by: Brian Carpenter and 0xd34db347 Also detected by OSS-Fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3586
* imap: quote atoms properly when escaping charactersDaniel Stenberg2017-09-221-2/+2
| | | | | | | Updates test 800 to verify Fixes #1902 Closes #1903
* mime: new MIME API.Patrick Monnerat2017-09-021-8/+40
| | | | | | | Available in HTTP, SMTP and IMAP. Deprecates the FORM API. See CURLOPT_MIMEPOST. Lib code and associated documentation.
* imap: use defined names for response codesDaniel Stenberg2017-08-241-20/+18
| | | | | | | When working on this code I found the previous setup a bit weird while using proper defines increases readability. Closes #1824
* imap: support PREAUTHDaniel Stenberg2017-08-231-10/+15
| | | | | | | | | | | It is a defined possible greeting at server startup that means the connection is already authenticated. See https://tools.ietf.org/html/rfc3501#section-7.1.4 Test 846 added to verify. Fixes #1818 Closes #1820
* strtoofft: reduce integer overflow risks globallyDaniel Stenberg2017-08-141-4/+5
| | | | | | | ... make sure we bail out on overflows. Reported-by: Brian Carpenter Closes #1758
* 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-77/+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
* spelling fixesklemens2017-03-261-1/+1
| | | | Closes #1356
* URL: only accept ";options" in SMTP/POP3/IMAP URL schemesDaniel Stenberg2017-02-101-2/+3
| | | | Fixes #1252
* STARTTLS: Don't print response character in denied messagesJay Satiro2017-01-121-1/+1
| | | | | | | Both IMAP and POP3 response characters are used internally, but when appended to the STARTTLS denial message likely could confuse the user. Closes https://github.com/curl/curl/pull/1203
* checksrc: white space edits to comply to stricter checksrcDaniel Stenberg2016-11-241-2/+2
|
* checksrc: code style: use 'char *name' styleDaniel Stenberg2016-11-241-1/+1
|
* strcasecompare: all case insensitive string compares ignore locale nowDaniel Stenberg2016-10-311-6/+6
| | | | | 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-4/+4
| | | | | | | | 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-18/+18
|
* lib: include curl_printf.h as one of the last headersDaniel Stenberg2016-04-291-2/+2
| | | | | | | | | | | | | | | | | | | | 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
* imap: inlined checksrc disable instead of whitelist editDaniel Stenberg2016-04-191-0/+1
|
* IMAP: check pointer before dereferencing itehlertjd@gmail.com2016-04-011-1/+1
| | | | | | may be null in the CURLOPT_CONNECT_ONLY case Fixes #747
* imap: remove duplicated functionDaniel Stenberg2016-03-311-30/+6
| | | | | | | The list and search response functions were identical! Merged into one now. Detected by PVS Studio. Reported-by: Alexis La Goutte
* 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.c: Fixed compilation warning with /Wall enabledSteve Holme2016-03-191-1/+1
| | | | | | | | | warning C4701: potentially uninitialized local variable 'size' used Technically this can't happen, as the usage of 'size' is protected by 'if(parsed)' and 'parsed' is only set after 'size' has been parsed. Anyway, lets keep the compiler happy.
* 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-10/+10
| | | | | | | 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-10/+10
| | | | | | 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.
* imap: avoid freeing constant stringDaniel Stenberg2015-11-091-1/+1
| | | | | | | The fix in 1a614c6c3 was wrong and would leed to free() of a fixed string. Pointed-out-by: Kamil Dudka
* imap: Don't check for continuation when executing a CUSTOMREQUESTJustin Ehlert2015-11-081-2/+2
| | | | | Bug: https://github.com/bagder/curl/issues/486 Closes https://github.com/bagder/curl/pull/487
* imap: checksrc: remove space after while before parenDaniel Stenberg2015-11-071-1/+1
|
* imap: Quote other 'atom-specials' and not just the space characterSteve Holme2015-11-071-8/+18
| | | | Closes #517
* imap: Fixed double quote in LIST command when mailbox contains spacesSteve Holme2015-11-071-8/+8
|