# HG changeset patch # User meillo@marmaro.de # Date 1278575992 -7200 # Node ID 586f001f5bbdb3815c62f4fd53c2ec96b4861c08 # Parent ee2afbf924289dcea0da4f92a43a0513f4fcf518 local_hosts defaults to localhost;foo;foo.example.org now it is generated from the value of host_name diff -r ee2afbf92428 -r 586f001f5bbd man/masqmail.conf.5 --- a/man/masqmail.conf.5 Thu Jul 08 09:49:05 2010 +0200 +++ b/man/masqmail.conf.5 Thu Jul 08 09:59:52 2010 +0200 @@ -128,7 +128,10 @@ Normally you should set it to "localhost;foo;foo.bar.com" if your host has the fully qualified domain name `foo.bar.com'. -Default: \fIlocalhost\fR +Default: localhost ; ; + +Example: \fIlocalhost;foo;foo.example.org\fR +(if you have set \fBhost_name\fR to \fIfoo.example.org\fR) .TP \fBlocal_nets = \fIlist\fR diff -r ee2afbf92428 -r 586f001f5bbd src/conf.c --- a/src/conf.c Thu Jul 08 09:49:05 2010 +0200 +++ b/src/conf.c Thu Jul 08 09:59:52 2010 +0200 @@ -433,7 +433,6 @@ conf.max_defer_time = 86400 * 4; /* 4 days */ conf.max_msg_size = 0; /* no limit on msg size */ conf.spool_dir = SPOOL_DIR; - conf.local_hosts = parse_list("localhost", FALSE); conf.mail_dir = "/var/mail"; if ((in = fopen(filename, "r")) == NULL) { @@ -614,6 +613,20 @@ if (conf.warn_intervals == NULL) conf.warn_intervals = parse_list("1h;4h;8h;1d;2d;3d", FALSE); + if (!conf.local_hosts) { + char* shortname = strdup(conf.host_name); + char* p = strchr(shortname, '.'); + if (p) { + *p = '\0'; + } + /* we don't care if shortname and conf.host_name are the same */ + char* local_hosts_str = g_strdup_printf("localhost;%s;%s", shortname, conf.host_name); + conf.local_hosts = parse_list(local_hosts_str, FALSE); + free(shortname); + free(local_hosts_str); + } + + return TRUE; }