]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-lda: If hostname setting is empty, default to system's hostname.
authorTimo Sirainen <tss@iki.fi>
Mon, 9 Nov 2009 20:04:33 +0000 (15:04 -0500)
committerTimo Sirainen <tss@iki.fi>
Mon, 9 Nov 2009 20:04:33 +0000 (15:04 -0500)
--HG--
branch : HEAD

src/lib-lda/lda-settings.c

index eec615ce5b5f388a21ecd53c8e1813936b519132..99b57fd771dd1f6229c05cd43fd038ae3004c046 100644 (file)
@@ -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;
 }