[Mailman-Developers] news to mail gatewaying problem...
Harald Meland
Harald.Meland@usit.uio.no
18 Aug 1999 12:19:01 +0200
[Jim Tittsler]
> On Wed, Aug 11, 1999 at 06:41:05PM -0400, Ronald A. Jarrell wrote:
> > Apparently python's nntplib hasn't been updated in a LONG time; every
> > other major library out there knows to issue a "mode reader" before
> > trying to do anything as a reader on an inn server. It doesn't hurt if
>
> I proposed such a patch in comp.lang.python last year, but Guido
> rejected it for fear it might break something else. He suggested
> instead calling the constructor (with no user argument), and then
> using separate commands for mode reader and authinfo.
Which would imply that programs using the library would have to call
the "shortcmd" NNTP method, which is described as "internal":
# Internal: send a command and get the response
def shortcmd(self, line):
I can't say that I'd feel very comfortable doing this, as I suspect
any library-internal methods capable of changing their name and/or
contract when I'm not looking.
> I think you should also be able to add the shortcmd('mode reader')
> to GatewayManager.py and stay with the standard Python library if
> you don't have other nntplib uses on your machine.
Experimental patch that I've now been running for several minutes at
my site:
Index: GatewayManager.py
===================================================================
RCS file: /export/public/cvsroot/mailman/Mailman/GatewayManager.py,v
retrieving revision 1.16
diff -u -r1.16 GatewayManager.py
--- GatewayManager.py 1999/07/01 18:37:31 1.16
+++ GatewayManager.py 1999/08/18 10:14:24
@@ -64,6 +64,11 @@
# - that the watermark is non-zero
def PollNewsGroup(self, conn, wm, first, last):
import nntplib
+ # Tell the news server that we want to _read_ articles now
+ try:
+ conn.shortcmd('mode reader')
+ except:
+ pass
# NEWNEWS is not portable and has synchronization issues... Use a
# watermark system instead.
for num in range(max(wm+1, first), last+1):
However, our news server appears to work fine without the "mode
reader" magic, so it'd be nice if the patch could be verified by
someone who actually need this...
--
Harald