# HG changeset patch # User Carl Byington # Date 1489457399 25200 # Node ID 9096d2676c13fc7fec49955dc79fbf3534970b11 # Parent 775174f15b61f26b467aa62e0655d394cb50240f suppress duplicate calls to acceptable_content for messages with multiple recipients using the same filtering context diff -r 775174f15b61 -r 9096d2676c13 src/dnsbl.cpp --- a/src/dnsbl.cpp Thu Mar 09 08:59:32 2017 -0800 +++ b/src/dnsbl.cpp Mon Mar 13 19:09:59 2017 -0700 @@ -1696,10 +1696,15 @@ } } + CONTEXT *con = NULL; + const char *st; for (context_map::iterator i=priv.env_to.begin(); i!=priv.env_to.end(); i++) { const char *rcpt = (*i).first; - CONTEXT &con = *((*i).second); - const char *st = con.acceptable_content(*priv.memory, score, bulk, priv.queueid, priv.dkim_signers, priv.fromaddr, &priv, msg); + CONTEXT *next = (*i).second; + if (con != next) { + con = next; + st = con->acceptable_content(*priv.memory, score, bulk, priv.queueid, priv.dkim_signers, priv.fromaddr, &priv, msg); + } if (st == token_black) { // bad html tags or excessive hosts or // high spam assassin score or dcc bulk threshold exceedeed @@ -1725,8 +1730,8 @@ else { // still unknown unknowns.insert(rcpt); - random |= con.get_host_random(); - limit = max(limit, con.get_host_limit()); + random |= con->get_host_random(); + limit = max(limit, con->get_host_limit()); } } else if (st == token_white) {