masqmail

diff src/deliver.c @ 429:5593964ec779

Added route conditions based on the From header New route config directives: allowed_from_hdrs, denied_from_hdrs. This feature was motivated by Philipp Takacs <philipp29@t-online.de>.
author markus schnalke <meillo@marmaro.de>
date Thu, 20 Nov 2014 20:36:20 +0100
parents 8fedb93e9b72
children
line diff
     1.1 --- a/src/deliver.c	Wed Apr 03 21:45:57 2013 +0200
     1.2 +++ b/src/deliver.c	Thu Nov 20 20:36:20 2014 +0100
     1.3 @@ -667,6 +667,21 @@
     1.4  			continue;
     1.5  		}
     1.6  
     1.7 +		/* filter by allowed from header */
     1.8 +		GList *from_hdrs = NULL;
     1.9 +		char *from_hdr = NULL;
    1.10 +		from_hdrs = find_header(msgout->msg->hdr_list, HEAD_FROM,
    1.11 +				 NULL);
    1.12 +		if (from_hdrs) {
    1.13 +			from_hdr = (char *) ((header *)from_hdrs->data)->value;
    1.14 +			if (!route_from_hdr_is_allowed(route, from_hdr)){
    1.15 +				DEBUG(6) debugf("from hdr `%s' is not allowed for this "
    1.16 +						"route\n", from_hdr);
    1.17 +				destroy_msg_out(msgout_cloned);
    1.18 +				continue;
    1.19 +			}
    1.20 +		}
    1.21 +
    1.22  		logwrite(LOG_NOTICE, "%s using '%s'\n", msgout->msg->uid,
    1.23  				route->name);
    1.24