Go to the source code of this file.
Functions | |
int | smtp_yylex_memory (char *src) |
This function is the flex parser itself. Please look at the file 'smtp.lex' for details. | |
int | response_parser (char *response, struct smtp_response *data) |
Parse the response from the SMTP server. | |
int | client_smtp_connect (struct smtp_connexion_config *conf, struct smtp_res *result) |
Open a connexion to the SMTP server. | |
void | smtp_disconnect () |
Close the connexion between the SMTP client ant the server. | |
int | smtp_send_email (struct smtp_connexion_config *conf, struct smtp_mail *email, struct smtp_res *result) |
Send an email to the SMTP server. | |
Variables | |
sockaddr_in | tcp_add |
Internet address of the SMTP server. | |
int | tcp_sock = -1 |
Socket descriptor associated with the TCP connexion. |
Definition in file smtp.c.
|
Open a connexion to the SMTP server.
Definition at line 93 of file smtp.c. References smtp_connexion_config::connect_timeout_micro, smtp_connexion_config::connect_timeout_sec, smtp_res::ellapsed, smtp_res::error_code, smtp_connexion_config::host, smtp_connexion_config::id, open_tcp_connexion(), smtp_connexion_config::port, read_from_socket(), smtp_connexion_config::read_timeout_micro, smtp_connexion_config::read_timeout_sec, response_parser(), SCK_READ_OK, SMTP_BAD_ANSWER, SMTP_BUFFER_SIZE, SMTP_CLIENT_IDENTIFICATION_OK, smtp_disconnect(), SMTP_SERVER_IDENTIFICATION_OK, SMTP_WRITE_ERROR, tcp_add, and tcp_sock. |
|
Parse the response from the SMTP server.
Definition at line 46 of file smtp.c. References SMTP_INVALID_ANSWER, and smtp_yylex_memory(). Referenced by client_smtp_connect(), and smtp_send_email(). |
|
Send an email to the SMTP server.
If the returned value is -1 (error), then the field error_code of the structure pointed by result contains an error code that describes the failure. This value may be:
Definition at line 257 of file smtp.c. References smtp_mail::data, smtp_res::ellapsed, smtp_res::error_code, smtp_mail::from, smtp_mail::rcpt, smtp_mail::rcpt_number, read_from_socket(), smtp_connexion_config::read_timeout_micro, smtp_connexion_config::read_timeout_sec, response_parser(), SCK_READ_OK, SMTP_BAD_ANSWER, SMTP_BUFFER_OVERFLOW, SMTP_BUFFER_SIZE, SMTP_DATA_OK, smtp_disconnect(), SMTP_END_OF_DATA_OK, SMTP_FROM_OK, SMTP_RCPT_OK, SMTP_WRITE_ERROR, and tcp_sock. |