Mercurial > dnsbl
diff src/context.cpp @ 211:4db1457cd11a stable-6-0-18
Extend auto-whitelisting when receiving mail even if the auto whitelist is specified in a parent context.
Fixes for Solaris from sm-archive.
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Sat, 22 Mar 2008 11:19:36 -0700 |
parents | 92a5c866bdfa |
children | 82886d4dd71f |
line wrap: on
line diff
--- a/src/context.cpp Wed Mar 05 18:24:36 2008 -0800 +++ b/src/context.cpp Sat Mar 22 11:19:36 2008 -0700 @@ -19,8 +19,6 @@ #include <sys/un.h> #include <unistd.h> -static char* context_version="$Id$"; - char *token_autowhite; char *token_black; char *token_cctld; @@ -808,7 +806,13 @@ char *CONTEXT::find_from(char *from, bool update_white) { - if (whitelister && whitelister->is_white(from)) { + WHITELISTERP w = whitelister; + CONTEXTP p = parent; + while (!w && p) { + w = p->whitelister; + p = p->parent; + } + if (w && w->is_white(from)) { if (update_white) { // update senders timestamp to extend the whitelisting period if (debug_syslog > 1) { @@ -817,7 +821,7 @@ snprintf(msg, sizeof(msg), "extend whitelist reply from <%s> in context %s", from, get_full_name(buf,maxlen)); my_syslog(msg); } - whitelister->sent(strdup(from)); + w->sent(strdup(from)); } return token_white; }