#include "smtp.h"
Go to the source code of this file.
Functions | |
| static int | get_logname (char *name, int count, struct tm *tm) |
| void | close_log (void) |
| static void | remove_log (void) |
| int | open_log (void) |
| static void | checkday (void) |
| void | alog (const char *fmt,...) |
| char * | strip (char *buf) |
| char * | lftocrlf (char *buf) |
| void | smtp_add_header (char *header) |
| int | smtp_is_header (char *buf) |
| void | smtp_parse_header (char *buf, char **header, char **value) |
| int | smtp_is_end (char *buf) |
| void | smtp_set_from (char *from) |
| void | smtp_set_to (char *to) |
| void | smtp_add_body_line (char *line) |
| int | smtp_connect (char *host, unsigned short port) |
| int | smtp_send (char *text) |
| int | smtp_read (char *buf, int len) |
| int | smtp_get_code (char *text) |
| int | smtp_send_email () |
| void | smtp_disconnect () |
| void | mail_cleanup () |
| int | main (int argc, char *argv[]) |
Variables | |
| static FILE * | logfile |
| static int | curday = 0 |
| void alog | ( | const char * | fmt, | |
| ... | ||||
| ) |
| static void checkday | ( | void | ) | [static] |
Definition at line 112 of file anopesmtp.c.
References close_log(), curday, open_log(), and remove_log().
| void close_log | ( | void | ) |
Definition at line 63 of file anopesmtp.c.
References logfile.
Referenced by checkday(), init_secondary(), main(), and services_restart().
| static int get_logname | ( | char * | name, | |
| int | count, | |||
| struct tm * | tm | |||
| ) | [static] |
| char* lftocrlf | ( | char * | buf | ) |
Definition at line 182 of file anopesmtp.c.
References result, and strip().
Referenced by smtp_add_body_line(), and smtp_add_header().
| void mail_cleanup | ( | ) |
Definition at line 495 of file anopesmtp.c.
References smtp_message::from, smtp_header::header, smtp_body_line::line, mail, smtp_body_line::next, smtp_header::next, smtp_message::smtp_body, smtp_message::smtp_headers, and smtp_message::to.
Referenced by main().
| int main | ( | int | argc, | |
| char * | argv[] | |||
| ) |
Definition at line 524 of file anopesmtp.c.
References alog(), mail, mail_cleanup(), smtp_add_body_line(), smtp_add_header(), smtp_connect(), smtp_disconnect(), smtp_is_end(), smtp_is_header(), smtp_parse_header(), smtp_send_email(), smtp_set_from(), and smtp_set_to().
| int open_log | ( | void | ) |
Definition at line 94 of file anopesmtp.c.
References get_logname(), and logfile.
Referenced by checkday(), init_primary(), main(), and services_restart().
| static void remove_log | ( | void | ) | [static] |
| void smtp_add_body_line | ( | char * | line | ) |
Definition at line 275 of file anopesmtp.c.
References lftocrlf(), smtp_body_line::line, mail, smtp_body_line::next, smtp_message::smtp_body, and smtp_message::smtp_body_tail.
Referenced by main().
| void smtp_add_header | ( | char * | header | ) |
Definition at line 194 of file anopesmtp.c.
References head, smtp_header::header, lftocrlf(), mail, smtp_header::next, smtp_message::smtp_headers, and smtp_message::smtp_headers_tail.
Referenced by main().
| int smtp_connect | ( | char * | host, | |
| unsigned short | port | |||
| ) |
Definition at line 295 of file anopesmtp.c.
References ano_sockclose, mail, smtp_message::sock, and SOCKET_ERROR.
Referenced by main().
| void smtp_disconnect | ( | ) |
Definition at line 487 of file anopesmtp.c.
References ano_sockclose, mail, smtp_send(), and smtp_message::sock.
Referenced by main().
| int smtp_get_code | ( | char * | text | ) |
| int smtp_is_end | ( | char * | buf | ) |
| int smtp_is_header | ( | char * | buf | ) |
| void smtp_parse_header | ( | char * | buf, | |
| char ** | header, | |||
| char ** | value | |||
| ) |
| int smtp_read | ( | char * | buf, | |
| int | len | |||
| ) |
Definition at line 336 of file anopesmtp.c.
References ano_sockclose, ano_sockread, mail, result, smtp_message::sock, and SOCKET_ERROR.
Referenced by smtp_send_email().
| int smtp_send | ( | char * | text | ) |
Definition at line 321 of file anopesmtp.c.
References alog(), ano_sockclose, ano_sockwrite, mail, result, smtp_message::sock, and SOCKET_ERROR.
Referenced by smtp_disconnect(), and smtp_send_email().
| int smtp_send_email | ( | ) |
Definition at line 365 of file anopesmtp.c.
References alog(), smtp_message::from, head, smtp_header::header, smtp_body_line::line, mail, smtp_body_line::next, smtp_header::next, smtp_message::smtp_body, smtp_get_code(), smtp_message::smtp_headers, smtp_read(), smtp_send(), and smtp_message::to.
Referenced by main().
| void smtp_set_from | ( | char * | from | ) |
Definition at line 253 of file anopesmtp.c.
References smtp_message::from, mail, and strdup().
Referenced by main().
| void smtp_set_to | ( | char * | to | ) |
Definition at line 261 of file anopesmtp.c.
References c, mail, strdup(), and smtp_message::to.
Referenced by main().
| char* strip | ( | char * | buf | ) |
Definition at line 167 of file anopesmtp.c.
References c.
Referenced by lftocrlf(), load_ctrl(), main(), mysql_LoadFromFile(), parse_version(), smtp_parse_header(), and write_version().
int curday = 0 [static] |
Definition at line 19 of file anopesmtp.c.
FILE* logfile [static] |
Definition at line 18 of file anopesmtp.c.
1.5.7.1