dovecot-2.0: lda-settings: Try to set the the postmaster_address...

dovecot at dovecot.org dovecot at dovecot.org
Wed Dec 30 04:38:09 EET 2009


details:   http://hg.dovecot.org/dovecot-2.0/rev/d6d1df7ea4e0
changeset: 10540:d6d1df7ea4e0
user:      Pascal Volk <user at localhost.localdomain.org>
date:      Wed Dec 30 02:36:50 2009 +0000
description:
lda-settings: Try to set the the postmaster_address if it wasn't configured.

diffstat:

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

diffs (23 lines):

diff -r 0462fcfb809a -r d6d1df7ea4e0 src/lib-lda/lda-settings.c
--- a/src/lib-lda/lda-settings.c	Tue Dec 29 18:32:13 2009 -0500
+++ b/src/lib-lda/lda-settings.c	Wed Dec 30 02:36:50 2009 +0000
@@ -71,10 +71,17 @@ static bool lda_settings_check(void *_se
 			       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);


More information about the dovecot-cvs mailing list