Mercurial > dnsbl
comparison 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 |
comparison
equal
deleted
inserted
replaced
472:86a61ed64baf | 473:5209e92b4885 |
---|---|
1489 } | 1489 } |
1490 | 1490 |
1491 if (ver) { | 1491 if (ver) { |
1492 // try to verify the original from/to pair of addresses even if it might be explicitly whitelisted | 1492 // try to verify the original from/to pair of addresses even if it might be explicitly whitelisted |
1493 const char *loto = to_lower_string(rcptaddr, false); | 1493 const char *loto = to_lower_string(rcptaddr, false); |
1494 bool rc = ver->ok(priv.queueid, priv.origaddr, loto); | 1494 int rc = ver->ok(priv.queueid, priv.origaddr, loto); |
1495 free((void*)loto); | 1495 free((void*)loto); |
1496 if (!rc) { | 1496 if (rc >= 500) { |
1497 smfi_setreply(ctx, (char*)"550", (char*)"5.7.1", (char*)"no such user"); | 1497 smfi_setreply(ctx, (char*)"550", (char*)"5.7.1", (char*)"no such user"); |
1498 return SMFIS_REJECT; | |
1499 } | |
1500 if (rc >= 400) { | |
1501 smfi_setreply(ctx, (char*)"452", (char*)"4.2.1", (char*)"temporary greylist embargoed"); | |
1498 return SMFIS_REJECT; | 1502 return SMFIS_REJECT; |
1499 } | 1503 } |
1500 } | 1504 } |
1501 | 1505 |
1502 if (!priv.authenticated && dc.default_context->is_unauthenticated_limited(priv.mailaddr)) { | 1506 if (!priv.authenticated && dc.default_context->is_unauthenticated_limited(priv.mailaddr)) { |
2057 printf("cannot compile regex pattern to find prvs coding in mail addresses\n"); | 2061 printf("cannot compile regex pattern to find prvs coding in mail addresses\n"); |
2058 exit(3); | 2062 exit(3); |
2059 } | 2063 } |
2060 | 2064 |
2061 // setup dkim results signature detection | 2065 // setup dkim results signature detection |
2062 if (regcomp(&dkim_r_pattern, "\\sdkim=pass\\s*.[0-9]*-bit key.\\s*header.d=([^ ]+)\\s", REG_ICASE | REG_EXTENDED)) { | 2066 if (regcomp(&dkim_r_pattern, "\\sdkim=pass\\s*.[0-9]*-bit key.*\\s*header.d=([^ ]+)\\s", REG_ICASE | REG_EXTENDED)) { |
2063 printf("cannot compile regex pattern to find dkim results signatures\n"); | 2067 printf("cannot compile regex pattern to find dkim results signatures\n"); |
2064 exit(3); | 2068 exit(3); |
2065 } | 2069 } |
2066 | 2070 |
2067 // setup dkim results signature detection | 2071 // setup dkim results signature detection |