comparison src/dnsbl.cpp @ 156:a220bfb9211f

add auto whitelisting
author carl
date Sun, 08 Jul 2007 09:46:55 -0700
parents 89ce226e5383
children ea7c57a4a2d1
comparison
equal deleted inserted replaced
155:a76a6af7ed8b 156:a220bfb9211f
960 CONTEXT &con2 = *(dc.find_context(priv.mailaddr)->find_context(loto)); 960 CONTEXT &con2 = *(dc.find_context(priv.mailaddr)->find_context(loto));
961 char *replyvalue = con2.find_from(loto); 961 char *replyvalue = con2.find_from(loto);
962 if (debug_syslog > 1) { 962 if (debug_syslog > 1) {
963 char buf[maxlen]; 963 char buf[maxlen];
964 char msg[maxlen]; 964 char msg[maxlen];
965 snprintf(msg, sizeof(msg), "from <%s> to <%s> using context %s out %s reply %s", priv.mailaddr, loto, con.get_full_name(buf,maxlen), fromvalue, replyvalue); 965 snprintf(msg, sizeof(msg), "from <%s> to <%s> using context %s state %s reply state %s", priv.mailaddr, loto, con.get_full_name(buf,maxlen), fromvalue, replyvalue);
966 my_syslog(&priv, msg); 966 my_syslog(&priv, msg);
967 } 967 }
968 free(loto); 968 free(loto);
969 status st; 969 status st;
970 if (replyvalue == token_black) { 970 if (replyvalue == token_black) {
1024 // we will accept the recipient, but add an auto-whitelist entry 1024 // we will accept the recipient, but add an auto-whitelist entry
1025 // if needed to ensure we can accept replies 1025 // if needed to ensure we can accept replies
1026 WHITELISTERP w = con2.find_autowhite(priv.mailaddr); 1026 WHITELISTERP w = con2.find_autowhite(priv.mailaddr);
1027 if (w) { 1027 if (w) {
1028 char *loto = to_lower_string(rcptaddr); 1028 char *loto = to_lower_string(rcptaddr);
1029 if (debug_syslog > 1) {
1030 char buf[maxlen];
1031 char msg[maxlen];
1032 snprintf(msg, sizeof(msg), "whitelist reply from <%s> in context %s", loto, con.get_full_name(buf,maxlen));
1033 my_syslog(&priv, msg);
1034 }
1029 w->sent(loto); // don't free it, the whitelister takes ownership of the string 1035 w->sent(loto); // don't free it, the whitelister takes ownership of the string
1030 } 1036 }
1031 // accept the recipient 1037 // accept the recipient
1032 if (!con.get_content_filtering()) st = white; 1038 if (!con.get_content_filtering()) st = white;
1033 if (st == oksofar) { 1039 if (st == oksofar) {