main.c \
client.c \
commands.c \
- lmtp-proxy.c
+ lmtp-proxy.c \
+ lmtp-settings.c
noinst_HEADERS = \
main.h \
client.h \
commands.h \
- lmtp-proxy.h
+ lmtp-proxy.h \
+ lmtp-settings.h
client->my_domain = my_hostname;
client->state_pool = pool_alloconly_create("client state", 4096);
client->state.mail_data_fd = -1;
- client->try_proxying = TRUE; // FIXME: setting!
DLLIST_PREPEND(&clients, client);
clients_count++;
struct client *prev, *next;
const struct lda_settings *set;
+ const struct lmtp_settings *lmtp_set;
int fd_in, fd_out;
struct io *io;
struct istream *input;
struct lmtp_proxy *proxy;
unsigned int disconnected:1;
- unsigned int try_proxying:1;
unsigned int mail_body_7bit:1;
unsigned int mail_body_8bitmime:1;
};
#include "mail-storage-service.h"
#include "index/raw/raw-storage.h"
#include "lda-settings.h"
+#include "lmtp-settings.h"
#include "mail-deliver.h"
#include "main.h"
#include "client.h"
return 0;
}
- if (client->try_proxying) {
+ if (client->lmtp_set->lmtp_proxy) {
if (client_proxy_rcpt(client, name))
return 0;
}
--- /dev/null
+/* Copyright (c) 2009 Dovecot authors, see the included COPYING file */
+
+#include "lib.h"
+#include "settings-parser.h"
+#include "master-service-settings.h"
+#include "lmtp-settings.h"
+
+#include <stddef.h>
+#include <unistd.h>
+
+#undef DEF
+#define DEF(type, name) \
+ { type, #name, offsetof(struct lmtp_settings, name), NULL }
+
+static struct setting_define lmtp_setting_defines[] = {
+ DEF(SET_BOOL, lmtp_proxy),
+
+ SETTING_DEFINE_LIST_END
+};
+
+static struct lmtp_settings lmtp_default_settings = {
+ MEMBER(lmtp_proxy) FALSE
+};
+
+struct setting_parser_info lmtp_setting_parser_info = {
+ MEMBER(defines) lmtp_setting_defines,
+ MEMBER(defaults) &lmtp_default_settings,
+
+ MEMBER(parent) NULL,
+ MEMBER(dynamic_parsers) NULL,
+
+ MEMBER(parent_offset) (size_t)-1,
+ MEMBER(type_offset) (size_t)-1,
+ MEMBER(struct_size) sizeof(struct lmtp_settings),
+ MEMBER(check_func) NULL
+};
--- /dev/null
+#ifndef LMTP_SETTINGS_H
+#define LMTP_SETTINGS_H
+
+struct lmtp_settings {
+ bool lmtp_proxy;
+};
+
+extern struct setting_parser_info lmtp_setting_parser_info;
+
+#endif
#include "fd-close-on-exec.h"
#include "process-title.h"
#include "master-service.h"
+#include "master-service-settings.h"
#include "master-interface.h"
#include "mail-storage-service.h"
#include "lda-settings.h"
+#include "lmtp-settings.h"
#include "client.h"
#include "main.h"
static void client_connected(const struct master_service_connection *conn)
{
struct client *client;
+ void **sets;
client = client_create(conn->fd, conn->fd);
client->remote_ip = conn->remote_ip;
client->remote_port = conn->remote_port;
- client->set = mail_storage_service_get_settings(master_service);
+
+ sets = master_service_settings_get_others(master_service);
+ client->set = sets[1];
+ client->lmtp_set = sets[2];
(void)net_getsockname(conn->fd, &client->local_ip, &client->local_port);
}
{
const struct setting_parser_info *set_roots[] = {
&lda_setting_parser_info,
+ &lmtp_setting_parser_info,
NULL
};
enum master_service_flags service_flags = 0;