view src/lib-lda/smtp-client.h @ 18302:bf2dbc8ec74b

lib-lda: Added smtp_client_deinit_timeout() to give a session timeout.
author Timo Sirainen <tss@iki.fi>
date Fri, 06 Mar 2015 16:32:05 +0200
parents 90fbf199ebda
children
line wrap: on
line source

#ifndef SMTP_CLIENT_H
#define SMTP_CLIENT_H

struct smtp_client * ATTR_NULL(3)
smtp_client_init(const struct lda_settings *set, const char *return_path);
/* Add a new recipient */
void smtp_client_add_rcpt(struct smtp_client *client, const char *address);
/* Get an output stream where the message can be written to. The recipients
   must already be added before calling this. */
struct ostream *smtp_client_send(struct smtp_client *client);
void smtp_client_abort(struct smtp_client **client);
/* Returns 1 on success, 0 on permanent failure (e.g. invalid destination),
   -1 on temporary failure. */
int smtp_client_deinit(struct smtp_client *client, const char **error_r);
/* Same as smtp_client_deinit(), but timeout after given number of seconds. */
int smtp_client_deinit_timeout(struct smtp_client *client,
			       unsigned int timeout_secs, const char **error_r);

/* FIXME: obsolete API, remove in v2.3: */
struct smtp_client * ATTR_NULL(3)
smtp_client_open(const struct lda_settings *set, const char *destination,
		 const char *return_path, struct ostream **output_r);
/* Returns sysexits-compatible return value */
int smtp_client_close(struct smtp_client *client);

#endif