Mercurial > dnsbl
diff src/dnsbl.cpp @ 473:5209e92b4885
opendkim headers changed, pass smtp verify 4xy codes back to sender
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Sat, 20 Feb 2021 09:46:29 -0800 |
parents | f5b394bec28c |
children | 9b4477b75065 |
line wrap: on
line diff
--- a/src/dnsbl.cpp Wed Dec 16 13:40:59 2020 -0800 +++ b/src/dnsbl.cpp Sat Feb 20 09:46:29 2021 -0800 @@ -1491,12 +1491,16 @@ if (ver) { // try to verify the original from/to pair of addresses even if it might be explicitly whitelisted const char *loto = to_lower_string(rcptaddr, false); - bool rc = ver->ok(priv.queueid, priv.origaddr, loto); + int rc = ver->ok(priv.queueid, priv.origaddr, loto); free((void*)loto); - if (!rc) { + if (rc >= 500) { smfi_setreply(ctx, (char*)"550", (char*)"5.7.1", (char*)"no such user"); return SMFIS_REJECT; } + if (rc >= 400) { + smfi_setreply(ctx, (char*)"452", (char*)"4.2.1", (char*)"temporary greylist embargoed"); + return SMFIS_REJECT; + } } if (!priv.authenticated && dc.default_context->is_unauthenticated_limited(priv.mailaddr)) { @@ -2059,7 +2063,7 @@ } // setup dkim results signature detection - if (regcomp(&dkim_r_pattern, "\\sdkim=pass\\s*.[0-9]*-bit key.\\s*header.d=([^ ]+)\\s", REG_ICASE | REG_EXTENDED)) { + if (regcomp(&dkim_r_pattern, "\\sdkim=pass\\s*.[0-9]*-bit key.*\\s*header.d=([^ ]+)\\s", REG_ICASE | REG_EXTENDED)) { printf("cannot compile regex pattern to find dkim results signatures\n"); exit(3); }