dovecot-2.0-sslstream: hostname setting now defaults to fqdn. po...

dovecot at dovecot.org dovecot at dovecot.org
Sat Feb 13 02:58:35 EET 2010


details:   http://hg.dovecot.org/dovecot-2.0-sslstream/rev/e1d112ef2e4c
changeset: 10587:e1d112ef2e4c
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Jan 26 18:52:06 2010 +0200
description:
hostname setting now defaults to fqdn. postmaster_address defaults to postmaster@<hostname setting>.

diffstat:

1 file changed, 6 insertions(+), 11 deletions(-)
src/lib-lda/lda-settings.c |   17 ++++++-----------

diffs (35 lines):

diff -r 941511db13c3 -r e1d112ef2e4c src/lib-lda/lda-settings.c
--- a/src/lib-lda/lda-settings.c	Tue Jan 26 13:40:01 2010 +0200
+++ b/src/lib-lda/lda-settings.c	Tue Jan 26 18:52:06 2010 +0200
@@ -67,25 +67,20 @@ const struct setting_parser_info lda_set
 	.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;
 }


More information about the dovecot-cvs mailing list