b3888944586654b4aa069e0db31f998e0ed8b414Stephan Bosch#define SMTP_DEFAULT_CONNECT_TIMEOUT_MSECS (1000*30)
b3888944586654b4aa069e0db31f998e0ed8b414Stephan Bosch#define SMTP_DEFAULT_COMMAND_TIMEOUT_MSECS (1000*60*5)
b3888944586654b4aa069e0db31f998e0ed8b414Stephan Bosch#define SMTP_DEFAULT_MAX_REPLY_SIZE ((size_t)-1)
b3888944586654b4aa069e0db31f998e0ed8b414Stephan Bosch#define SMTP_DEFAULT_MAX_DATA_CHUNK_SIZE IO_BLOCK_SIZE
b3888944586654b4aa069e0db31f998e0ed8b414Stephan Bosch /* Server closed the connection */
b3888944586654b4aa069e0db31f998e0ed8b414Stephan Bosch SMTP_CLIENT_COMMAND_ERROR_CONNECTION_CLOSED = 421,
b3888944586654b4aa069e0db31f998e0ed8b414Stephan Bosch /* The command was aborted */
b3888944586654b4aa069e0db31f998e0ed8b414Stephan Bosch /* DNS lookup failed */
b3888944586654b4aa069e0db31f998e0ed8b414Stephan Bosch /* Failed to establish the connection */
b3888944586654b4aa069e0db31f998e0ed8b414Stephan Bosch /* Failed to authenticate using the provided credentials */
b3888944586654b4aa069e0db31f998e0ed8b414Stephan Bosch /* Lost the connection after initially succeeded */
b3888944586654b4aa069e0db31f998e0ed8b414Stephan Bosch /* Got an invalid reply from the server */
b3888944586654b4aa069e0db31f998e0ed8b414Stephan Bosch /* We sent a command with a payload stream that broke while reading
b3888944586654b4aa069e0db31f998e0ed8b414Stephan Bosch /* The server failed to respond before the command timed out */
b3888944586654b4aa069e0db31f998e0ed8b414Stephan Bosch /* Space-separated list of SASL mechanisms to try (in the specified
b3888944586654b4aa069e0db31f998e0ed8b414Stephan Bosch order). The default is to use only SASL PLAIN. */
b3888944586654b4aa069e0db31f998e0ed8b414Stephan Bosch /* Timeout for SMTP commands. Reset every time more data is being
b3888944586654b4aa069e0db31f998e0ed8b414Stephan Bosch sent or received.
b3888944586654b4aa069e0db31f998e0ed8b414Stephan Bosch (default = unlimited) */
b3888944586654b4aa069e0db31f998e0ed8b414Stephan Bosch /* Timeout for loggging in
b3888944586654b4aa069e0db31f998e0ed8b414Stephan Bosch (default = cmd_timeout_msecs) */
b3888944586654b4aa069e0db31f998e0ed8b414Stephan Bosch /* Max total size of reply */
b3888944586654b4aa069e0db31f998e0ed8b414Stephan Bosch /* Maximum BDAT chunk size for the CHUNKING capability */
b3888944586654b4aa069e0db31f998e0ed8b414Stephan Bosch /* Maximum pipelined BDAT commands */
b3888944586654b4aa069e0db31f998e0ed8b414Stephan Bosch /* if remote server supports XCLIENT capability,
b3888944586654b4aa069e0db31f998e0ed8b414Stephan Bosch send this data */
b3888944586654b4aa069e0db31f998e0ed8b414Stephan Bosch /* the kernel send/receive buffer sizes used for the connection sockets.
b3888944586654b4aa069e0db31f998e0ed8b414Stephan Bosch Configuring this is mainly useful for the test suite. The kernel
b3888944586654b4aa069e0db31f998e0ed8b414Stephan Bosch defaults are used when these settings are 0. */
b3888944586654b4aa069e0db31f998e0ed8b414Stephan Bosch /* enable logging debug messages */
b3888944586654b4aa069e0db31f998e0ed8b414Stephan Bosch /* peer is trusted, so e.g. attempt sending XCLIENT data */
b3888944586654b4aa069e0db31f998e0ed8b414Stephan Bosch /* don't clear password after first successful authentication */
b3888944586654b4aa069e0db31f998e0ed8b414Stephan Boschstruct smtp_client *smtp_client_init(const struct smtp_client_settings *set);
b3888944586654b4aa069e0db31f998e0ed8b414Stephan Boschvoid smtp_client_deinit(struct smtp_client **_client);