# HG changeset patch # User Carl Byington # Date 1482514510 28800 # Node ID 66969443a012562d1322c67e875206ce23e9015c # Parent 9f328a0a17198548ae29f16050b0afe1dcd6d823 need to strip <> from recipient address before sending to verifier diff -r 9f328a0a1719 -r 66969443a012 src/dnsbl.cpp --- a/src/dnsbl.cpp Fri Dec 23 08:20:53 2016 -0800 +++ b/src/dnsbl.cpp Fri Dec 23 09:35:10 2016 -0800 @@ -1101,8 +1101,8 @@ // to lower case. Some clients enclose the entire address in single quotes, // so we strip those as well. We also remove the SRS and prvs coding. // -const char *to_lower_string(const char *email); -const char *to_lower_string(const char *email) { +const char *to_lower_string(const char *email, bool srs = true); +const char *to_lower_string(const char *email, bool srs) { if (!email) return strdup("<>"); size_t n = strlen(email); if ((n > 1) && (email[0] == '<') && (email[n-1] == '>')) { @@ -1117,6 +1117,8 @@ char *key = strdup(email); key[n] = '\0'; for (size_t i=0; i 14) && (strncmp(key, "srs", 3) == 0)) { // might have srs coding to be removed const int nmatch = 7; @@ -1151,6 +1153,7 @@ } } } + } return key; } @@ -1365,7 +1368,9 @@ if (ver) { // try to verify this 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.mailaddr, rcptaddr); + free((void*)loto); if (!rc) { smfi_setreply(ctx, (char*)"550", (char*)"5.7.1", (char*)"no such user"); return SMFIS_REJECT;