Anope IRC Services  Version 1.8
Functions | Variables
anopesmtp.c File Reference
#include "smtp.h"
Include dependency graph for anopesmtp.c:

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
 

Function Documentation

void alog ( const char *  fmt,
  ... 
)

Definition at line 133 of file anopesmtp.c.

References checkday(), logfile, and smtp_debug.

Referenced by main(), smtp_send(), and smtp_send_email().

static void checkday ( void  )
static

Definition at line 112 of file anopesmtp.c.

References close_log(), curday, open_log(), and remove_log().

Referenced by alog().

void close_log ( void  )

Definition at line 63 of file anopesmtp.c.

References logfile.

Referenced by checkday(), do_set(), init_secondary(), main(), and services_restart().

static int get_logname ( char *  name,
int  count,
struct tm *  tm 
)
static

Definition at line 40 of file anopesmtp.c.

References curday, and snprintf().

Referenced by open_log(), and remove_log().

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 ( )
int main ( int  argc,
char *  argv[] 
)
int open_log ( void  )

Definition at line 94 of file anopesmtp.c.

References get_logname(), and logfile.

Referenced by checkday(), do_set(), init_primary(), main(), and services_restart().

static void remove_log ( void  )
static

Definition at line 73 of file anopesmtp.c.

References get_logname().

Referenced by checkday().

void smtp_add_body_line ( char *  line)
void smtp_add_header ( char *  header)
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)

Definition at line 352 of file anopesmtp.c.

Referenced by smtp_send_email().

int smtp_is_end ( char *  buf)

Definition at line 241 of file anopesmtp.c.

Referenced by main().

int smtp_is_header ( char *  buf)

Definition at line 213 of file anopesmtp.c.

Referenced by main().

void smtp_parse_header ( char *  buf,
char **  header,
char **  value 
)

Definition at line 228 of file anopesmtp.c.

References strip().

Referenced by main().

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 ( )
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(), and smtp_parse_header().

Variable Documentation

int curday = 0
static

Definition at line 19 of file anopesmtp.c.

Referenced by checkday(), and get_logname().

FILE* logfile
static

Definition at line 18 of file anopesmtp.c.

Referenced by alog(), close_log(), and open_log().