From: Pascal Volk Date: Wed, 30 Dec 2009 02:36:50 +0000 (+0000) Subject: lda-settings: Try to set the the postmaster_address if it wasn't configured. X-Git-Tag: 2.0.beta2~79 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ba634917acf65c8dacdb93c349607ffd0fee3297;p=thirdparty%2Fdovecot%2Fcore.git lda-settings: Try to set the the postmaster_address if it wasn't configured. --HG-- branch : HEAD --- diff --git a/src/lib-lda/lda-settings.c b/src/lib-lda/lda-settings.c index 2ba0d8e0cd..8769241387 100644 --- a/src/lib-lda/lda-settings.c +++ b/src/lib-lda/lda-settings.c @@ -71,10 +71,17 @@ static bool lda_settings_check(void *_set, pool_t pool ATTR_UNUSED, const char **error_r) { struct lda_settings *set = _set; + const char *fqdn = NULL; if (*set->postmaster_address == '\0') { - *error_r = "postmaster_address setting not given"; - return FALSE; + fqdn = my_hostdomain(); + /* check for valid looking fqdn */ + if (strchr(fqdn, '.') == 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);