Your message dated Thu, 22 Oct 2020 22:33:55 +0000
with message-id <e1kvj9f-000aag...@fasolo.debian.org>
and subject line Bug#948706: fixed in greylistd 0.9.0
has caused the Debian Bug report #948706,
regarding greylistd: python3 version fails to start - conversion from python2 
very broken
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
948706: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=948706
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: greylistd
Version: 0.8.8.8
Severity: grave

The conversion to Python 3.x between versions 0.8.8.7 and 0.8.8.8 is
deeply broken.  There are many Python 2.x-only pieces of code still in
the two scripts, and the daemon fails to even start.  I have done some
work to improve the situation, but it is still far from working
properly, and unfortunately I do not have any more time right now to
help fix it further.  I attach my current patches, which at least
allow the program to start without crashing, but it does not work
properly: "greylist list" reports "(No response from greylistd)", and
this then crashes greylistd - the socket is deleted.

Best wishes,

   Julian
--- /usr/bin/greylist.orig      2019-12-20 18:25:21.000000000 +0000
+++ /usr/bin/greylist   2020-01-12 11:50:31.148328897 +0000
@@ -25,10 +25,6 @@
 from configparser import ConfigParser
 
 
-### Define values not yet availble in Python 2.1
-False, True = (0 is 1), (1 is 1)
-
-
 ### Exit codes based on responses from greylistd
 exitcodes = { "error:" : -1,
               "white"  : 0,
@@ -128,36 +124,36 @@
 
 try:
     sock.connect(sockfile)
-except Exception as e:
-    stderr.write("%s: %s\n"%(sockfile, e[1]))
-    exit(-1)
+except:
+    stderr.write("sock.connect(%s) failed\n"%sockfile)
+    raise
 
 try:
-    sock.send(" ".join(argv[1:]))
-except Exception as e:
-    stderr.write("%s: %s\n"%(sockfile, e[1]))
-    exit(-1)
-
+    sock.send((" ".join(argv[1:])).encode())
+except:
+    stderr.write("sock.send (socket=%s) failed\n"%sockfile)
+    raise
 
 stat      = True
 firstword = None
 
 while stat:
     stat = sock.recv(1024)
+    stats = stat.decode()
     try:
-        stdout.write("%s"%stat)
+        stdout.write("%s"%stats)
 
-    except IOError:
+    except OSError:
         break
     
     else:
-        if not firstword and stat.strip():
-            firstword = stat.split(None, 1)[0]
+        if not firstword and stats.strip():
+            firstword = stats.split(None, 1)[0]
 
 else:
     try:
         stdout.write("\n")
-    except IOError:
+    except OSError:
         pass
 
 
--- /usr/sbin/greylistd.orig    2019-12-20 18:25:24.000000000 +0000
+++ /usr/sbin/greylistd 2020-01-12 11:54:47.287105887 +0000
@@ -30,7 +30,7 @@
 ########################################################################
 
 from time         import time, ctime, localtime, strftime
-from socket       import socket, AF_UNIX, SOCK_STREAM, error as SocketError, 
gethostname
+from socket       import socket, AF_UNIX, SOCK_STREAM, gethostname
 from os           import remove, rename, chmod, chown, getuid, getpid, isatty
 from pwd          import getpwnam
 from grp          import getgrnam
@@ -119,9 +119,14 @@
     for (listKey, timeoutKey) in ((GREY,  RETRYMAX),
                                   (WHITE, EXPIRE),
                                   (BLACK, EXPIRE)):
-        for (dataKey, dataValue) in data[listKey].items():
-            if dataValue[IDX_LAST] + config[TIMEOUTS][timeoutKey] < now:
-                del data[listKey][dataKey]
+        deleted = True
+        while deleted:
+            deleted = False
+            for (dataKey, dataValue) in data[listKey].items():
+                if dataValue[IDX_LAST] + config[TIMEOUTS][timeoutKey] < now:
+                    del data[listKey][dataKey]
+                    deleted = True
+                    break
 
 
 def listStatus (searchkey):
@@ -210,7 +215,7 @@
 
 def loadFromFile (datafile, dictionary, typelist=None):
     try:
-        fp      = file(datafile)
+        fp      = open(datafile)
         section = None
 
         logPfx  = 'In %s:'%datafile
@@ -260,14 +265,14 @@
 
         fp.close()
 
-    except IOError as e:
+    except OSError as e:
         raise RunException("Cannot read from '%s': %s"%(datafile, e[1]))
 
 
 
-def saveToFile (datafile, dictionary, perm=0600):
+def saveToFile (datafile, dictionary, perm=0o600):
     try:
-        fp = file(datafile, 'w')
+        fp = open(datafile, 'w')
 
         chmod(datafile, perm)
         
@@ -283,7 +288,7 @@
 
         fp.close()
 
-    except IOError as e:
+    except OSError as e:
         raise RunException("Cannot write to %s: %s"%(datafile, e[1]))
 
     except OSError as e:
@@ -323,17 +328,17 @@
 
 
 
-def syncTriplets (datafile, perm=0600):
+def syncTriplets (datafile, perm=0o600):
     source = datafile
     target = "%s.%s"%(source, getpid())
 
     try:
-        infile  = file(source, "r")
-    except IOError:
+        infile  = open(source, "r")
+    except OSError:
         infile  = None
 
     try:
-        outfile = file(target, "w")
+        outfile = open(target, "w")
 
         chmod(target, perm)
 
@@ -356,7 +361,7 @@
         newTriplets.clear()
         outfile.close()
 
-    except IOError as e:
+    except OSError as e:
         raise RunException("Could not write to %s: %s"%(target, e[1]))
 
     except OSError as e:
@@ -589,11 +594,11 @@
     do_save()
 
     try:
-        infile = file(config[DATA][TRIPLETFILE], "r")
+        infile = open(config[DATA][TRIPLETFILE], "r")
         error = listTriplets(infile, socket, options)
         infile.close()
 
-    except IOError as e:
+    except OSError as e:
         raise CommandError("Cannot read from '%s': 
%s\n"%(config[DATA][TRIPLETFILE], e[1]))
     
 
@@ -639,8 +644,9 @@
 
 
 def runCommand (line, client):
+    lines   = line.decode()
     now     = int(time())
-    words   = line.lower().split()
+    words   = lines.lower().split()
     options = []
 
     if not words:
@@ -750,8 +756,8 @@
     try:
         listener = createSocket(**config[SOCKET])
 
-    except SocketError as e:
-        log("Could not bind/listen to socket %s: 
%s"%(config[SOCKET][SOCKPATH], str(e)))
+    except OSError as e:
+        log("Could not bind/listen to socket %s: 
%s"%(config[SOCKET][SOCKPATH], e[1]))
         exit(-1)
 
     except RunException as e:
@@ -811,9 +817,9 @@
             try:
                 line = client.recv(16384)
                 reply = runCommand(line, client)
-                client.send(reply)
+                client.send(reply.encode())
 
-            except SocketError as e:
+            except OSError as e:
                 log("Socket error: %s"%e[1])
 
             client.close()

--- End Message ---
--- Begin Message ---
Source: greylistd
Source-Version: 0.9.0
Done: Julian Gilbey <j...@debian.org>

We believe that the bug you reported is fixed in the latest version of
greylistd, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 948...@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Julian Gilbey <j...@debian.org> (supplier of updated greylistd package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmas...@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Thu, 22 Oct 2020 22:57:12 +0100
Source: greylistd
Binary: greylistd
Architecture: source all
Version: 0.9.0
Distribution: unstable
Urgency: medium
Maintainer: Thorsten Alteholz <deb...@alteholz.de>
Changed-By: Julian Gilbey <j...@debian.org>
Description:
 greylistd  - Greylisting daemon for use with Exim 4
Closes: 321025 872734 948706
Changes:
 greylistd (0.9.0) unstable; urgency=medium
 .
   * With many thanks to Benedikt Spranger <b.spran...@linutronix.de>
     for work at https://github.com/eurovibes/greylistd.git to convert to
     python3 and fix PEP-8 issues (Closes: #948706)
   * Benedikt also fixed the exim configuration file remove procedure
     (Closes: #321025, #872734)
   * Fix lintian warnings about non-UTF-8 translation files
   * Provide a systemd service/socket file pair
Checksums-Sha1:
 ef1c9d1eca308a5fdc4c79093511bb7eed049265 1582 greylistd_0.9.0.dsc
 589bd19cca5213a5b9269bc3e3de7a4a0c755588 76468 greylistd_0.9.0.tar.xz
 606663529c436bba1420c709dc1499e6a9132356 53292 greylistd_0.9.0_all.deb
 43591a2afaed0f5fa38a60a87db830102fa8da18 7307 greylistd_0.9.0_amd64.buildinfo
Checksums-Sha256:
 57b8b1b71b1adf6c3461f6622a5ea60c7e97b1f99bcd4c3eb9e5000893db7191 1582 
greylistd_0.9.0.dsc
 6cbf230de3b1cb2000b25a5e000b615caeac9a1f7da234a7f7c5ffeeacb5884e 76468 
greylistd_0.9.0.tar.xz
 ba13ea1cac01c86d37a4b8e2214c7593887291cc42cdc0b1b8566f57bc06de27 53292 
greylistd_0.9.0_all.deb
 3f2bfd71b80c6bb14fce059a0ce1f8e932cb4c7a7fcd609ad094dfdd5fd25372 7307 
greylistd_0.9.0_amd64.buildinfo
Files:
 9d58fec96e5e380b4fb2bee4c0462b29 1582 mail optional greylistd_0.9.0.dsc
 1cc1c7a32c1d4771d5fe9e3b3884e6dc 76468 mail optional greylistd_0.9.0.tar.xz
 939e9622317a2afbb802d92bab04165a 53292 mail optional greylistd_0.9.0_all.deb
 c2a3f90f0a84c3d9e93fce957cdf29c2 7307 mail optional 
greylistd_0.9.0_amd64.buildinfo

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEfhrD+iemSShMMj72aVxCkxbAe/4FAl+SBHIACgkQaVxCkxbA
e/6eGw/9HBq3z0tekYt0jwwGMFs92aB84P2rdDOpe8GeVm7GfVx8gWEqol3cM+/T
By5Q3zofj2wXZhid2pxEOi4BQcAd+tK37x1qv16eFjBK3ynVkv6LeDJC/0vxGs8V
hvYpMb/mcdMgo22rCRNua88ngix7SC4NN8TlyiMeNpNqI3eDSvL0fr4xWVypXOlZ
XETb/jB3Yj1eUaiRT0l4r/OZ6G90ZxxVtbbOqe4QIZquk46z/Vug6EX9NX4XblXp
8aHj2MsVcQbgY15P4Bg5pjxrHuPhSdt2GQNLeLlvhtnRiku+8wNrSBWWp4l5Zckk
Onmo8RRGGxs9/d3C1HSoDt8DgU30NcJRBssvOvQFp1rYHxHCNNwT3NI9EdhQiqew
/LrYBLBRt99Ms+37TG7XvHolTE8vY02cI5P1gq7RT2zIb+WjfU+Vp//E7xvkKOwQ
cxWpLPWolSbt0e/5vFVRRBqSoOO2rfYDKkfLmxMb4qug5RxXeJ/9E3YmTW/tRbnr
ZorjkdOMHDvHFO9AQ+zkLMVati8LBEQwIygOGKSZt/OyaD+7xKKXfFaDkO10gWFX
j9KxsrQkNaP2U/tVk4P+Z5JqEDExKuGH0UvQYvuL/4Wx3ADzN84O1ufNTcLA3jNX
tmrwv89mzfXw0D9VzdPDjxbMzH6VYHKl4sO1yjuxcnJ8ueomkH0=
=aOnA
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to