# HG changeset patch # User Carl Byington # Date 1487608728 28800 # Node ID e42923f8f3fd580964091072f7e3304801befd94 # Parent 5c3a3ddc15262160fc3a30fcd3e35cdd6f1b596e better message for dkim signers listed on surbl diff -r 5c3a3ddc1526 -r e42923f8f3fd src/dnsbl.cpp --- a/src/dnsbl.cpp Sat Feb 18 15:15:11 2017 -0800 +++ b/src/dnsbl.cpp Mon Feb 20 08:38:48 2017 -0800 @@ -1635,7 +1635,6 @@ char buf[maxlen]; string msg; string_set unknowns; - string_set whites; bool random = false; int limit = 0; const char *signer = NULL; @@ -1669,9 +1668,9 @@ signer = priv.check_uribl_signers(); checked_signers = true; if (signer) { - snprintf(buf, sizeof(buf), "dkim signer %s on uribl", signer); + snprintf(buf, sizeof(buf), "dkim signer %s listed on %s", signer, priv.uribl_suffix); my_syslog(&priv, buf); - snprintf(buf, sizeof(buf), "Mail rejected - dkim signed by %s", signer); + snprintf(buf, sizeof(buf), "Mail rejected - dkim signed by %s listed on %s", signer, priv.uribl_suffix); msg = string(buf); } } @@ -1687,11 +1686,11 @@ } } else if (st == token_white) { - whites.insert(rcpt); + priv.have_whites = true; } } - bool rejecting = unknowns.empty() && whites.empty(); - if (!unknowns.empty()) { + bool rejecting_unknowns = unknowns.empty(); + if (!rejecting_unknowns) { // check hosts for those recipients const char *fmt; const char *found; @@ -1708,18 +1707,18 @@ snprintf(buf, sizeof(buf), fmt, host, adr); } msg = string(buf); - rejecting = true; + rejecting_unknowns = true; } } - if (!rejecting) { - // only greylist if we don't have any whitelisted recipients - if (priv.want_dccgrey && grey && !priv.have_whites && whites.empty()) { + if (!rejecting_unknowns) { + // greylist the unknowns if we don't have any whitelisted recipients + if (priv.want_dccgrey && grey && !priv.have_whites) { smfi_setreply(ctx, (char*)"452", (char*)"4.2.1", (char*)"temporary greylist embargoed"); rc = SMFIS_TEMPFAIL; } else rc = SMFIS_CONTINUE; } - else if (!priv.have_whites && whites.empty()) { + else if (!priv.have_whites) { // can reject the entire message snprintf(buf, sizeof(buf), "%s", msg.c_str()); smfi_setreply(ctx, (char*)"550", (char*)"5.7.1", buf);