• Home
  • Raw
  • Download

Lines Matching full:smtp

23  * RFC1870 SMTP Service Extension for Message Size
26 * RFC3207 SMTP over TLS
30 * RFC4954 SMTP Authentication
31 * RFC5321 SMTP protocol
33 * RFC6531 SMTP Extension for Internationalized Email
37 * Draft SMTP URL Interface <draft-earhart-url-smtp-00.txt>
73 #include "smtp.h"
119 * SMTP protocol handler.
123 "SMTP", /* scheme */
176 /* SASL parameters for the smtp protocol */
178 "smtp", /* The service name */
207 * Checks for an ending SMTP status code at the start of the given string, but
286 * This is the ONLY way to change SMTP state!
311 infof(data, "SMTP %p state change from %s to %s", in state()
350 * Sends the HELO command to initialise communication with the SMTP server.
359 in smtp connections */ in smtp_perform_helo()
526 * Sends a SMTP based command.
532 struct SMTP *smtp = data->req.p.smtp; in smtp_perform_command() local
534 if(smtp->rcpt) { in smtp_perform_command()
541 if((!smtp->custom) || (!smtp->custom[0])) { in smtp_perform_command()
547 result = smtp_parse_address(smtp->rcpt->data, in smtp_perform_command()
573 (!strcmp(smtp->custom, "EXPN")); in smtp_perform_command()
577 "%s %s%s", smtp->custom, in smtp_perform_command()
578 smtp->rcpt->data, in smtp_perform_command()
585 smtp->custom && smtp->custom[0] != '\0' ? in smtp_perform_command()
586 smtp->custom : "HELP"); in smtp_perform_command()
746 struct SMTP *smtp = data->req.p.smtp; in smtp_perform_mail() local
747 struct curl_slist *rcpt = smtp->rcpt; in smtp_perform_mail()
790 struct SMTP *smtp = data->req.p.smtp; in smtp_perform_rcpt_to() local
796 result = smtp_parse_address(smtp->rcpt->data, in smtp_perform_rcpt_to()
847 failf(data, "Got unexpected smtp-server response: %d", smtpcode); in smtp_state_servergreet_resp()
1038 struct SMTP *smtp = data->req.p.smtp; in smtp_state_command_resp() local
1044 if((smtp->rcpt && smtpcode/100 != 2 && smtpcode != 553 && smtpcode != 1) || in smtp_state_command_resp()
1045 (!smtp->rcpt && smtpcode/100 != 2 && smtpcode != 1)) { in smtp_state_command_resp()
1058 if(smtp->rcpt) { in smtp_state_command_resp()
1059 smtp->rcpt = smtp->rcpt->next; in smtp_state_command_resp()
1061 if(smtp->rcpt) { in smtp_state_command_resp()
1102 struct SMTP *smtp = data->req.p.smtp; in smtp_state_rcpt_resp() local
1118 smtp->rcpt_last_error = smtpcode; in smtp_state_rcpt_resp()
1127 smtp->rcpt_had_ok = TRUE; in smtp_state_rcpt_resp()
1131 smtp->rcpt = smtp->rcpt->next; in smtp_state_rcpt_resp()
1133 if(smtp->rcpt) in smtp_state_rcpt_resp()
1139 if(!smtp->rcpt_had_ok) { in smtp_state_rcpt_resp()
1140 failf(data, "RCPT failed: %d (last error)", smtp->rcpt_last_error); in smtp_state_rcpt_resp()
1171 /* SMTP upload */ in smtp_state_data_resp()
1210 /* Busy upgrading the connection; right now all I/O is SSL/TLS, not SMTP */ in smtp_statemachine()
1231 /* We have now received a full SMTP server response */ in smtp_statemachine()
1319 /* Allocate and initialize the SMTP struct for the current Curl_easy if
1324 struct SMTP *smtp; in smtp_init() local
1326 smtp = data->req.p.smtp = calloc(sizeof(struct SMTP), 1); in smtp_init()
1327 if(!smtp) in smtp_init()
1333 /* For the SMTP "protocol connect" and "doing" phases only */
1359 /* We always support persistent connections in SMTP */ in smtp_connect()
1360 connkeep(conn, "SMTP default"); in smtp_connect()
1403 struct SMTP *smtp = data->req.p.smtp; in smtp_done() local
1411 if(!smtp) in smtp_done()
1415 Curl_safefree(smtp->custom); in smtp_done()
1418 connclose(conn, "SMTP done with bad status"); /* marked for closure */ in smtp_done()
1431 if(smtp->trailing_crlf || !data->state.infilesize) { in smtp_done()
1471 smtp->transfer = PPTRANSFER_BODY; in smtp_done()
1480 * This is the actual DO function for SMTP. Transfer a mail, send a command
1486 /* This is SMTP and no proxy */ in smtp_perform()
1488 struct SMTP *smtp = data->req.p.smtp; in smtp_perform() local
1494 smtp->transfer = PPTRANSFER_INFO; in smtp_perform()
1500 smtp->rcpt = data->set.mail_rcpt; in smtp_perform()
1503 smtp->rcpt_had_ok = FALSE; in smtp_perform()
1506 smtp->rcpt_last_error = 0; in smtp_perform()
1510 smtp->trailing_crlf = TRUE; in smtp_perform()
1511 smtp->eob = 2; in smtp_perform()
1518 /* SMTP based command (VRFY, EXPN, NOOP, RSET or HELP) */ in smtp_perform()
1563 * Disconnect from an SMTP server. Cleanup protocol-specific per-connection
1597 struct SMTP *smtp = data->req.p.smtp; in smtp_dophase_done() local
1601 if(smtp->transfer != PPTRANSFER_BODY) in smtp_dophase_done()
1666 /* Initialise the SMTP layer */ in smtp_setup_connection()
1719 /* The SMTP struct is already initialised in smtp_connect() */ in smtp_parse_url_path()
1746 struct SMTP *smtp = data->req.p.smtp; in smtp_parse_custom_request() local
1751 result = Curl_urldecode(custom, 0, &smtp->custom, NULL, REJECT_CTRL); in smtp_parse_custom_request()
1832 /* When sending a SMTP payload we must detect CRLF. sequences making sure in Curl_smtp_escape_eob()
1840 struct SMTP *smtp = data->req.p.smtp; in Curl_smtp_escape_eob() local
1860 eob_sent = smtp->eob; in Curl_smtp_escape_eob()
1867 if(SMTP_EOB[smtp->eob] == data->req.upload_fromhere[i]) { in Curl_smtp_escape_eob()
1868 smtp->eob++; in Curl_smtp_escape_eob()
1871 if(2 == smtp->eob || SMTP_EOB_LEN == smtp->eob) in Curl_smtp_escape_eob()
1872 smtp->trailing_crlf = TRUE; in Curl_smtp_escape_eob()
1874 smtp->trailing_crlf = FALSE; in Curl_smtp_escape_eob()
1876 else if(smtp->eob) { in Curl_smtp_escape_eob()
1878 memcpy(&scratch[si], &SMTP_EOB[eob_sent], smtp->eob - eob_sent); in Curl_smtp_escape_eob()
1879 si += smtp->eob - eob_sent; in Curl_smtp_escape_eob()
1883 smtp->eob = 1; in Curl_smtp_escape_eob()
1885 smtp->eob = 0; in Curl_smtp_escape_eob()
1890 smtp->trailing_crlf = FALSE; in Curl_smtp_escape_eob()
1894 if(SMTP_EOB_FIND_LEN == smtp->eob) { in Curl_smtp_escape_eob()
1899 smtp->eob = 0; in Curl_smtp_escape_eob()
1902 else if(!smtp->eob) in Curl_smtp_escape_eob()
1906 if(smtp->eob - eob_sent) { in Curl_smtp_escape_eob()
1908 memcpy(&scratch[si], &SMTP_EOB[eob_sent], smtp->eob - eob_sent); in Curl_smtp_escape_eob()
1909 si += smtp->eob - eob_sent; in Curl_smtp_escape_eob()