comparison 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
comparison
equal deleted inserted replaced
156:ee2afbf92428 157:586f001f5bbd
431 conf.do_relay = TRUE; 431 conf.do_relay = TRUE;
432 conf.alias_local_cmp = strcmp; 432 conf.alias_local_cmp = strcmp;
433 conf.max_defer_time = 86400 * 4; /* 4 days */ 433 conf.max_defer_time = 86400 * 4; /* 4 days */
434 conf.max_msg_size = 0; /* no limit on msg size */ 434 conf.max_msg_size = 0; /* no limit on msg size */
435 conf.spool_dir = SPOOL_DIR; 435 conf.spool_dir = SPOOL_DIR;
436 conf.local_hosts = parse_list("localhost", FALSE);
437 conf.mail_dir = "/var/mail"; 436 conf.mail_dir = "/var/mail";
438 437
439 if ((in = fopen(filename, "r")) == NULL) { 438 if ((in = fopen(filename, "r")) == NULL) {
440 logwrite(LOG_ALERT, "could not open config file %s: %s\n", filename, strerror(errno)); 439 logwrite(LOG_ALERT, "could not open config file %s: %s\n", filename, strerror(errno));
441 return FALSE; 440 return FALSE;
612 conf.mbox_default = g_strdup("mbox"); 611 conf.mbox_default = g_strdup("mbox");
613 612
614 if (conf.warn_intervals == NULL) 613 if (conf.warn_intervals == NULL)
615 conf.warn_intervals = parse_list("1h;4h;8h;1d;2d;3d", FALSE); 614 conf.warn_intervals = parse_list("1h;4h;8h;1d;2d;3d", FALSE);
616 615
616 if (!conf.local_hosts) {
617 char* shortname = strdup(conf.host_name);
618 char* p = strchr(shortname, '.');
619 if (p) {
620 *p = '\0';
621 }
622 /* we don't care if shortname and conf.host_name are the same */
623 char* local_hosts_str = g_strdup_printf("localhost;%s;%s", shortname, conf.host_name);
624 conf.local_hosts = parse_list(local_hosts_str, FALSE);
625 free(shortname);
626 free(local_hosts_str);
627 }
628
629
617 return TRUE; 630 return TRUE;
618 } 631 }
619 632
620 connect_route* 633 connect_route*
621 read_route(gchar * filename, gboolean is_local_net) 634 read_route(gchar * filename, gboolean is_local_net)