]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lda-settings: Try to set the the postmaster_address if it wasn't configured.
authorPascal Volk <user@localhost.localdomain.org>
Wed, 30 Dec 2009 02:36:50 +0000 (02:36 +0000)
committerPascal Volk <user@localhost.localdomain.org>
Wed, 30 Dec 2009 02:36:50 +0000 (02:36 +0000)
--HG--
branch : HEAD

src/lib-lda/lda-settings.c

index 2ba0d8e0cd65d53ddd6284b3771ee98b5b87b8f4..8769241387f5c75ddf5e1e1c901c4b453edd1b3d 100644 (file)
@@ -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);