smtp-client-private.h revision 2dd20833b86743fe1e45c5af06d9c5f2549126e3
#ifndef SMTP_CLIENT_PRIVATE_H
#define SMTP_CLIENT_PRIVATE_H
#include "connection.h"
#include "smtp-common.h"
#include "smtp-params.h"
#include "smtp-client.h"
#include "smtp-client-command.h"
#include "smtp-client-transaction.h"
#include "smtp-client-connection.h"
struct smtp_client_command {
unsigned int refcount;
unsigned int send_pos;
const char *name;
struct smtp_client_connection *conn;
unsigned int replies_expected;
unsigned int replies_seen;
void *context;
void (*abort_callback)(void *context);
void *abort_context;
void (*sent_callback)(void *context);
void *sent_context;
bool has_stream:1;
bool stream_dot:1;
bool ehlo:1;
bool locked:1;
bool plug:1;
bool aborting:1;
};
struct smtp_client_transaction_rcpt {
struct smtp_client_transaction *trans;
struct smtp_address *rcpt_to;
struct smtp_params_rcpt rcpt_params;
void *context;
struct smtp_client_command *cmd_rcpt_to;
bool failed:1;
};
struct smtp_client_transaction {
int refcount;
struct smtp_client_connection *conn;
struct smtp_address *mail_from;
struct smtp_params_mail mail_params;
struct smtp_reply *failure;
void *mail_from_context;
unsigned int rcpts_next_send_idx;
unsigned int rcpt_next_data_idx;
struct istream *data_input;
void *data_context;
void *context;
struct smtp_client_transaction_times times;
unsigned int finish_timeout_msecs;
bool finished:1;
bool submitted_data:1;
};
struct smtp_client_connection {
struct connection conn;
int refcount;
struct smtp_client *client;
unsigned int id;
char *label;
enum smtp_protocol protocol;
const char *host;
struct smtp_client_settings set;
char *password;
enum smtp_capability capabilities;
const char **cap_auth_mechanisms;
const char **cap_xclient_args;
struct smtp_reply_parser *reply_parser;
struct smtp_reply reply;
struct dns_lookup *dns_lookup;
struct dsasl_client *sasl_client;
struct ssl_iostream *ssl_iostream;
void *login_context;
/* commands pending in queue to be sent */
unsigned int cmd_send_queue_count;
/* commands that have been sent, waiting for response */
unsigned int cmd_wait_list_count;
/* active transactions */
unsigned int ips_count, prev_connect_idx;
bool old_smtp:1;
bool authenticated:1;
bool initial_xclient_sent:1;
bool connect_failed:1;
bool handshake_failed:1;
bool corked:1;
bool sent_quit:1;
bool sending_command:1;
bool reset_needed:1;
bool destroying:1;
bool closed:1;
};
struct smtp_client {
struct smtp_client_settings set;
struct ssl_iostream_context *ssl_ctx;
struct connection_list *conn_list;
};
/*
* Command
*/
const char **error_r);
const struct smtp_reply *reply);
const struct smtp_reply *reply);
unsigned int cmds_list_count);
const struct smtp_reply *reply);
/*
* Transaction
*/
struct smtp_client_transaction *trans,
const struct smtp_reply *reply);
struct smtp_client_transaction *trans);
/*
* Connection
*/
struct connection_list *smtp_client_connection_list_init(void);
const char *
struct smtp_client_connection *conn);
struct smtp_client_connection *conn);
struct smtp_client_connection *conn);
struct smtp_client_connection *conn,
struct smtp_client_transaction *trans);
struct smtp_client_connection *conn,
struct smtp_client_transaction *trans);
struct smtp_client_connection *conn,
struct smtp_client_transaction *trans);
#endif