#ifndef SMTP_CLIENT_TRANSACTION_H
#define SMTP_CLIENT_TRANSACTION_H
#include "net.h"
#include "istream.h"
struct smtp_address;
struct smtp_client_transaction;
};
extern const char *const smtp_client_transaction_state_names[];
struct smtp_client_transaction_times {
};
/* Called when the transaction is finished, either because the MAIL FROM
failed, all RCPT TOs failed or because all DATA replies have been
received. */
typedef void
struct smtp_client_transaction *
const struct smtp_address *mail_from,
const struct smtp_reply *reply);
unsigned int timeout_msecs);
/* Start the transaction with a MAIL command. The mail_from_callback is
called once the server replies to the MAIL FROM command. Calling this
function is not mandatory; it is called implicitly by
smtp_client_transaction_send() if the transaction wasn't already started.
*/
/* Add recipient to the transaction with a RCPT TO command. The
rcpt_to_callback is called once the server replies to the RCPT TO command.
If RCPT TO succeeded, the data_callback is called once the server replies
to the DATA command. The data_callback will not be called until
smtp_client_transaction_send() is called for the transaction (see
below). Until that time, any failure is remembered.
*/
struct smtp_client_transaction *trans,
const struct smtp_address *rcpt_to,
const struct smtp_params_rcpt *rcpt_params,
CALLBACK_TYPECHECK(rcpt_callback, void (*)( \
CALLBACK_TYPECHECK(data_callback, void (*)( \
rcpt_params, \
/* Start sending input stream as DATA. This completes the transaction, which
means that any pending failures that got recorded before this function was
called will be triggered now. If any RCPT TO succeeded, the provided
data_callback is called once the server replies to the DATA command. This
callback is mainly useful for SMTP, for LMTP it will only yield the reply for
the last recipient. This function starts the transaction implicitly. */
CALLBACK_TYPECHECK(data_callback, void (*)( \
/* Return transaction statistics. */
const struct smtp_client_transaction_times *
/* Return transaction state */
const char *
const char *
struct smtp_client_transaction *trans);
#endif