Message Callbacks.

Message Callbacks

libESMTP provides basic message callbacks to handle two common cases, reading from a file and reading from a string. In both cases the message must be formatted according to RFC 5322 and lines must be terminated with the canonical CRLF sequence. Furthermore, RFC 5321 line length limitations must be observed (1000 octets maximum).

const char *_smtp_message_fp_cb(void **ctx, int *len, void *arg)

Read message from a file.

Parameters

void **ctx

context data for the message.

int *len

length of message data returned to the application.

void *arg

application data (closure) passed to the callback.

Description

Callback function to read the message from a file.

Return

A pointer to message data which remains valid until the next call.

const char *_smtp_message_str_cb(void **ctx, int *len, void *arg)

Read message from a string.

Parameters

void **ctx

context data for the message.

int *len

length of message data returned to the application.

void *arg

application data (closure) passed to the callback.

Description

Callback function to read the message from a string.

Return

A pointer to message data which remains valid until the next call.