Qsmtp  0.30dev
Macros | Functions | Variables
data.c File Reference

receive and queue message data More...

#include <qsmtpd/qsdata.h>
#include <fmt.h>
#include <log.h>
#include <netio.h>
#include <qsmtpd/antispam.h>
#include <qsmtpd/qsmtpd.h>
#include <qsmtpd/queue.h>
#include <qsmtpd/syntax.h>
#include <tls.h>
#include <version.h>
#include <errno.h>
#include <openssl/ssl.h>
#include <string.h>
#include <sys/time.h>
#include <syslog.h>
#include <time.h>
#include <unistd.h>

Macros

#define MAXHOPS   100 /* maximum number of "Received:" lines allowed in a mail (loop prevention) */
 
#define WRITE(buf, len)
 
#define WRITEL(str)   WRITE(str, strlen(str))
 
#define WRITE(buf, len)
 
#define HEADER_HAS_DATE   0x1
 
#define HEADER_HAS_FROM   0x2
 
#define HEADER_HAS_MSGID   0x4
 

Functions

static void two_digit (char *buf, int num)
 
static void date822 (char *buf)
 
static int write_received (const int chunked)
 write Received header line More...
 
static int check_rfc822_headers (unsigned int *headerflags, const char **hdrname)
 check if header lines violate RfC822 More...
 
int smtp_data (void)
 

Variables

size_t maxbytes
 
static char datebuf [35] = ">; "
 
static unsigned long msgsize
 

Detailed Description

receive and queue message data

Macro Definition Documentation

#define WRITE (   buf,
  len 
)
Value:
do { \
if ( (rc = write(queuefd_data, buf, len)) < 0 ) { \
return rc; \
} \
} while (0)
int queuefd_data
Definition: queue.c:23
#define WRITE (   buf,
  len 
)
Value:
do { \
if ( (rc = write(queuefd_data, buf, len)) < 0 ) { \
goto err_write; \
} \
} while (0)
int queuefd_data
Definition: queue.c:23

Function Documentation

static int check_rfc822_headers ( unsigned int *  headerflags,
const char **  hdrname 
)
static

check if header lines violate RfC822

Parameters
headerflagsflags which headers were already found
hdrnamethe header found on error
Returns
if processing should continue
Return values
0nothing special found
1a known header was found
-2a duplicate header was found (hdrname is set)
-8unencoded 8 bit data was found
static void date822 ( char *  buf)
static

write RfC822 date information to buffer

Parameters
bufbuffer to store string in, must have at least 32 bytes free

exactly 31 bytes in buffer are filled, it will not be 0-terminated

int smtp_data ( void  )

handle DATA command and store data into queue

Returns
0 on success, else error code
static int write_received ( const int  chunked)
static

write Received header line

Parameters
chunkedif message was transferred using BDAT