#ifndef SMTP_SUBMIT_H
#define SMTP_SUBMIT_H
#include "smtp-submit-settings.h"
struct ssl_iostream_settings;
struct smtp_address;
struct smtp_submit_settings;
struct smtp_submit_session;
struct smtp_submit;
struct smtp_submit_result {
/* 1 on success,
0 on permanent failure (e.g. invalid destination),
-1 on temporary failure */
int status;
const char *error;
};
typedef void
void *context);
/* Use submit session to reuse resources (e.g. SMTP connections) between
submissions (FIXME: actually implement this) */
struct smtp_submit_session *
struct smtp_submit *
const struct smtp_address *mail_from);
struct smtp_submit *
const struct ssl_iostream_settings *ssl_set,
/* Add a new recipient */
const struct smtp_address *rcpt_to);
/* Get an output stream where the message can be written to. The recipients
must already be added before calling this. */
/* Submit the message. Callback is called once the message submission
finishes. */
/* Returns 1 on success, 0 on permanent failure (e.g. invalid destination),
-1 on temporary failure. */
#endif