#include "hash-format.h"
#include "var-expand.h"
#include "unichar.h"
+#include "hostpid.h"
#include "settings-parser.h"
#include "mail-index.h"
#include "mail-user.h"
DEF(SET_ENUM, lock_method),
DEF(SET_STR, pop3_uidl_format),
+ DEF(SET_STR_VARS, postmaster_address),
+ DEF(SET_STR, hostname),
+ DEF(SET_STR, recipient_delimiter),
+
DEF(SET_STR, ssl_client_ca_dir),
DEF(SET_STR, ssl_client_ca_file),
DEF(SET_STR, ssl_crypto_device),
.lock_method = "fcntl:flock:dotlock",
.pop3_uidl_format = "%08Xu%08Xv",
+ .postmaster_address = "postmaster@%d",
+ .hostname = "",
+ .recipient_delimiter = "+",
+
.ssl_client_ca_dir = "",
.ssl_client_ca_file = "",
.ssl_crypto_device = ""
// FIXME: check set->mail_server_admin syntax (RFC 5464, Section 6.2.2)
+#ifndef CONFIG_BINARY
+ if (*set->hostname == '\0')
+ set->hostname = p_strdup(pool, my_hostdomain());
+ if (set->postmaster_address[0] == SETTING_STRVAR_UNEXPANDED[0] &&
+ set->postmaster_address[1] == '\0') {
+ /* check for valid looking fqdn in hostname */
+ if (strchr(set->hostname, '.') == NULL) {
+ *error_r = "postmaster_address setting not given";
+ return FALSE;
+ }
+ set->postmaster_address =
+ p_strconcat(pool, SETTING_STRVAR_UNEXPANDED,
+ "postmaster@", set->hostname, NULL);
+ }
+#endif
+
return TRUE;
}