masqmail

diff src/conf.c @ 157:586f001f5bbd

local_hosts defaults to localhost;foo;foo.example.org now it is generated from the value of host_name
author meillo@marmaro.de
date Thu, 08 Jul 2010 09:59:52 +0200
parents ee2afbf92428
children 6dd3a289989b
line diff
     1.1 --- a/src/conf.c	Thu Jul 08 09:49:05 2010 +0200
     1.2 +++ b/src/conf.c	Thu Jul 08 09:59:52 2010 +0200
     1.3 @@ -433,7 +433,6 @@
     1.4  	conf.max_defer_time = 86400 * 4;  /* 4 days */
     1.5  	conf.max_msg_size = 0; /* no limit on msg size */
     1.6  	conf.spool_dir = SPOOL_DIR;
     1.7 -	conf.local_hosts = parse_list("localhost", FALSE);
     1.8  	conf.mail_dir = "/var/mail";
     1.9  
    1.10  	if ((in = fopen(filename, "r")) == NULL) {
    1.11 @@ -614,6 +613,20 @@
    1.12  	if (conf.warn_intervals == NULL)
    1.13  		conf.warn_intervals = parse_list("1h;4h;8h;1d;2d;3d", FALSE);
    1.14  
    1.15 +	if (!conf.local_hosts) {
    1.16 +		char* shortname = strdup(conf.host_name);
    1.17 +		char* p = strchr(shortname, '.');
    1.18 +		if (p) {
    1.19 +			*p = '\0';
    1.20 +		}
    1.21 +		/* we don't care if shortname and conf.host_name are the same */
    1.22 +		char* local_hosts_str = g_strdup_printf("localhost;%s;%s", shortname, conf.host_name);
    1.23 +		conf.local_hosts = parse_list(local_hosts_str, FALSE);
    1.24 +		free(shortname);
    1.25 +		free(local_hosts_str);
    1.26 +	}
    1.27 +
    1.28 +
    1.29  	return TRUE;
    1.30  }
    1.31