Qsmtp
0.30dev
|
send message body to remote host More...
#include <qremote/qrdata.h>
#include <fmt.h>
#include <log.h>
#include <netio.h>
#include <qremote/client.h>
#include <qremote/greeting.h>
#include <qremote/mime.h>
#include <qremote/qremote.h>
#include <version.h>
#include <assert.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <syslog.h>
#include <unistd.h>
Functions | |
unsigned int | need_recode (const char *buf, off_t len) |
static void | send_plain (const char *buf, const off_t len) |
static void | recodeheader (void) |
static off_t | wrap_line (const char *buf, off_t len) |
static off_t | send_wrapped (const char *buf, off_t pos, off_t *off, off_t *ll, const unsigned int l) |
static void | wrap_header (const char *buf, const off_t len) |
static off_t | qp_header (const char *buf, const off_t len, cstring *boundary, int *multipart, const unsigned int body_recode) |
static void | recode_qp (const char *buf, const off_t len) |
static off_t | skip_tpad (const char *buf, const off_t len) |
static void | send_qp (const char *buf, const off_t len) |
void | send_data (unsigned int recodeflag) |
Variables | |
const char * | successmsg [] = {NULL, " accepted ", NULL, "message", "", "", "./Remote host said: ", NULL} |
const char * | msgdata |
off_t | msgsize |
static int | lastlf = 1 |
send message body to remote host
This file contains the functions to send the message body to the remote host. Both DATA and BDAT modes are supported. In DATA mode the message will be recoded to quoted-printable if necessary.
unsigned int need_recode | ( | const char * | buf, |
off_t | len | ||
) |
check if buffer has to be recoded for SMTP transfer
buf | buffer to scan |
len | length of buffer |
|
static |
scan and recode header: fix Content-Transfer-Encoding, check for boundary
buf | buffer to scan |
len | length of buffer |
boundary | if this is a multipart message a pointer to the boundary-string is stored here |
multipart | will be set to 1 if this is a multipart message |
body_recode | if the body needs recoding (i.e. the CTE-header needs to be set) |
|
static |
recode buffer to quoted-printable and send it to remote host
buf | data to send |
len | length of buffer |
void send_data | ( | unsigned int | recodeflag | ) |
send the message data
recodeflag | the result of need_recode() for the input data |
|
static |
send message body, only fix broken line endings if present
buf | buffer to send |
len | length of data in buffer |
lastlf will be set if last 2 bytes sent were CRLF
|
static |
send message body, do quoted-printable recoding where needed
buf | buffer to encode |
len | length of buffer |
|
static |
skip transport padding after boundaries (trailing whitespace and [CR]LF)
buf | buffer to encode |
len | length of buffer |
|
static |
fold long lines in header
buf | buffer to send |
len | length of buffer |
|
static |
fold one long header line
buf | beginning of line |
len | length of line without CR, LF or CRLF |