changeset 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 86a61ed64baf
children 82c85169a738
files ChangeLog NEWS configure.in dnsbl.spec.in src/context.cpp src/context.h src/dccifd.cpp src/dccifd.h src/dnsbl.cpp src/dnsbl.h src/includes.h src/scanner.cpp src/scanner.h src/spamass.cpp.in src/spamass.h src/test.cpp src/tokenizer.cpp src/tokenizer.h
diffstat 18 files changed, 35 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Dec 16 13:40:59 2020 -0800
+++ b/ChangeLog	Sat Feb 20 09:46:29 2021 -0800
@@ -1,3 +1,7 @@
+6.78 2021-02-20
+    Opendkim headers have changed on centos 8. Pass smtp
+    verify temp fail 4xy codes back to the sending system.
+
 6.77 2020-12-16
     allow checking names without A records on uribl lists.
     improve extraction of fake TLDs from our RPZ zone so
--- a/NEWS	Wed Dec 16 13:40:59 2020 -0800
+++ b/NEWS	Sat Feb 20 09:46:29 2021 -0800
@@ -1,3 +1,4 @@
+6.78 2021-02-20 opendkim headers changed, pass smtp verify 4xy codes back to sender
 6.77 2020-12-16 allow checking names without A records on uribl lists.
 6.76 2019-04-25 SA needs original rfc5321 envelope from to do proper spf checking.
 6.75 2019-03-10 change dkim_from syntax to allow "signer1,signer2;spf data"
--- a/configure.in	Wed Dec 16 13:40:59 2020 -0800
+++ b/configure.in	Sat Feb 20 09:46:29 2021 -0800
@@ -1,6 +1,6 @@
 
 AC_PREREQ(2.59)
-AC_INIT(dnsbl,6.77,carl@five-ten-sg.com)
+AC_INIT(dnsbl,6.78,carl@five-ten-sg.com)
 AC_CONFIG_SRCDIR([config.h.in])
 AC_CONFIG_HEADER([config.h])
 AC_CONFIG_MACRO_DIR([m4])
--- a/dnsbl.spec.in	Wed Dec 16 13:40:59 2020 -0800
+++ b/dnsbl.spec.in	Sat Feb 20 09:46:29 2021 -0800
@@ -151,7 +151,11 @@
 
 
 %changelog
-* Tue Dec 16 2020 Carl Byington <carl@five-ten-sg.com> - 6.77-1
+* Sat Feb 20 2021 Carl Byington <carl@five-ten-sg.com> - 6.78-1
+- Opendkim headers have changed on centos 8. Pass smtp
+  verify temp fail 4xy codes back to the sending system.
+
+* Wed Dec 16 2020 Carl Byington <carl@five-ten-sg.com> - 6.77-1
 - allow checking names without A records on uribl lists.
 - improve extraction of fake TLDs from our RPZ zone so
   that names under those TLDs may be added to uribl lists
@@ -397,7 +401,7 @@
 * Sun Dec 18 2005 Carl Byington <carl@five-ten-sg.com> - 5.11
 - use autoconf and http://www.fedora.us/docs/rpm-packaging-guidelines.html
 
-* Tue Jan 03 2005 Carl Byington <carl@five-ten-sg.com> - 4.0
+* Mon Jan 03 2005 Carl Byington <carl@five-ten-sg.com> - 4.0
 - added hosts-ignore conf file
 - see RELEASE_NOTES
 
--- a/src/context.cpp	Wed Dec 16 13:40:59 2020 -0800
+++ b/src/context.cpp	Sat Feb 20 09:46:29 2021 -0800
@@ -401,7 +401,7 @@
 }
 
 
-bool VERIFY::ok(const char *queueid, const char *from, const char *to) {
+int VERIFY::ok(const char *queueid, const char *from, const char *to) {
     if (host == token_myhostname) return true;
     SMTP *conn = get_connection(queueid);
     if (!conn) {
@@ -413,12 +413,12 @@
     conn->log("verify::ok(%d) from sees %d", rc);
     if (rc != 250) {
         put_connection(conn);
-        return (rc >= 500) ? false : true;
+        return rc;
     }
     rc = conn->rcpt(to);
     conn->log("verify::ok(%d) rcpt sees %d", rc);
     put_connection(conn);
-    return (rc >= 500) ? false : true;
+    return rc;
 }
 
 
--- a/src/context.h	Wed Dec 16 13:40:59 2020 -0800
+++ b/src/context.h	Sat Feb 20 09:46:29 2021 -0800
@@ -1,6 +1,6 @@
 /*
 
-Copyright (c) 2007 Carl Byington - 510 Software Group, released under
+Copyright (c) 2007, 2021 Carl Byington - 510 Software Group, released under
 the GPL version 3 or any later version at your choice available at
 http://www.gnu.org/licenses/gpl-3.0.txt
 
@@ -108,7 +108,7 @@
     void    closer();           // if the oldest socket is ancient, close it
     SMTP    *get_connection(const char *queueid);
     void    put_connection(SMTP *conn);
-    bool    ok(const char *queueid, const char *from, const char *to);
+    int     ok(const char *queueid, const char *from, const char *to);
 };
 
 class WHITELISTER {
--- a/src/dccifd.cpp	Wed Dec 16 13:40:59 2020 -0800
+++ b/src/dccifd.cpp	Sat Feb 20 09:46:29 2021 -0800
@@ -1,6 +1,6 @@
 /*
 
-Copyright (c) 2007 Carl Byington - 510 Software Group, released under
+Copyright (c) 2007, 2021 Carl Byington - 510 Software Group, released under
 the GPL version 3 or any later version at your choice available at
 http://www.gnu.org/licenses/gpl-3.0.txt
 
--- a/src/dccifd.h	Wed Dec 16 13:40:59 2020 -0800
+++ b/src/dccifd.h	Sat Feb 20 09:46:29 2021 -0800
@@ -1,6 +1,6 @@
 /*
 
-Copyright (c) 2007 Carl Byington - 510 Software Group, released under
+Copyright (c) 2007, 2021 Carl Byington - 510 Software Group, released under
 the GPL version 3 or any later version at your choice available at
 http://www.gnu.org/licenses/gpl-3.0.txt
 
--- 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);
     }
--- a/src/dnsbl.h	Wed Dec 16 13:40:59 2020 -0800
+++ b/src/dnsbl.h	Sat Feb 20 09:46:29 2021 -0800
@@ -1,6 +1,6 @@
 /*
 
-Copyright (c) 2007 Carl Byington - 510 Software Group, released under
+Copyright (c) 2007, 2021 Carl Byington - 510 Software Group, released under
 the GPL version 3 or any later version at your choice available at
 http://www.gnu.org/licenses/gpl-3.0.txt
 
--- a/src/includes.h	Wed Dec 16 13:40:59 2020 -0800
+++ b/src/includes.h	Sat Feb 20 09:46:29 2021 -0800
@@ -1,6 +1,6 @@
 /*
 
-Copyright (c) 2007 Carl Byington - 510 Software Group, released under
+Copyright (c) 2007, 2021 Carl Byington - 510 Software Group, released under
 the GPL version 3 or any later version at your choice available at
 http://www.gnu.org/licenses/gpl-3.0.txt
 
--- a/src/scanner.cpp	Wed Dec 16 13:40:59 2020 -0800
+++ b/src/scanner.cpp	Sat Feb 20 09:46:29 2021 -0800
@@ -1,6 +1,6 @@
 /*
 
-Copyright (c) 2007 Carl Byington - 510 Software Group, released under
+Copyright (c) 2007, 2021 Carl Byington - 510 Software Group, released under
 the GPL version 3 or any later version at your choice available at
 http://www.gnu.org/licenses/gpl-3.0.txt
 
--- a/src/scanner.h	Wed Dec 16 13:40:59 2020 -0800
+++ b/src/scanner.h	Sat Feb 20 09:46:29 2021 -0800
@@ -1,6 +1,6 @@
 /*
 
-Copyright (c) 2007 Carl Byington - 510 Software Group, released under
+Copyright (c) 2007, 2021 Carl Byington - 510 Software Group, released under
 the GPL version 3 or any later version at your choice available at
 http://www.gnu.org/licenses/gpl-3.0.txt
 
--- a/src/spamass.cpp.in	Wed Dec 16 13:40:59 2020 -0800
+++ b/src/spamass.cpp.in	Sat Feb 20 09:46:29 2021 -0800
@@ -1,6 +1,6 @@
 /*
 
-Copyright (c) 2007 Carl Byington - 510 Software Group, released under
+Copyright (c) 2007, 2021 Carl Byington - 510 Software Group, released under
 the GPL version 3 or any later version at your choice available at
 http://www.gnu.org/licenses/gpl-3.0.txt
 
--- a/src/spamass.h	Wed Dec 16 13:40:59 2020 -0800
+++ b/src/spamass.h	Sat Feb 20 09:46:29 2021 -0800
@@ -1,6 +1,6 @@
 /*
 
-Copyright (c) 2007 Carl Byington - 510 Software Group, released under
+Copyright (c) 2007, 2021 Carl Byington - 510 Software Group, released under
 the GPL version 3 or any later version at your choice available at
 http://www.gnu.org/licenses/gpl-3.0.txt
 
--- a/src/test.cpp	Wed Dec 16 13:40:59 2020 -0800
+++ b/src/test.cpp	Sat Feb 20 09:46:29 2021 -0800
@@ -1,6 +1,6 @@
 /*
 
-Copyright (c) 2007 Carl Byington - 510 Software Group, released under
+Copyright (c) 2007, 2021 Carl Byington - 510 Software Group, released under
 the GPL version 3 or any later version at your choice available at
 http://www.gnu.org/licenses/gpl-3.0.txt
 
--- a/src/tokenizer.cpp	Wed Dec 16 13:40:59 2020 -0800
+++ b/src/tokenizer.cpp	Sat Feb 20 09:46:29 2021 -0800
@@ -1,6 +1,6 @@
 /*
 
-Copyright (c) 2007 Carl Byington - 510 Software Group, released under
+Copyright (c) 2007, 2021 Carl Byington - 510 Software Group, released under
 the GPL version 3 or any later version at your choice available at
 http://www.gnu.org/licenses/gpl-3.0.txt
 
--- a/src/tokenizer.h	Wed Dec 16 13:40:59 2020 -0800
+++ b/src/tokenizer.h	Sat Feb 20 09:46:29 2021 -0800
@@ -1,6 +1,6 @@
 /*
 
-Copyright (c) 2007 Carl Byington - 510 Software Group, released under
+Copyright (c) 2007, 2021 Carl Byington - 510 Software Group, released under
 the GPL version 3 or any later version at your choice available at
 http://www.gnu.org/licenses/gpl-3.0.txt