Mercurial > dnsbl
diff src/context.cpp @ 144:31ff00ea6bfb stable-5-24
allow parent/child to share a fully qualified env_to address
author | carl |
---|---|
date | Sun, 15 Oct 2006 12:23:17 -0700 |
parents | ecb40aa3eaa5 |
children | 9b9bab1d3c21 |
line wrap: on
line diff
--- a/src/context.cpp Tue Oct 10 19:12:16 2006 -0700 +++ b/src/context.cpp Sun Oct 15 12:23:17 2006 -0700 @@ -464,11 +464,11 @@ void CONFIG::dump() { - if (default_context) default_context->dump(); + if (default_context) default_context->dump(true); for (context_list::iterator i=contexts.begin(); i!=contexts.end(); i++) { CONTEXTP c = *i; CONTEXTP p = c->get_parent(); - if (!p && (c != default_context)) c->dump(); + if (!p && (c != default_context)) c->dump(false); } char buf[maxlen]; for (context_map::iterator i=env_to.begin(); i!=env_to.end(); i++) { @@ -530,7 +530,11 @@ if (*x == '\0') return true; // always allow covering addresses with no domain name, eg abuse@ if (!parent && env_to.empty()) return true; // empty env_to at global level covers everything string_set::iterator i = env_to.find(x); - if (i != env_to.end()) return true; + if (i != env_to.end()) return true; // we cover the entire domain + if (x != to) { + i = env_to.find(to); + if (i != env_to.end()) return true; // we cover the specific email address + } return false; } @@ -686,7 +690,7 @@ } -void CONTEXT::dump(int level) { +void CONTEXT::dump(bool isdefault, int level) { char indent[maxlen]; int i = min(maxlen-1, level*4); memset(indent, ' ', i); @@ -782,7 +786,7 @@ for (context_map::iterator i=children.begin(); i!=children.end(); i++) { CONTEXTP c = (*i).second; - c->dump(level+1); + c->dump(false, level+1); } printf("%s env_from %s { \t// %s\n", indent, env_from_default, fullname); @@ -804,6 +808,7 @@ } printf("%s }; \n", indent); + if (isdefault) { printf("%s rate_limit %d { \n", indent, default_rcpt_rate); for (rcpt_rates::iterator j=rcpt_per_hour.begin(); j!=rcpt_per_hour.end(); j++) { char *u = (*j).first; @@ -811,6 +816,7 @@ printf("%s \"%s\" \t%d; \n", indent, u, l); } printf("%s }; \n", indent); + } printf("%s }; \n", indent); }