Mercurial > masqmail
changeset 373:4cab237ce923
Fixed bug in matching of allowed recipients.
Thanks to Juergen Daubert for finding and reporting the issue.
The code had evaluated completely different data ...
author | markus schnalke <meillo@marmaro.de> |
---|---|
date | Sat, 14 Jan 2012 11:47:57 +0100 (2012-01-14) |
parents | b0708fac99dd |
children | a96bb42f597d |
files | src/route.c |
diffstat | 1 files changed, 8 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/src/route.c Tue Oct 25 14:31:28 2011 +0200 +++ b/src/route.c Sat Jan 14 11:47:57 2012 +0100 @@ -204,7 +204,7 @@ GList **rl_matching, GList **rl_others) { GList *rcpt_node; - GList *host_node = NULL; + GList *pat_node = NULL; address *rcpt = NULL; if (rcpt_list == NULL) @@ -212,22 +212,23 @@ foreach(rcpt_list, rcpt_node) { rcpt = (address *) (rcpt_node->data); - host_node = NULL; + pat_node = NULL; if (addr_is_local(rcpt)) { if (rl_local) *rl_local = g_list_append(*rl_local, rcpt); } else { /* - ** if patterns is NULL, host_node will be NULL, + ** if patterns is NULL, pat_node will be NULL, ** hence all non-locals are put to others */ - foreach(patterns, host_node) { - gchar *host = (gchar *) (host_node->data); - if (fnmatch(host, rcpt->domain, FNM_CASEFOLD) == 0) + foreach(patterns, pat_node) { + address *pat = (address *) (pat_node->data); + if (fnmatch(pat->domain, rcpt->domain, FNM_CASEFOLD)==0 && fnmatch(pat->local_part, rcpt->local_part, 0)==0) { /* TODO: match local_part caseless? */ break; + } } - if (host_node) { + if (pat_node) { if (rl_matching) *rl_matching = g_list_append(*rl_matching, rcpt); } else {