From: Timo Sirainen Date: Mon, 9 Nov 2009 20:04:33 +0000 (-0500) Subject: lib-lda: If hostname setting is empty, default to system's hostname. X-Git-Tag: 2.0.alpha3~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c53affdff64a7c4c2ab98018e08d659c7948ec5a;p=thirdparty%2Fdovecot%2Fcore.git lib-lda: If hostname setting is empty, default to system's hostname. --HG-- branch : HEAD --- diff --git a/src/lib-lda/lda-settings.c b/src/lib-lda/lda-settings.c index eec615ce5b..99b57fd771 100644 --- a/src/lib-lda/lda-settings.c +++ b/src/lib-lda/lda-settings.c @@ -1,6 +1,7 @@ /* Copyright (c) 2005-2009 Dovecot authors, see the included COPYING file */ #include "lib.h" +#include "hostpid.h" #include "settings-parser.h" #include "mail-storage-settings.h" #include "lda-settings.h" @@ -76,5 +77,9 @@ static bool lda_settings_check(void *_set, pool_t pool ATTR_UNUSED, *error_r = "postmaster_address setting not given"; return FALSE; } + if (*set->hostname == '\0') { + i_assert(my_hostname != NULL); + set->hostname = my_hostname; + } return TRUE; }