summaryrefslogtreecommitdiff
path: root/lib/smtp.h
Commit message (Collapse)AuthorAgeFilesLines
* misc: reduce struct and struct field sizesDaniel Stenberg2023-01-041-9/+9
| | | | | | | | | | | | - by using BIT() instead of bool - imap: shrink struct - ftp: make state 'unsigned char' - ftp: sort ftp_conn struct entries on size - urldata: use smaller fields for SSL version info storage - pop3: reduce the pop3_conn struct size - smtp: reduce the size of the smtp structs Closes #10186
* copyright: update all copyright lines and remove year rangesDaniel Stenberg2023-01-031-1/+1
| | | | | | | | | | | | - they are mostly pointless in all major jurisdictions - many big corporations and projects already don't use them - saves us from pointless churn - git keeps history for us - the year range is kept in COPYING checksrc is updated to allow non-year using copyright statements Closes #10205
* transfer: upload performance; avoid tiny sendGlenn Strauss2022-06-201-1/+3
| | | | | | | | | | | | | Append to the upload buffer when only small amount remains in buffer rather than performing a separate tiny send to empty buffer. Avoid degenerative upload behavior which might cause curl to send mostly 1-byte DATA frames after exhausing the h2 send window size Related discussion: https://github.com/nghttp2/nghttp2/issues/1722 Signed-off-by: Glenn Strauss <gstrauss@gluelogic.com> Closes #8965
* copyright: make repository REUSE compliantmax.mehl2022-06-131-1/+3
| | | | | | | | | | | Add licensing and copyright information for all files in this repository. This either happens in the file itself as a comment header or in the file `.reuse/dep5`. This commit also adds a Github workflow to check pull requests and adapts copyright.pl to the changes. Closes #8869
* lib: save a bit of space with some structure packingErik Olsson2021-01-201-1/+1
| | | | | | | | | | | | | | | - Reorder some internal struct members so that less padding is used. This is an attempt at saving a bit of space by packing some structs (using pahole to find the holes) where it might make sense to do so without losing readability. I.e., I tried to avoid separating fields that seem grouped together (like the cwd... fields in struct ftp_conn for instance). Also abstained from touching fields behind conditional macros as that quickly can get complicated. Closes https://github.com/curl/curl/pull/6483
* lib: pass in 'struct Curl_easy *' to most functionsDaniel Stenberg2021-01-171-2/+2
| | | | | | | | | | | | | | | | | | | | | ... in most cases instead of 'struct connectdata *' but in some cases in addition to. - We mostly operate on transfers and not connections. - We need the transfer handle to log, store data and more. Everything in libcurl is driven by a transfer (the CURL * in the public API). - This work clarifies and separates the transfers from the connections better. - We should avoid "conn->data". Since individual connections can be used by many transfers when multiplexing, making sure that conn->data points to the current and correct transfer at all times is difficult and has been notoriously error-prone over the years. The goal is to ultimately remove the conn->data pointer for this reason. Closes #6425
* curl.se: new homeDaniel Stenberg2020-11-041-1/+1
| | | | Closes #6172
* smtp: Detect server support for the UTF-8 extension as defined in RFC-6531Steve Holme2020-02-261-0/+2
|
* smtp: Allow RCPT TO command to fail for some recipientsPavel Volgarev2020-01-211-1/+4
| | | | | | | | Introduces CURLOPT_MAIL_RCPT_ALLLOWFAILS. Verified with the new tests 3002-3007 Closes #4816
* copyrights: fix copyright year rangeDaniel Stenberg2019-11-081-1/+1
| | | | | | | | .. because checksrc's copyright year check stopped working. Ref: https://github.com/curl/curl/pull/4547 Closes https://github.com/curl/curl/pull/4549
* internals: rename the SessionHandle struct to Curl_easyDaniel Stenberg2016-06-221-2/+2
|
* URLs: change all http:// URLs to https://Daniel Stenberg2016-02-031-1/+1
|
* SASL: common state engine for imap/pop3/smtpPatrick Monnerat2015-01-201-14/+1
|
* IMAP/POP3/SMTP: use a per-connection sub-structure for SASL parameters.Patrick Monnerat2015-01-201-4/+2
|
* smtp: Fixed const'ness of nread parameter in Curl_smtp_escape_eob()Steve Holme2014-11-261-1/+1
| | | | ...and some comment typos!
* email: Added mutual authentication flagSteve Holme2014-08-151-0/+1
|
* email: Introduced the GSSAPI statesSteve Holme2014-08-141-0/+3
|
* smtp: Fixed login denied when server doesn't support AUTH capabilitySteve Holme2014-03-281-1/+2
| | | | | | | | | 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
* smtp: Added support for VRFY and EXPN commandsSteve Holme2013-11-151-1/+1
|
* smtp: Added support for NOOP and RSET commandsSteve Holme2013-11-151-0/+2
|
* email: Added initial support for cancelling authenticationSteve Holme2013-10-271-0/+1
| | | | | | | | | | | | | | | | Should a client application fail to decode an authentication message received from a server, or not support any of the parameters given by the server in the message, then the authentication phrase should be cancelled gracefully by the client rather than simply terminating the connection. The authentication phrase should be cancelled by simply sending a '*' to the server, in response to erroneous data being received, as per RFC-3501, RFC-4954 and RFC-5034. This patch adds the necessary state machine constants and appropriate response handlers in order to add this functionality for the CRAM-MD5, DIGEST-MD5 and NTLM authentication mechanisms.
* smtp: added basic SASL XOAUTH2 supportKyle L. Huff2013-08-261-0/+1
| | | | | | | | | | | Added the ability to use an XOAUTH2 bearer token [RFC6750] with SMTP for authentication using RFC6749 "OAuth 2.0 Authorization Framework". The bearer token is expected to be valid for the user specified in conn->user. If CURLOPT_XOAUTH2_BEARER is defined and the connection has an advertised auth mechanism of "XOAUTH2", the user and access token are formatted as a base64 encoded string and sent to the server as "AUTH XOAUTH2 <bearer token>".
* smtp: Fixed sending of double CRLF caused by first in EOBSteve Holme2013-05-041-0/+1
| | | | | | | | If the mail sent during the transfer contains a terminating <CRLF> then we should not send the first <CRLF> of the EOB as specified in RFC-5321. Additionally don't send the <CRLF> if there is "no mail data" as the DATA command already includes it.
* smtp: Tidy up to move the eob counter to the per-request structureSteve Holme2013-04-301-2/+2
| | | | | Move the eob counter from the smtp_conn structure to the SMTP structure as it is associated with a SMTP payload on a per-request basis.
* smtp: Added support for ;auth=<mech> in the URLSteve Holme2013-04-131-0/+1
| | | | | Added support for specifying the preferred authentication mechanism in the URL as per Internet-Draft 'draft-earhart-url-smtp-00'.
* smtp: Re-factored the final SMTP_AUTH constantSteve Holme2013-02-271-1/+1
| | | | | Changed the final SMTP_AUTH constant to SMTP_AUTH_FINAL for consistency with the response function.
* email: Slight reordering of connection based variablesSteve Holme2013-02-261-2/+2
| | | | | | Reordered the state and ssl_done variables in order to provide more consistency between the email protocols as well as for for an upcoming change.
* smtp: Removed bytecountp from the per-request structureSteve Holme2013-02-251-1/+0
| | | | | | | Removed this pointer to a downloaded bytes counter because it was set in smtp_init() to point to the same variable the transfer functions keep the count in (k->bytecount), effectively making the code in transfer.c "*k->bytecountp = k->bytecount" a no-op.
* smtp: Removed some FTP heritage leftoversSteve Holme2013-02-231-2/+0
| | | | | | | Removed user and passwd from the SMTP struct as these cannot be set on a per-request basis and are leftover from legacy FTP code. Changed some comments still using FTP terminology.
* smtp: Moved the per-request variables to the per-request data structureSteve Holme2013-02-231-1/+1
| | | | | Moved the rcpt variable from the per-connection struct smtp_conn to the new per-request struct and fixed references accordingly.
* pop3: Introduced a custom SMTP structure for per-request dataSteve Holme2013-02-231-0/+11
| | | | | Created a new SMTP structure and changed the type of the smtp proto variable in connectdata from FTP* to SMTP*.
* smtp: Added support for the STLS capability (Part One)Steve Holme2013-02-101-0/+1
| | | | | Introduced detection of the STARTTLS capability, in order to add support for TLS upgrades without unconditionally sending the STARTTLS command.
* smtp: Updated SMTP_AUTH_PASSWD state constantSteve Holme2013-02-071-1/+1
| | | | | | Changed the SMTP_AUTH_PASSWD state constant to SMTP_AUTH_LOGIN_PASSWD to better describe the state as the second part of an AUTH LOGIN command, as well as for consistency with the imap and pop3 modules.
* email: Updated comment regarding ssldone usageSteve Holme2013-01-261-4/+2
| | | | Updated the ssldone comment as multi mode is always used internally now.
* Revert changes relative to lib/*.[ch] recent renamingYang Tse2013-01-061-0/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts renaming and usage of lib/*.h header files done 28-12-2012, reverting 2 commits: f871de0... build: make use of 76 lib/*.h renamed files ffd8e12... build: rename 76 lib/*.h files This also reverts removal of redundant include guard (redundant thanks to changes in above commits) done 2-12-2013, reverting 1 commit: c087374... curl_setup.h: remove redundant include guard This also reverts renaming and usage of lib/*.c source files done 3-12-2013, reverting 3 commits: 13606bb... build: make use of 93 lib/*.c renamed files 5b6e792... build: rename 93 lib/*.c files 7d83dff... build: commit 13606bbfde follow-up 1 Start of related discussion thread: http://curl.haxx.se/mail/lib-2013-01/0012.html Asking for confirmation on pushing this revertion commit: http://curl.haxx.se/mail/lib-2013-01/0048.html Confirmation summary: http://curl.haxx.se/mail/lib-2013-01/0079.html NOTICE: The list of 2 files that have been modified by other intermixed commits, while renamed, and also by at least one of the 6 commits this one reverts follows below. These 2 files will exhibit a hole in history unless git's '--follow' option is used when viewing logs. lib/curl_imap.h lib/curl_smtp.h
* build: rename 76 lib/*.h filesYang Tse2012-12-281-88/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 76 private header files renamed to use our standard naming scheme. This commit only does the file renaming. ---------------------------------------- renamed: amigaos.h -> curl_amigaos.h renamed: arpa_telnet.h -> curl_arpa_telnet.h renamed: asyn.h -> curl_asyn.h renamed: axtls.h -> curl_axtls.h renamed: bundles.h -> curl_bundles.h renamed: conncache.h -> curl_conncache.h renamed: connect.h -> curl_connect.h renamed: content_encoding.h -> curl_content_encoding.h renamed: cookie.h -> curl_cookie.h renamed: cyassl.h -> curl_cyassl.h renamed: dict.h -> curl_dict.h renamed: easyif.h -> curl_easyif.h renamed: escape.h -> curl_escape.h renamed: file.h -> curl_file.h renamed: fileinfo.h -> curl_fileinfo.h renamed: formdata.h -> curl_formdata.h renamed: ftp.h -> curl_ftp.h renamed: ftplistparser.h -> curl_ftplistparser.h renamed: getinfo.h -> curl_getinfo.h renamed: gopher.h -> curl_gopher.h renamed: gtls.h -> curl_gtls.h renamed: hash.h -> curl_hash.h renamed: hostcheck.h -> curl_hostcheck.h renamed: hostip.h -> curl_hostip.h renamed: http.h -> curl_http.h renamed: http_chunks.h -> curl_http_chunks.h renamed: http_digest.h -> curl_http_digest.h renamed: http_negotiate.h -> curl_http_negotiate.h renamed: http_proxy.h -> curl_http_proxy.h renamed: if2ip.h -> curl_if2ip.h renamed: imap.h -> curl_imap.h renamed: inet_ntop.h -> curl_inet_ntop.h renamed: inet_pton.h -> curl_inet_pton.h renamed: krb4.h -> curl_krb4.h renamed: llist.h -> curl_llist.h renamed: memdebug.h -> curl_memdebug.h renamed: multiif.h -> curl_multiif.h renamed: netrc.h -> curl_netrc.h renamed: non-ascii.h -> curl_non-ascii.h renamed: nonblock.h -> curl_nonblock.h renamed: nssg.h -> curl_nssg.h renamed: parsedate.h -> curl_parsedate.h renamed: pingpong.h -> curl_pingpong.h renamed: polarssl.h -> curl_polarssl.h renamed: pop3.h -> curl_pop3.h renamed: progress.h -> curl_progress.h renamed: qssl.h -> curl_qssl.h renamed: rawstr.h -> curl_rawstr.h renamed: rtsp.h -> curl_rtsp.h renamed: select.h -> curl_select.h renamed: sendf.h -> curl_sendf.h renamed: setup.h -> curl_setup.h renamed: setup_once.h -> curl_setup_once.h renamed: share.h -> curl_share.h renamed: slist.h -> curl_slist.h renamed: smtp.h -> curl_smtp.h renamed: sockaddr.h -> curl_sockaddr.h renamed: socks.h -> curl_socks.h renamed: speedcheck.h -> curl_speedcheck.h renamed: splay.h -> curl_splay.h renamed: ssh.h -> curl_ssh.h renamed: sslgen.h -> curl_sslgen.h renamed: ssluse.h -> curl_ssluse.h renamed: strdup.h -> curl_strdup.h renamed: strequal.h -> curl_strequal.h renamed: strerror.h -> curl_strerror.h renamed: strtok.h -> curl_strtok.h renamed: strtoofft.h -> curl_strtoofft.h renamed: telnet.h -> curl_telnet.h renamed: tftp.h -> curl_tftp.h renamed: timeval.h -> curl_timeval.h renamed: transfer.h -> curl_transfer.h renamed: url.h -> curl_url.h renamed: urldata.h -> curl_urldata.h renamed: warnless.h -> curl_warnless.h renamed: wildcard.h -> curl_wildcard.h ----------------------------------------
* build: make use of 76 lib/*.h renamed filesYang Tse2012-12-281-1/+1
| | | | | | 76 private header files renamed to use our standard naming scheme. This change affects 322 files in libcurl's source tree.
* lib/*.h: use our standard naming scheme for header inclusion guardsYang Tse2012-12-281-3/+4
|
* SMTP: only send SIZE if supportedFrantišek Kučera2012-09-041-0/+2
| | | | | | | | SMTP client will send SIZE parameter in MAIL FROM command only if server supports it. Without this patch server might say "504 Command parameter not implemented" and reject the message. Bug: http://curl.haxx.se/bug/view.cgi?id=3564114
* smtp: Post apop feature code tidy upSteve Holme2012-06-091-1/+1
|
* sasl: Re-factored mechanism constants in preparation for APOP workSteve Holme2012-06-081-1/+1
|
* smtp: Re-factored the SMTP_AUTH* state machine constantsSteve Holme2012-06-061-8/+8
| | | | | Re-factored the SMTP_AUTH* constants, that are used by the state machine, to be clearer to read.
* smtp: Post authentication code tidy upSteve Holme2012-06-051-13/+14
| | | | | | | | | | Corrected lines longer than 78 characters. Removed unnecessary braces in smtp_state_helo_resp(). Introduced some comments in data sending functions. Tidied up comments to match changes made in pop3.c.
* smtp: Moved auth-mechanism constants into a separate header fileSteve Holme2012-05-251-9/+0
| | | | | | Move the SMTP_AUTH constants into a separate header file in preparation for adding SASL based authentication to POP3 as the two protocols will need to share them.
* smtp: Fixed non-escaping of dot character at beginning of lineSteve Holme2012-05-171-0/+1
| | | | | | | | | | A dot character at the beginning of a line would not be escaped to a double dot as required by RFC-2821, instead it would be deleted by the mail server. Please see section 4.5.2 of the RFC for more information. Note: This fix also simplifies the detection of repeated CRLF.CRLF combinations, such as CRLF.CRLF.CRLF, a little rather than having to advance the eob counter to 2.
* smtp: Add support for DIGEST-MD5 authenticationGökhan Şengün2012-03-311-0/+2
|
* SMTP: Code policing and tidy upSteve Holme2012-02-161-2/+2
|
* smtp: Added support for NTLM authenticationSteve Holme2011-10-031-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Modified smtp_endofresp() to detect NTLM from the server specified list of supported authentication mechanisms. Modified smtp_authenticate() to start the sending of the NTLM data. Added smtp_auth_ntlm_type1_message() which creates a NTLM type-1 message. This function is used by authenticate() to start the sending of data and by smtp_state_auth_ntlm_resp() when the AUTH command doesn't contain the type-1 message as part of the initial response. This lack of initial response can happen if an OOM error occurs or the type-1 message is longer than 504 characters. As the main AUTH command is limited to 512 character the data has to be transmitted in two parts; one containing the AUTH NTLM and the second containing the type-1 message. Added smtp_state_auth_ntlm_type2msg_resp() which handles the incoming type-2 message and sends an outgoing type-3 message. This type-2 message is sent by the server in response to our type-1 message. Modified smtp_state_auth_resp() to handle the response to: the AUTH NTLM without the initial response and the type-2 response. Modified smtp_disconnect() to cleanup the NTLM SSPI stack.
* source cleanup: unify look, style and indent levelsDaniel Stenberg2011-04-271-2/+3
| | | | | By the use of a the new lib/checksrc.pl script that checks that our basic source style rules are followed.
* SMTP-multi: non-blocking connectBen Noordhuis2011-03-151-0/+1
| | | | | Use Curl_ssl_connect_nonblocking() when upgrading the connection to TLS/SSL while using the multi interface.