aboutsummaryrefslogtreecommitdiff
path: root/lib/smtp.c
AgeCommit message (Collapse)Author
2013-04-13smtp: Added support for ;auth=<mech> in the URLSteve Holme
Added support for specifying the preferred authentication mechanism in the URL as per Internet-Draft 'draft-earhart-url-smtp-00'.
2013-04-13smtp: Fix compiler warningSteve Holme
warning: unused variable 'smtp' introduced in commit 73cbd21b5ee6.
2013-04-12smtp: Moved parsing of url path into separate functionSteve Holme
2013-03-09email: Removed hard returns from init functionsSteve Holme
2013-03-09email: Updated the function descriptions for the logout / quit functionsSteve Holme
Updated the function description comments following commit 4838d196fdbf.
2013-03-09email: Simplified the logout / quit functionsSteve Holme
Moved the blocking state machine to the disconnect functions so that the logout / quit functions are only responsible for sending the actual command needed to logout or quit. Additionally removed the hard return on failure.
2013-03-08email: Tidied up the *_regular_transfer() functionsSteve Holme
Added comments and simplified convoluted dophase_done comparison.
2013-03-08email: Simplified nesting of if statements in *_doing() functionsSteve Holme
2013-03-07email: Minor code tidy up following recent changesSteve Holme
Removed unwanted braces and added variable initialisation.
2013-03-07email: Optimised block_statemach() functionsSteve Holme
Optimised the result test in each of the block_statemach() functions.
2013-03-03smtp: Updated the coding style for state changes after a send operationSteve Holme
Some state changes would be performed after a failure test that performed a hard return, whilst others would be performed within a test for success. Updated the code, for consistency, so all instances are performed within a success test.
2013-02-28pop3 / smtp: Small comment tidy upSteve Holme
Small tidy up to keep some comments consistant across each of the email protocols.
2013-02-28smtp: Corrected debug message for POP3_AUTH_FINAL constantSteve Holme
Following commit ad3177da24b8 corrected the debug message in state() from AUTH to AUTH_FINAL.
2013-02-27smtp: Re-factored the final SMTP_AUTH constantSteve Holme
Changed the final SMTP_AUTH constant to SMTP_AUTH_FINAL for consistency with the response function.
2013-02-26Remove unused variable in smtp_state_data_resp()Linus Nielsen Feltzing
2013-02-25email: Small tidy up following recent changesSteve Holme
2013-02-25smtp: Removed bytecountp from the per-request structureSteve Holme
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.
2013-02-23email: Additional tidy up of comments following recent changesSteve Holme
2013-02-23smtp: Removed some FTP heritage leftoversSteve Holme
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.
2013-02-23smtp: Moved the per-request variables to the per-request data structureSteve Holme
Moved the rcpt variable from the per-connection struct smtp_conn to the new per-request struct and fixed references accordingly.
2013-02-23pop3: Introduced a custom SMTP structure for per-request dataSteve Holme
Created a new SMTP structure and changed the type of the smtp proto variable in connectdata from FTP* to SMTP*.
2013-02-23email: Minor tidy up following IMAP changesSteve Holme
2013-02-19smtp.c: fix enumerated type mixed with another typeYang Tse
2013-02-16email: Tidied up result code variablesSteve Holme
Tidied up result variables to be consistent in name, declaration order and default values.
2013-02-16email: Removed unnecessary forward declarationSteve Holme
Due to the reordering of functions in commit 586f5d361474 the forward declaration to state_upgrade_tls() are no longer required.
2013-02-15rename "easy" statemachines: call them block insteadDaniel Stenberg
... since they're not used by the easy interface really, I wanted to remove the association. Also, I unified the pingpong statemachine driver into a single function with a 'wait' argument: Curl_pp_statemach.
2013-02-14smtp.c: Fixed a trailing whitespaceSteve Holme
Remove tailing whitespace introduced in commit 7ed689d24a4e.
2013-02-14smtp: Refactored the smtp_state_auth_resp() functionSteve Holme
Renamed smtp_state_auth_resp() function to match the implementations in IMAP and POP3.
2013-02-13email: Tidy up before additional IMAP workSteve Holme
Replaced two explicit comparisons of CURLE_OK with boolean alternatives. General tidy up of comments.
2013-02-13smtp: Removed duplicate pingpong structure initialisationSteve Holme
The smtp_connect() function was setting the member variables of the pingpong structure twice, once before calling Curl_pp_init() and once after!
2013-02-12email: Post optimisation of endofresp() tidy upSteve Holme
Removed unnecessary end of line check and return.
2013-02-12pingpong: Optimised the endofresp() functionSteve Holme
Reworked the pp->endofresp() function so that the conndata, line and line length are passed down to it just as with Curl_client_write() rather than each implementation of the function having to query these values. Additionally changed the int return type to bool as this is more representative of the function's usage.
2013-02-11email: Post STARTLS capability code tidy up (Part Three)Steve Holme
Corrected the order of the upgrade_tls() functions and moved the handler upgrade and getsock() functions out from the middle of the state related functions.
2013-02-10smtp: Added support for the STARTTLS capability (Part Two)Steve Holme
Added honoring of the tls_supported flag when starting a TLS upgrade rather than unconditionally attempting it. If the use_ssl flag is set to CURLUSESSL_TRY and the server doesn't support TLS upgrades then the connection will continue to authenticate. If this flag is set to CURLUSESSL_ALL then the connection will complete with a failure as it did previously.
2013-02-10smtp: Added support for the STLS capability (Part One)Steve Holme
Introduced detection of the STARTTLS capability, in order to add support for TLS upgrades without unconditionally sending the STARTTLS command.
2013-02-09smtp: Fixed an issue when processing EHLO failure responses (Part 3)Steve Holme
Follow up fix to commit 62bd21746443 to cater for servers that don't respond with a 250 in their EHLO responses. Additionally updated the SMTP tests to respond with a 250 response code as per RFC5321.
2013-02-09smtp: Fixed an issue when processing EHLO failure responses (Part 2)Steve Holme
Follow up fix to commit 23d17190ee32 as EHLO capabilities can exist within a positive response line.
2013-02-09smtp: Fixed an issue with missing capabilities after the AUTH lineSteve Holme
Follow up to commit 40f9bb787f05 to fix missing capabilities after an AUTH line.
2013-02-09smtp: Fixed an issue when processing EHLO failure responsesSteve Holme
Fixed a small issue where smtp_endofresp() would look for capabilities in the description part of a failure response. In theory a server shouldn't respond with SIZE or AUTH in an EHLO command's failure response but if it did then capabilities would be unnecessarily set before eventually failing.
2013-02-08smtp: Reworked smtp_endofresp() to allow for extra capability detectionSteve Holme
2013-02-08smtp: Renamed smtp_state_auth_passwd_resp() functionSteve Holme
Renamed the login password response function to better describe it's purpose as well as for consistency with the imap and pop3 modules.
2013-02-07smtp: Updated SMTP_AUTH_PASSWD state constantSteve Holme
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.
2013-02-06email: Moved starttls code in separate functionsSteve Holme
To help maintain the readability of the code in imap.c, pop3.c and smtp.c moved the starttls code into state_starttls() functions.
2013-02-05email: Reworked comments in the endofresp() functionsSteve Holme
Tidied up the comments in the endofresp() functions to be more meaningful prior to release.
2013-02-04email: Provided extra comments following recent pop3/imap fixesSteve Holme
Provided additional clarification about the logic of the authenticate() functions following commit 6b6bdc83bd36 and b4270a9af1d0.
2013-01-27smtp.c: Fixed unnecessary state change if starttls failsSteve Holme
The state machine should only be changed to SMTP_STARTTLS when the STARTTLS command has been successfully sent to the server.
2013-01-25smtp.c: Added comments to smtp_endofresp()Steve Holme
Minor code tidy up to add comments similar to those used in the pop3 and imap end of resp functions, in order to assist anyone reading the code and highlight the similarities between each of these protocols.
2013-01-24smtp.c: Corrected RFC referencesSteve Holme
The most recent version of the SMTP RFC is RFC5321 and not RFC2821 as previously documented. Added RFC1870 and re-ordered list numerically.
2013-01-24smtp.c: Fixed failure detection during TLS upgradeSteve Holme
smtp_state_upgrade_tls() would attempt to incorrectly complete the upgrade to smtps and start the EHLO command if Curl_ssl_connect_nonblocking() returned a failure code and if ssldone was set to TRUE. This would only happen when a non-blocking API hadn't been provided by the SSL implementation and curlssl_connect() was called underneath.
2013-01-23email: Removed unnecessary return statementsSteve Holme
Small tidy up to remove unnecessary return statements prior to the next fix.