From a46e8a94b92fb269328a5a4ecdac240d741f36f7 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Tue, 26 Jan 2010 18:52:06 +0200 Subject: [PATCH] hostname setting now defaults to fqdn. postmaster_address defaults to postmaster@. --HG-- branch : HEAD --- src/lib-lda/lda-settings.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/lib-lda/lda-settings.c b/src/lib-lda/lda-settings.c index d32423ea97..92d41ed900 100644 --- a/src/lib-lda/lda-settings.c +++ b/src/lib-lda/lda-settings.c @@ -67,25 +67,20 @@ const struct setting_parser_info lda_setting_parser_info = { .dependencies = lda_setting_dependencies }; -static bool lda_settings_check(void *_set, pool_t pool ATTR_UNUSED, - const char **error_r) +static bool lda_settings_check(void *_set, pool_t pool, const char **error_r) { struct lda_settings *set = _set; - const char *fqdn = NULL; + if (*set->hostname == '\0') + set->hostname = p_strdup(pool, my_hostdomain()); if (*set->postmaster_address == '\0') { - fqdn = my_hostdomain(); - /* check for valid looking fqdn */ - if (strchr(fqdn, '.') == NULL) { + /* 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, "postmaster@", - fqdn, NULL); - } - if (*set->hostname == '\0') { - i_assert(my_hostname != NULL); - set->hostname = my_hostname; + set->hostname, NULL); } return TRUE; } -- 2.47.3