comparison 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
comparison
equal deleted inserted replaced
428:e972c3cbe1e0 429:5593964ec779
665 if (!rcpt_list_allowed) { 665 if (!rcpt_list_allowed) {
666 destroy_msg_out(msgout_cloned); 666 destroy_msg_out(msgout_cloned);
667 continue; 667 continue;
668 } 668 }
669 669
670 /* filter by allowed from header */
671 GList *from_hdrs = NULL;
672 char *from_hdr = NULL;
673 from_hdrs = find_header(msgout->msg->hdr_list, HEAD_FROM,
674 NULL);
675 if (from_hdrs) {
676 from_hdr = (char *) ((header *)from_hdrs->data)->value;
677 if (!route_from_hdr_is_allowed(route, from_hdr)){
678 DEBUG(6) debugf("from hdr `%s' is not allowed for this "
679 "route\n", from_hdr);
680 destroy_msg_out(msgout_cloned);
681 continue;
682 }
683 }
684
670 logwrite(LOG_NOTICE, "%s using '%s'\n", msgout->msg->uid, 685 logwrite(LOG_NOTICE, "%s using '%s'\n", msgout->msg->uid,
671 route->name); 686 route->name);
672 687
673 g_list_free(msgout_cloned->rcpt_list); 688 g_list_free(msgout_cloned->rcpt_list);
674 msgout_cloned->rcpt_list = rcpt_list_allowed; 689 msgout_cloned->rcpt_list = rcpt_list_allowed;