[Mailman-Developers] news to mail gatewaying problem...

Jim Tittsler jwt@dskk.co.jp
Tue, 17 Aug 1999 11:11:27 +0900


On Wed, Aug 11, 1999 at 06:41:05PM -0400, Ronald A. Jarrell wrote:
> The news to mail gateway stuff won't (can't in fact) work when mailman
> and the news server are the same machine (or if mailman is running on a
> machine with transfer privs to the news server), and the news server is
> INN.
> 
> 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.  I use nntplib for several tasks on news server
machines so I found it cleaner to just add:

diff -u nntplib.py.dist nntplib.py
--- nntplib.py.dist     Tue Apr 28 17:43:35 1998
+++ nntplib.py  Tue Jun 23 22:06:00 1998  
@@ -71,6 +71,10 @@
                self.file = self.sock.makefile('rb')
                self.debugging = 0
                self.welcome = self.getresp()
+               try:
+                   self.welcome = self.shortcmd('mode reader')
+               except:
+                   pass
                if user:
                    resp = self.shortcmd('authinfo user '+user)
                    if resp[:3] == '381':

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.

-- 
Jim Tittsler, Tokyo
http://starship.python.net/crew/jwt/