[Mailman-Developers] Bug#57223: mailman: gate_news problems (fwd)

Thomas Wouters thomas@xs4all.net
Mon, 7 Feb 2000 17:19:59 +0100


--bg08WKrSYDhXBjb5
Content-Type: text/plain; charset=us-ascii

On Mon, Feb 07, 2000 at 04:57:37PM +0100, Gergely Madarasz wrote:
> On Mon, 7 Feb 2000, Thomas Wouters wrote:

> > send a patch to the python-patches list. In the mean time you can apply the
> > patch mentioned in that posting, to your own copy of nntplib, as long as you
> > dont use nntplib in server mode anywhere (Not very likely, that last part)

> That is for the reporter of the problem... But I need to make a fix in the
> mailman .deb package for debian potato before potato is released... :)

Ok, well, because the reader attempting the 'group' command, in
cron/gate_news, isn't using authorization, we can just send the 'mode
reader' command when we get the error 500. The attached patch should work, I
think. It fixes the first call to 'group' instead of the constructor of
nntplib.NNTP, so it should be usable with all nntplib version.

-- 
Thomas Wouters <thomas@xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!

--bg08WKrSYDhXBjb5
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="mailman.cvs.diff"

Index: cron/gate_news
===================================================================
RCS file: /projects/cvsroot/mailman/cron/gate_news,v
retrieving revision 1.22
diff -u -r1.22 gate_news
--- gate_news	1999/12/25 14:35:31	1.22
+++ gate_news	2000/02/07 16:12:40
@@ -125,7 +125,15 @@
             sys.stderr.write('connect to nntp_host failed\n')
             sys.stderr.write(`e`)
             break
-        r,c,f,l,n = conn.group(mlist.linked_newsgroup)
+
+        try:
+            r,c,f,l,n = conn.group(mlist.linked_newsgroup)
+        except nntplib.error_perm:
+            # We got an error 500. This could mean 'group' is not implemented,
+            # and that we need to set the connection to reader mode first.
+            conn.shortcmd('mode reader')
+            r,c,f,l,n = conn.group(mlist.linked_newsgroup)
+
         if not updatewatermarks:
             # just post the specified messages and be done with it
             poll_newsgroup(mlist, conn, first, last+1)

--bg08WKrSYDhXBjb5--