#ifndef LMTP_CLIENT_H
#define LMTP_CLIENT_H
#define ERRSTR_TEMP_REMOTE_FAILURE "451 4.4.0 Remote server not answering"
enum lmtp_client_protocol {
LMTP_CLIENT_PROTOCOL_LMTP,
LMTP_CLIENT_PROTOCOL_SMTP
};
struct lmtp_client_settings {
const char *my_hostname;
const char *mail_from;
const char *dns_client_socket_path;
};
typedef void lmtp_callback_t(bool success, const char *reply, void *context);
typedef void lmtp_finish_callback_t(void *context);
struct lmtp_client *
lmtp_client_init(const struct lmtp_client_settings *set,
lmtp_finish_callback_t *finish_callback, void *context);
void lmtp_client_deinit(struct lmtp_client **client);
int lmtp_client_connect_tcp(struct lmtp_client *client,
enum lmtp_client_protocol protocol,
const char *host, unsigned int port);
void lmtp_client_close(struct lmtp_client *client);
void lmtp_client_set_data_header(struct lmtp_client *client, const char *str);
void lmtp_client_add_rcpt(struct lmtp_client *client, const char *address,
lmtp_callback_t *rcpt_to_callback,
lmtp_callback_t *data_callback, void *context);
void lmtp_client_send(struct lmtp_client *client, struct istream *data_input);
void lmtp_client_send_more(struct lmtp_client *client);
void lmtp_client_fail(struct lmtp_client *client, const char *line);
const char *lmtp_client_state_to_string(struct lmtp_client *client);
void lmtp_client_set_data_output_callback(struct lmtp_client *client,
void (*callback)(void *),
void *context);
#endif