From: Timo Sirainen Date: Tue, 26 Jan 2010 16:52:06 +0000 (+0200) Subject: hostname setting now defaults to fqdn. postmaster_address defaults to postmaster... X-Git-Tag: 2.0.beta2~33 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a46e8a94b92fb269328a5a4ecdac240d741f36f7;p=thirdparty%2Fdovecot%2Fcore.git hostname setting now defaults to fqdn. postmaster_address defaults to postmaster@. --HG-- branch : HEAD --- 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; }