Mercurial > dnsbl
changeset 379:e42923f8f3fd stable-6-0-50
better message for dkim signers listed on surbl
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Mon, 20 Feb 2017 08:38:48 -0800 |
parents | 5c3a3ddc1526 |
children | 0495e767bfb7 |
files | src/dnsbl.cpp |
diffstat | 1 files changed, 10 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- 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);