changeset 354:08932c629849

reworked the route concept; removed the idea of the localnet Renamed to reflect the actual meaning more clearly: s/online_routes/query_routes/g s/local_net_route/permanent_routes/g Removed local_nets, which are now represented by allowed_recipients in a permanent route. (See. examples/localnet.route) There is no more abiguity between `local' and `local net'. Run admin/config-transition on your config to learn how to update it.
author markus schnalke <meillo@marmaro.de>
date Sun, 04 Sep 2011 11:25:38 +0200 (2011-09-04)
parents 48ff59cf0b34
children ddb7b3fd3d08
files admin/config-transition docs/simple-relay-setup examples/localnet.route examples/masqmail.conf man/masqmail.8 man/masqmail.conf.5 man/masqmail.route.5 src/conf.c src/deliver.c src/masqmail.h tests/relay-to-hostname-mta/makefile tests/relay-to-hostname-mta/online tests/relay-to-hostname-mta/test.conf.tpl tests/relay-to-localhost-mta/online tests/relay-to-localhost-mta/test.conf.tpl tests/relay-to-localhost-mta/test.route
diffstat 16 files changed, 163 insertions(+), 156 deletions(-) [+]
line wrap: on
line diff
--- a/admin/config-transition	Sun Sep 04 10:23:00 2011 +0200
+++ b/admin/config-transition	Sun Sep 04 11:25:38 2011 +0200
@@ -78,6 +78,24 @@
 Now known as online_query. online_detect=pipe is not needed anymore. \
 "
 
+check["connect_route\\\\."] = "conf" SUBSEP "Removed in 0.3.4" SUBSEP "\
+The option had been already obsolete. Use \`query_routes.' instead.\
+"
+
+check["online_routes\\\\."] = "conf" SUBSEP "Renamed in 0.3.4" SUBSEP "\
+Known as \`query_routes.' now.\
+"
+
+check["local_net_route"] = "conf" SUBSEP "Renamed in 0.3.4" SUBSEP "\
+Known as \`permanent_routes' now, because that's what they actually are.\
+"
+
+check["local_nets"] = "conf" SUBSEP "Removed in 0.3.4" SUBSEP "\
+There is no concept of a \`\`local net'' in masqmail anymore. \
+Create a permanent route with \`allowed_recipients' set accordingly. \
+See man pages and example configurations for details.\
+"
+
 # route files
 
 check["pop3_login"] = "route" SUBSEP "Removed in 0.3.0" SUBSEP "\
--- a/docs/simple-relay-setup	Sun Sep 04 10:23:00 2011 +0200
+++ b/docs/simple-relay-setup	Sun Sep 04 11:25:38 2011 +0200
@@ -28,7 +28,7 @@
 You need a config file like this one:
 
     host_name = "foo.example.org"
-    online_routes.default = /etc/masqmail/default.route
+    query_routes.default = /etc/masqmail/default.route
 
 (Substitute a real hostname, of course.)
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/localnet.route	Sun Sep 04 11:25:38 2011 +0200
@@ -0,0 +1,16 @@
+# Example route for a local network
+# see also: man 5 masqmail.route
+#
+# Include this route with
+#     permanent_routes = "/etc/masqmail/localnet.route"
+# in masqmail.conf
+
+# adjust this to the machines on the local net
+allowed_recipients = "*@*mydomain.invalid;*@also.onlocal.net"
+
+# We expect the target hosts to be online. If not, fail.
+# Use this setting if you are sure the target hosts are online.
+connect_error_fail = true
+
+# If you don't want to query the DNS, uncomment:
+#resolve_list = "byname"
--- a/examples/masqmail.conf	Sun Sep 04 10:23:00 2011 +0200
+++ b/examples/masqmail.conf	Sun Sep 04 11:25:38 2011 +0200
@@ -6,11 +6,6 @@
 # CHANGING THIS IS REQUIRED!
 host_name="striped.patchwork.net"
 
-# Nets considered local, for immediate delivery attempts:
-# ALL hosts not included in either local_host or local_nets are
-# considered to be 'outside', meaning that messages to them will be queued
-#local_nets="*.patchwork.net;blue;striped"
-
 # accept connections on these interfaces:
 # Change this to something like: "localhost:25;foo:25" if other machines
 # on your network shall be able to connect to masqmail.
@@ -38,14 +33,14 @@
 #caseless_matching = false
 
 
-# special routes:
-
+# routes
 # CHANGING THIS IS REQUIRED!
+
+# set up a route for the local net:
+#permanent_routes = "/etc/masqmail/localnet.route"
+
 # You can use as many routes (one for each provider) as you like:
-#connect_route.example = "/etc/masqmail/example.route"
+#query_routes.example = "/etc/masqmail/example.route"
 
 # you can also give a list of routes for a single connection:
-#connect_route.foobar = "/etc/masqmail/foo.route;/etc/masqmail/bar.route"
-
-# you can also set routes for the local net:
-#local_net_route = "/etc/masqmail/local.route;/etc/masqmail/other_lan.route"
+#query_routes.foobar = "/etc/masqmail/foo.route;/etc/masqmail/bar.route"
--- a/man/masqmail.8	Sun Sep 04 10:23:00 2011 +0200
+++ b/man/masqmail.8	Sun Sep 04 11:25:38 2011 +0200
@@ -87,8 +87,8 @@
 
 Do a single queue run.
 Try to deliver all messages in the queue.
-Masqmail sends to addresses on the local host, on the local net,
-and to remote ones, if available online routes permit.
+Masqmail sends to addresses on the local host
+and to remote ones, if available online routes permit it.
 That means, masqmail sends all queued mail it can.
 Online detection is done with the configured
 method (see \fBonline_query\fR in \fBmasqmail.conf(5)\fR).
@@ -101,7 +101,7 @@
 
 The route configuration for \fINAME\fP is read and queued mail
 to matching remote recipients is sent.
-(See \fBonline_routes.\fINAME\fR in the main config file.)
+(See \fBquery_routes.\fINAME\fR in the main config file.)
 
 You may want to use this option in scripts that run as soon as a link
 to the internet has been set up (e.g. ip-up).
--- a/man/masqmail.conf.5	Sun Sep 04 10:23:00 2011 +0200
+++ b/man/masqmail.conf.5	Sun Sep 04 11:25:38 2011 +0200
@@ -25,8 +25,8 @@
 For some values, patterns (like `*',`?') can be used.
 The spaces in front of and after the equal sign `=' are optional.
 
-Most lists (exceptions: \fBlocal_hosts\fR, \fBlocal_nets\fR, \fBlisten_addresses\fR,
-and \fBonline_routes\fR) accept files.
+Most lists (exceptions: \fBlocal_hosts\fR, \fBlisten_addresses\fR,
+\fBquery_routes.\fIname\fR and \fBpermanent_routes\fR) accept files.
 These will be recognized by a leading slash `/'.
 The contents of these files will be included at the position of the file name,
 there can be items or other files before and after the file entry.
@@ -164,13 +164,6 @@
 not_local_addresses = "eric@mydomain.net"
 
 .TP
-\fBlocal_nets = \fIlist\fR
-
-A semicolon `;' separated list of hostnames which are on the `local' net.
-Delivery to these hosts is attempted immediately.
-You can use patterns with `*', e.g. "*.bar.com".
-
-.TP
 \fBlisten_addresses = \fIlist\fR
 
 A semicolon `;' separated list of interfaces on which connections will be accepted.
@@ -222,35 +215,55 @@
 Default: false
 
 .TP
-\fBonline_routes.\fIname\fR = \fIlist\fR
+\fBpermanent_routes\fR = \fIlist\fR
+
+Set this to the filename (or a semicolon-separated list of filenames)
+of the route configuration for always available connections.
+Main purpose is to define a mail server with mail_host in your local network,
+or if masqmail should send mail directly to the target host.
+If you have only a single host, you can leave it unset.
 
-Replace \fIname\fR with a name to identify a connection.
-Set this to a filename (or a list of filenames) for the special route configuration for that connection.
-You will use that name to call masqmail with the \fB\-qo\fR option every time a
-connection to your ISP is set up.
+A setting `\fBlocal_nets\fR = \fI"*home.net"\fR' in versions <= 0.3.3
+is in newer versions configured as:
+`\fBpermanent_routes\fR = \fI"/etc/masqmail/homenet.route"\fR'
+and the route file `homenet.route' containing:
+.in +1in
+.nf
+allowed_recipients = "*@*home.net"
+connect_error_fail = true
+resolve_list = byname
+.fi
+.in 0
+This is just as it had been with \fBlocal_net_route\fP,
+with the exception that the filtering for appropriate addresses
+is only in the route file and not with \fBlocal_nets\fR.
+
+.TP
+\fBquery_routes.\fIname\fR = \fIlist\fR
+
+Replace \fIname\fR with a name to identify the connection.
+Set this to a filename (or a semicolon-separated list of filenames)
+for the route configuration for that connection.
+
+Routes of this kind cannot be expected to be online always.
+Masqmail will query which of the routes are online.
+
+You can use the name to call masqmail with the \fB\-qo\fR option every time a
+connection to your ISP is set up, in order to send queued mail through this 
+route.
 
 Example: Your ISP has the name FastNet.
 Then you write the following line in the main configuration:
 
- \fBonline_routes.FastNet\fR = \fI"/etc/masqmail/fastnet.route"\fR
+\fBquery_routes.\fBFastNet\fR = \fI"/etc/masqmail/fastnet.route"\fR
 
-\fI/etc/masqmail/fastnet.route\fR is the route configuration file, see \fBmasqmail.route(5)\fR.
-As soon as a link to FastNet has been set up, you call masqmail \fB\-qo \fIFastNet\fR.
+\fI/etc/masqmail/fastnet.route\fR is the route configuration file,
+see \fBmasqmail.route(5)\fR.
+As soon as a link to FastNet has been set up,
+you call `masqmail \fB\-qo \fIFastNet\fR'.
 Masqmail will then read the specified file and send the mails.
 
-.TP
-\fBconnect_route.\fIname\fR = \fIlist\fR
-
-Old name for \fBonline_routes\fR.
-
-.TP
-\fBlocal_net_route = \fIfile\fR
-
-This is similar to \fBonline_routes.\fIname\fR but used for delilvery to the local net.
-Recipient addresses that are in local_nets will be routed using this route configuration.
-Main purpose is to define a mail server with mail_host in your local network.
-In simple environments this can be left unset.
-If unset, a default route configuration (named ``default local_net_route'') will be used.
+See \fBonline_query\fP.
 
 .TP
 \fBalias_file = \fIfile\fR
@@ -366,7 +379,7 @@
 
 Masqmail executes the command given and reads from its standard output.
 The command should just print a route name, as defined
-with \fBonline_routes.\fIname\fR, to standard output and return a zero status code.
+with \fBquery_routes.\fIname\fR, to standard output and return a zero status code.
 Masqmail assumes it is offline if the script returns with a non-zero status.
 Leading and trailing whitespace is removed from the output.
 
--- a/man/masqmail.route.5	Sun Sep 04 10:23:00 2011 +0200
+++ b/man/masqmail.route.5	Sun Sep 04 11:25:38 2011 +0200
@@ -104,7 +104,7 @@
 The reason for this is that masqmail is designed for non permanent internet connections,
 where such errors may occur quite often, and a bounce would be annoying.
 
-For the default local_net route it is set to true.
+You probably want to set this to true for permanent routes.
 
 
 .SH SMTP CONFIGURATION
@@ -125,10 +125,14 @@
 Specify the method how the domain of the server is resolved.
 Possible values are dns_mx, dns_a, byname.
 For `dns_mx', the domain is assumed to be an MX pointer to a list of host names,
-these will be tried each in order (lowest preference value first, equal preference values in random order).
+these will be tried each in order
+(lowest preference value first, equal preference values in random order).
 For `dns_a', the domain is assumed to be an A pointer.
 For `byname', the library function \fBgethostbyname(3)\fR will be used.
 
+For routes to a local network, where you likely don't have a DNS service,
+use only `byname'.
+
 The default is "dns_mx;dns_a;byname".
 
 .TP
--- a/src/conf.c	Sun Sep 04 10:23:00 2011 +0200
+++ b/src/conf.c	Sun Sep 04 11:25:38 2011 +0200
@@ -506,8 +506,6 @@
 			conf.local_addresses = parse_list(rval, TRUE);
 		else if (strcmp(lval, "not_local_addresses") == 0)
 			conf.not_local_addresses = parse_list(rval, TRUE);
-		else if (strcmp(lval, "local_nets") == 0)
-			conf.local_nets = parse_list(rval, FALSE);
 		else if (strcmp(lval, "do_save_envelope_to") == 0)
 			conf.do_save_envelope_to = parse_boolean(rval);
 		else if (strcmp(lval, "defer_all") == 0)
@@ -558,13 +556,12 @@
 #else
 			logwrite(LOG_WARNING, "%s ignored: not compiled with ident support\n", lval);
 #endif
-		} else if ((strncmp(lval, "connect_route.", 14) == 0)
-		           || (strncmp(lval, "online_routes.", 14) == 0)) {
+		} else if (strncmp(lval, "query_routes.", 13) == 0) {
 			GList *file_list = parse_list(rval, FALSE);
-			table_pair *pair = create_pair(&(lval[14]), file_list);
-			conf.connect_routes = g_list_append(conf.connect_routes, pair);
-		} else if (strcmp(lval, "local_net_route") == 0) {
-			conf.local_net_routes = parse_list(rval, FALSE);
+			table_pair *pair = create_pair(lval+13, file_list);
+			conf.query_routes = g_list_append(conf.query_routes, pair);
+		} else if (strcmp(lval, "permanent_routes") == 0) {
+			conf.perma_routes = parse_list(rval, FALSE);
 		} else if (strcmp(lval, "online_query") == 0)
 			conf.online_query = g_strdup(rval);
 		else if (strcmp(lval, "do_queue") == 0)
@@ -630,7 +627,7 @@
 }
 
 connect_route*
-read_route(gchar * filename, gboolean is_local_net)
+read_route(gchar * filename, gboolean is_perma)
 {
 	gboolean ok = FALSE;
 	FILE *in;
@@ -645,7 +642,7 @@
 
 	route->expand_h_sender_address = TRUE;
 
-	route->is_local_net = is_local_net;
+	route->is_perma = is_perma;
 
 	route->do_pipelining = TRUE;
 
@@ -773,10 +770,8 @@
 
 	if (!route->resolve_list) {
 #ifdef ENABLE_RESOLVER
-		if (!is_local_net) {
-			route->resolve_list = g_list_append(route->resolve_list, resolve_dns_mx);
-			route->resolve_list = g_list_append(route->resolve_list, resolve_dns_a);
-		}
+		route->resolve_list = g_list_append(route->resolve_list, resolve_dns_mx);
+		route->resolve_list = g_list_append(route->resolve_list, resolve_dns_a);
 #endif
 		route->resolve_list = g_list_append(route->resolve_list, resolve_byname);
 	}
@@ -855,7 +850,7 @@
 }
 
 GList*
-read_route_list(GList * rf_list, gboolean is_local_net)
+read_route_list(GList * rf_list, gboolean is_perma)
 {
 	GList *list = NULL;
 	GList *node;
@@ -867,7 +862,7 @@
 
 	foreach(rf_list, node) {
 		gchar *fname = (gchar *) (node->data);
-		connect_route *route = read_route(fname, is_local_net);
+		connect_route *route = read_route(fname, is_perma);
 		if (route)
 			list = g_list_append(list, route);
 		else
@@ -893,21 +888,3 @@
 	}
 	g_list_free(list);
 }
-
-connect_route*
-create_local_route()
-{
-	connect_route *route;
-
-	route = g_malloc(sizeof(connect_route));
-	if (!route) {
-		return NULL;
-	}
-	memset(route, 0, sizeof(connect_route));
-	route->is_local_net = TRUE;
-	route->name = g_strdup("default local_net_route");
-	route->expand_h_sender_address = TRUE;
-	route->resolve_list = g_list_append(NULL, resolve_byname);
-	route->connect_error_fail = TRUE;
-	return route;
-}
--- a/src/deliver.c	Sun Sep 04 10:23:00 2011 +0200
+++ b/src/deliver.c	Sun Sep 04 11:25:38 2011 +0200
@@ -667,15 +667,34 @@
 	return TRUE;
 }
 
-gboolean
-deliver_msgout_list_online(GList * msgout_list)
+int
+deliver_remote(GList* remote_msgout_list)
 {
+	int ok = TRUE;
+	GList *route_list = NULL;
+	GList *route_node;
 	GList *rf_list = NULL;
 	gchar *connect_name = NULL;
-	gboolean ok = FALSE;
-	GList *route_node;
-	GList *route_list;
+
+	if (!remote_msgout_list) {
+		return FALSE;
+	}
+
+	/* perma routes */
+	if (conf.perma_routes) {
+		DEBUG(5) debugf("processing perma_routes\n");
 
+		route_list = read_route_list(conf.perma_routes, TRUE);
+		foreach(route_list, route_node) {
+			connect_route *route = (connect_route *) (route_node->data);
+			if (!deliver_route_msg_list(route, remote_msgout_list)) {
+				ok = FALSE;
+			}
+		}
+		destroy_route_list(route_list);
+	}
+
+	/* query routes */
 	connect_name = online_query();
 	if (!connect_name) {
 		DEBUG(5) debugf("online query returned false\n");
@@ -686,7 +705,7 @@
 	DEBUG(5) debugf("processing query_routes\n");
 	logwrite(LOG_NOTICE, "detected online configuration `%s'\n", connect_name);
 
-	rf_list = (GList *) table_find(conf.connect_routes, connect_name);
+	rf_list = (GList *) table_find(conf.query_routes, connect_name);
 	if (!rf_list) {
 		logwrite(LOG_ALERT, "route list with name '%s' not found.\n", connect_name);
 		return FALSE;
@@ -701,7 +720,7 @@
 	foreach(route_list, route_node) {
 		connect_route *route = (connect_route *) (route_node->data);
 		/* TODO: ok gets overwritten */
-		ok = deliver_route_msg_list(route, msgout_list);
+		ok = deliver_route_msg_list(route, remote_msgout_list);
 	}
 	destroy_route_list(route_list);
 
@@ -709,10 +728,8 @@
 }
 
 /*
-   This function searches in the list of rcpt addresses
-   for local and 'local net' addresses. Remote addresses
-   which are reachable only when online are treated specially
-   in another function.
+   This function splits the list of rcpt addresses
+   into local and remote addresses and processes them accordingly.
 */
 gboolean
 deliver_msg_list(GList * msg_list, guint flags)
@@ -720,8 +737,7 @@
 	GList *msgout_list = NULL;
 	GList *msg_node;
 	GList *local_msgout_list = NULL;
-	GList *localnet_msgout_list = NULL;
-	GList *other_msgout_list = NULL;
+	GList *remote_msgout_list = NULL;
 	GList *msgout_node;
 	GList *alias_table = NULL;
 	gboolean ok = TRUE;
@@ -732,7 +748,6 @@
 		msgout_list = g_list_append(msgout_list, create_msg_out(msg));
 	}
 
-
 	if (conf.alias_file) {
 		alias_table = table_read(conf.alias_file, ':');
 	}
@@ -742,7 +757,6 @@
 		msg_out *msgout = (msg_out *) (msgout_node->data);
 		GList *rcpt_list;
 		GList *local_rcpt_list = NULL;
-		GList *localnet_rcpt_list = NULL;
 		GList *other_rcpt_list = NULL;
 
 		if (!spool_lock(msgout->msg->uid)) {
@@ -767,7 +781,9 @@
 			rcpt_list = aliased_rcpt_list;
 		}
 
-		split_rcpts(rcpt_list, conf.local_nets, &local_rcpt_list, &localnet_rcpt_list, &other_rcpt_list);
+		/* split_rcpts(rcpt_list, NULL, &local_rcpt_list, * NULL, &other_rcpt_list); */
+		local_rcpt_list = local_rcpts(rcpt_list);
+		other_rcpt_list = remote_rcpts(rcpt_list);
 		g_list_free(rcpt_list);
 
 		/* local recipients */
@@ -777,18 +793,11 @@
 			local_msgout_list = g_list_append(local_msgout_list, local_msgout);
 		}
 
-		/* local net recipients */
-		if ((flags & DLVR_LAN) && localnet_rcpt_list) {
-			msg_out *localnet_msgout = clone_msg_out(msgout);
-			localnet_msgout->rcpt_list = localnet_rcpt_list;
-			localnet_msgout_list = g_list_append(localnet_msgout_list, localnet_msgout);
-		}
-
-		/* remote recipients (the rest), requires online delivery  */
+		/* remote recipients, requires online delivery  */
 		if ((flags & DLVR_ONLINE) && other_rcpt_list) {
-			msg_out *other_msgout = clone_msg_out(msgout);
-			other_msgout->rcpt_list = other_rcpt_list;
-			other_msgout_list = g_list_append(other_msgout_list, other_msgout);
+			msg_out *remote_msgout = clone_msg_out(msgout);
+			remote_msgout->rcpt_list = other_rcpt_list;
+			remote_msgout_list = g_list_append(remote_msgout_list, remote_msgout);
 		}
 	}
 
@@ -796,7 +805,7 @@
 		destroy_table(alias_table);
 	}
 
-	/* actual delivery */
+	/* process local/remote msgout lists -> delivery */
 
 	if (local_msgout_list) {
 		DEBUG(5) debugf("local_msgout_list\n");
@@ -809,33 +818,10 @@
 		destroy_msg_out_list(local_msgout_list);
 	}
 
-	if (localnet_msgout_list) {
-		GList *route_list = NULL;
-		GList *route_node;
-
-		DEBUG(5) debugf("localnet_msgout_list\n");
-		if (conf.local_net_routes) {
-			route_list = read_route_list(conf.local_net_routes, TRUE);
-		} else {
-			route_list = g_list_append(NULL, create_local_route());
-		}
-
-		foreach(route_list, route_node) {
-			connect_route *route = (connect_route *) (route_node->data);
-			if (!deliver_route_msg_list(route, localnet_msgout_list)) {
-				ok = FALSE;
-			}
-		}
-		destroy_msg_out_list(localnet_msgout_list);
-		destroy_route_list(route_list);
-	}
-
-	if (other_msgout_list) {
-		DEBUG(5) debugf("other_msgout_list\n");
-		if (!deliver_msgout_list_online(other_msgout_list)) {
-			ok = FALSE;
-		}
-		destroy_msg_out_list(other_msgout_list);
+	if (remote_msgout_list) {
+		DEBUG(5) debugf("remote_msgout_list\n");
+		deliver_remote(remote_msgout_list);
+		destroy_msg_out_list(remote_msgout_list);
 	}
 
 	/* unlock spool files */
--- a/src/masqmail.h	Sun Sep 04 10:23:00 2011 +0200
+++ b/src/masqmail.h	Sun Sep 04 11:25:38 2011 +0200
@@ -81,7 +81,7 @@
 	gchar *name;
 	gchar *filename;
 
-	gboolean is_local_net;
+	gboolean is_perma;
 	gboolean last_route;
 
 	GList *allowed_senders;
@@ -138,7 +138,6 @@
 	GList *local_hosts;
 	GList *local_addresses;
 	GList *not_local_addresses;
-	GList *local_nets;
 	GList *listen_addresses;
 
 	/* ANSI C defines unsigned long to be at least 32bit
@@ -170,8 +169,8 @@
 	gchar *alias_file;
 	int (*localpartcmp) (const char *, const char *);
 
-	GList *local_net_routes;
-	GList *connect_routes;  /* list of pairs which point to lists */
+	GList *perma_routes;
+	GList *query_routes;  /* list of pairs which point to lists */
 
 	gchar *online_query;
 
@@ -261,7 +260,7 @@
 	GList *rcpt_list;
 
 	GList *hdr_list;
-	GList *xtra_hdr_list;
+	GList *xtra_hdr_list;  /* rewritten headers */
 } msg_out;
 
 typedef struct _msgout_perhost {
@@ -344,11 +343,10 @@
 /* conf.c */
 void init_conf();
 gboolean read_conf(gchar * filename);
-connect_route *read_route(gchar * filename, gboolean is_local_net);
-GList *read_route_list(GList * rf_list, gboolean is_local_net);
+connect_route *read_route(gchar * filename, gboolean is_perma);
+GList *read_route_list(GList * rf_list, gboolean is_perma);
 void destroy_route(connect_route * r);
 void destroy_route_list(GList * list);
-connect_route *create_local_route();
 
 /* expand.c */
 GList *var_table_rcpt(GList * var_table, address * rcpt);
--- a/tests/relay-to-hostname-mta/makefile	Sun Sep 04 10:23:00 2011 +0200
+++ b/tests/relay-to-hostname-mta/makefile	Sun Sep 04 11:25:38 2011 +0200
@@ -14,6 +14,7 @@
 
 test.route:
 	echo mail_host=\"`hostname`\" >$@
+	echo "resolve_list = byname" >>$@
 
 clean:
 	rm -f test.conf test test.route
--- a/tests/relay-to-hostname-mta/online	Sun Sep 04 10:23:00 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-test
--- a/tests/relay-to-hostname-mta/test.conf.tpl	Sun Sep 04 10:23:00 2011 +0200
+++ b/tests/relay-to-hostname-mta/test.conf.tpl	Sun Sep 04 11:25:38 2011 +0200
@@ -13,10 +13,10 @@
 host_name="MASQMAIL-TEST"
 
 # we want to deliver through a route named `test' to a local MTA
-# thus we do not define any hosts or nets as local
-# all mail should go through the `test' route.
-online_query = "/bin/cat PWD/online"
-online_routes.test = "PWD/test.route"
+# thus we do not define any hosts as local. All mail should go through
+# the route.
+permanent_routes = "PWD/test.route"
+
 
 # spool files in the current directory
 spool_dir="PWD"
--- a/tests/relay-to-localhost-mta/online	Sun Sep 04 10:23:00 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-test
--- a/tests/relay-to-localhost-mta/test.conf.tpl	Sun Sep 04 10:23:00 2011 +0200
+++ b/tests/relay-to-localhost-mta/test.conf.tpl	Sun Sep 04 11:25:38 2011 +0200
@@ -13,10 +13,10 @@
 host_name="MASQMAIL-TEST"
 
 # we want to deliver through a route named `test' to a local MTA
-# thus we do not define any hosts or nets as local
-# all mail should go through the `test' route.
-online_query = "/bin/cat PWD/online"
-online_routes.test = "PWD/test.route"
+# thus we do not define any hosts as local. All mail should go through
+# the route.
+permanent_routes = "PWD/test.route"
+
 
 # spool files in the current directory
 spool_dir="PWD"
--- a/tests/relay-to-localhost-mta/test.route	Sun Sep 04 10:23:00 2011 +0200
+++ b/tests/relay-to-localhost-mta/test.route	Sun Sep 04 11:25:38 2011 +0200
@@ -1,1 +1,2 @@
 mail_host = "localhost"
+resolve_list = byname