masqmail

diff src/deliver.c @ 317:55b7bde95d37

reworked allowed and denied addrs for routes The following refactorings had been made: - allowed_mail_locals + allowed_return_paths -> allowed_senders - not_allowed_mail_locals + not_allowed_return_paths -> denied_senders - allowed_rcpt_domains -> allowed_recipients - not_allowed_rcpt_domains -> denied_recipients The new options allow more consistent and more flexible matching.
author meillo@marmaro.de
date Thu, 28 Apr 2011 09:55:06 +0200
parents c98aa884d2cb
children 412385b57dc4
line diff
     1.1 --- a/src/deliver.c	Mon Apr 25 15:17:30 2011 +0200
     1.2 +++ b/src/deliver.c	Thu Apr 28 09:55:06 2011 +0200
     1.3 @@ -560,21 +560,21 @@
     1.4  			continue;
     1.5  		}
     1.6  
     1.7 -		/* filter by allowed return paths (= envelope sender) */
     1.8 -		if (!route_is_allowed_mail_local(route, msgout->msg->return_path)
     1.9 -		   || !route_is_allowed_return_path(route, msgout->msg->return_path)) {
    1.10 +		/* filter by allowed envelope sender */
    1.11 +		if (!route_sender_is_allowed(route, msgout->msg->return_path)) {
    1.12  			destroy_msg_out(msgout_cloned);
    1.13  			continue;
    1.14  		}
    1.15  
    1.16 -		/* filter by allowed rcpt addrs (= envelope rcpts) */
    1.17 -		GList *rcpt_list_allowed = NULL, *rcpt_list_notallowed = NULL;
    1.18 -		msg_rcptlist_route(route, msgout_cloned->rcpt_list, &rcpt_list_allowed, &rcpt_list_notallowed);
    1.19 -
    1.20 +		/* filter by allowed envelope rcpts */
    1.21 +		GList* rcpt_list_allowed = NULL;
    1.22 +		GList* rcpt_list_notallowed = NULL;
    1.23 +		route_split_rcpts(route, msgout_cloned->rcpt_list, &rcpt_list_allowed, &rcpt_list_notallowed);
    1.24  		if (!rcpt_list_allowed) {
    1.25  			destroy_msg_out(msgout_cloned);
    1.26  			continue;
    1.27  		}
    1.28 +
    1.29  		logwrite(LOG_NOTICE, "%s using '%s'\n", msgout->msg->uid, route->name);
    1.30  
    1.31  		g_list_free(msgout_cloned->rcpt_list);