masqmail

diff src/conf.c @ 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
parents 0bd27f603910
children 04744e3e8b18
line diff
     1.1 --- a/src/conf.c	Sun Sep 04 10:23:00 2011 +0200
     1.2 +++ b/src/conf.c	Sun Sep 04 11:25:38 2011 +0200
     1.3 @@ -506,8 +506,6 @@
     1.4  			conf.local_addresses = parse_list(rval, TRUE);
     1.5  		else if (strcmp(lval, "not_local_addresses") == 0)
     1.6  			conf.not_local_addresses = parse_list(rval, TRUE);
     1.7 -		else if (strcmp(lval, "local_nets") == 0)
     1.8 -			conf.local_nets = parse_list(rval, FALSE);
     1.9  		else if (strcmp(lval, "do_save_envelope_to") == 0)
    1.10  			conf.do_save_envelope_to = parse_boolean(rval);
    1.11  		else if (strcmp(lval, "defer_all") == 0)
    1.12 @@ -558,13 +556,12 @@
    1.13  #else
    1.14  			logwrite(LOG_WARNING, "%s ignored: not compiled with ident support\n", lval);
    1.15  #endif
    1.16 -		} else if ((strncmp(lval, "connect_route.", 14) == 0)
    1.17 -		           || (strncmp(lval, "online_routes.", 14) == 0)) {
    1.18 +		} else if (strncmp(lval, "query_routes.", 13) == 0) {
    1.19  			GList *file_list = parse_list(rval, FALSE);
    1.20 -			table_pair *pair = create_pair(&(lval[14]), file_list);
    1.21 -			conf.connect_routes = g_list_append(conf.connect_routes, pair);
    1.22 -		} else if (strcmp(lval, "local_net_route") == 0) {
    1.23 -			conf.local_net_routes = parse_list(rval, FALSE);
    1.24 +			table_pair *pair = create_pair(lval+13, file_list);
    1.25 +			conf.query_routes = g_list_append(conf.query_routes, pair);
    1.26 +		} else if (strcmp(lval, "permanent_routes") == 0) {
    1.27 +			conf.perma_routes = parse_list(rval, FALSE);
    1.28  		} else if (strcmp(lval, "online_query") == 0)
    1.29  			conf.online_query = g_strdup(rval);
    1.30  		else if (strcmp(lval, "do_queue") == 0)
    1.31 @@ -630,7 +627,7 @@
    1.32  }
    1.33  
    1.34  connect_route*
    1.35 -read_route(gchar * filename, gboolean is_local_net)
    1.36 +read_route(gchar * filename, gboolean is_perma)
    1.37  {
    1.38  	gboolean ok = FALSE;
    1.39  	FILE *in;
    1.40 @@ -645,7 +642,7 @@
    1.41  
    1.42  	route->expand_h_sender_address = TRUE;
    1.43  
    1.44 -	route->is_local_net = is_local_net;
    1.45 +	route->is_perma = is_perma;
    1.46  
    1.47  	route->do_pipelining = TRUE;
    1.48  
    1.49 @@ -773,10 +770,8 @@
    1.50  
    1.51  	if (!route->resolve_list) {
    1.52  #ifdef ENABLE_RESOLVER
    1.53 -		if (!is_local_net) {
    1.54 -			route->resolve_list = g_list_append(route->resolve_list, resolve_dns_mx);
    1.55 -			route->resolve_list = g_list_append(route->resolve_list, resolve_dns_a);
    1.56 -		}
    1.57 +		route->resolve_list = g_list_append(route->resolve_list, resolve_dns_mx);
    1.58 +		route->resolve_list = g_list_append(route->resolve_list, resolve_dns_a);
    1.59  #endif
    1.60  		route->resolve_list = g_list_append(route->resolve_list, resolve_byname);
    1.61  	}
    1.62 @@ -855,7 +850,7 @@
    1.63  }
    1.64  
    1.65  GList*
    1.66 -read_route_list(GList * rf_list, gboolean is_local_net)
    1.67 +read_route_list(GList * rf_list, gboolean is_perma)
    1.68  {
    1.69  	GList *list = NULL;
    1.70  	GList *node;
    1.71 @@ -867,7 +862,7 @@
    1.72  
    1.73  	foreach(rf_list, node) {
    1.74  		gchar *fname = (gchar *) (node->data);
    1.75 -		connect_route *route = read_route(fname, is_local_net);
    1.76 +		connect_route *route = read_route(fname, is_perma);
    1.77  		if (route)
    1.78  			list = g_list_append(list, route);
    1.79  		else
    1.80 @@ -893,21 +888,3 @@
    1.81  	}
    1.82  	g_list_free(list);
    1.83  }
    1.84 -
    1.85 -connect_route*
    1.86 -create_local_route()
    1.87 -{
    1.88 -	connect_route *route;
    1.89 -
    1.90 -	route = g_malloc(sizeof(connect_route));
    1.91 -	if (!route) {
    1.92 -		return NULL;
    1.93 -	}
    1.94 -	memset(route, 0, sizeof(connect_route));
    1.95 -	route->is_local_net = TRUE;
    1.96 -	route->name = g_strdup("default local_net_route");
    1.97 -	route->expand_h_sender_address = TRUE;
    1.98 -	route->resolve_list = g_list_append(NULL, resolve_byname);
    1.99 -	route->connect_error_fail = TRUE;
   1.100 -	return route;
   1.101 -}