lmtp-client.h revision 9508ac436fff0e1dcea975855c139cd251deb703
#ifndef LMTP_CLIENT_H
#define LMTP_CLIENT_H
#include "net.h"
#define ERRSTR_TEMP_REMOTE_FAILURE "451 4.4.0 Remote server not answering"
enum lmtp_client_protocol {
};
struct lmtp_client_settings {
const char *my_hostname;
const char *mail_from;
const char *dns_client_socket_path;
/* if remote server supports XCLIENT capability,
unsigned int source_port;
/* send TTL as this (default 0 means "don't send it") */
unsigned int proxy_ttl;
/* remote is notified that the connection is going to be closed after
this many seconds, so it should try to keep lock waits and such
lower than this. */
unsigned int proxy_timeout_secs;
};
/* reply contains the reply coming from remote server, or NULL
if it's a connection error. */
/* called when session is finished, either because all RCPT TOs failed or
because all DATA replies have been received. */
typedef void lmtp_finish_callback_t(void *context);
struct lmtp_client *
enum lmtp_client_protocol protocol,
/* Add headers from given string before the rest of the data. The string must
use CRLF line feeds and end with CRLF. */
/* Add recipient to the session. rcpt_to_callback is called once LMTP server
replies with RCPT TO. If RCPT TO was a succees, data_callback is called
when DATA replies. */
/* Start sending input stream as DATA. */
/* Call this function whenever input stream can potentially be read forward.
This is useful with non-blocking istreams and tee-istreams. */
replies. */
/* Return the state (command reply) the client is currently waiting for. */
/* Call the given callback whenever client manages to send some more DATA
output to client. */
void (*callback)(void *),
void *context);
#endif