/
lmtp-proxy.h
51 lines (38 loc) · 1.15 KB
/
lmtp-proxy.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef LMTP_PROXY_H
#define LMTP_PROXY_H
#include "net.h"
#include "smtp-address.h"
#include "smtp-params.h"
#include "smtp-client.h"
#define LMTP_PROXY_DEFAULT_TTL 5
struct smtp_address;
struct lmtp_proxy;
struct client;
struct lmtp_proxy_settings {
const char *my_hostname;
const char *session_id;
/* the original client's IP/port that connected to the proxy */
struct ip_addr source_ip;
in_port_t source_port;
unsigned int proxy_ttl;
};
struct lmtp_proxy_rcpt_settings {
enum smtp_protocol protocol;
const char *host;
struct ip_addr hostip;
in_port_t port;
unsigned int timeout_msecs;
struct smtp_params_rcpt params;
};
typedef void lmtp_proxy_finish_callback_t(void *context);
void lmtp_proxy_deinit(struct lmtp_proxy **proxy);
unsigned int lmtp_proxy_rcpt_count(struct client *client);
int lmtp_proxy_rcpt(struct client *client,
struct smtp_address *address,
const char *username, const char *detail, char delim,
struct smtp_params_rcpt *params);
/* Start proxying */
void lmtp_proxy_start(struct lmtp_proxy *proxy, struct istream *data_input,
lmtp_proxy_finish_callback_t *callback, void *context)
ATTR_NULL(3);
#endif