Bug#57596: mailman: Here we go again... post: nntplib.error_perm : 500 "POST" not implemented; try "help". (fwd)

Another day, another bugreport :/
Lazarus, can you tell me if this is after you applied the last patch suggested by Thomas, for gate_news ?
Package: mailman Version: 1.1-2 Severity: important
Feb 09 03:47:55 2000 post: Traceback (innermost last): post: File "/var/lib/mailman/scripts/post", line 73, in ? post: mlist.Post(msg, approved=fromusenet) post: File "/usr/lib/mailman/Mailman/MailList.py", line 1331, in Post post: self.SendMailToNewsGroup(msg) post: File "/usr/lib/mailman/Mailman/GatewayManager.py", line 204, in SendMailToNewsGroup post: con.post(msg) post: File "/usr/lib/python1.5/nntplib.py", line 417, in post post: resp = self.shortcmd('POST') post: File "/usr/lib/python1.5/nntplib.py", line 158, in shortcmd post: return self.getresp() post: File "/usr/lib/python1.5/nntplib.py", line 134, in getresp post: raise error_perm, resp
You get the idea.
Gatewaying seems completely broken.

On Wed, Feb 09, 2000 at 11:36:41AM +0100, Gergely Madarasz wrote:
Another day, another bugreport :/
Sigh. I've gotten mail regarding this containing obscenities from another developer. I'd love to get this fixed rather than filing new bug reports. I'm sure we all would.
Lazarus, can you tell me if this is after you applied the last patch suggested by Thomas, for gate_news ?
The only patch i aplied follows: --- cron/gate_news.orig Mon Feb 7 22:47:52 2000 +++ cron/gate_news Mon Feb 7 22:53:23 2000 @@ -76,7 +76,16 @@ # update the gate_watermarks file. we'll actually do the gating in a # child process conn = nntplib.NNTP(mlist.nntp_host) - r,c,first,last,n = conn.group(mlist.linked_newsgroup) + try: + r,c,first,last,n = conn.group(mlist.linked_newsgroup) + except nntplib.error_perm: + # We got an error 500, probably meaning that the 'group' command + # is not implemented. A likely scenario causing this is when + # running the Mailman gateway on the same machine as the news + # server; the server defaults to news feed mode. We need to set + # the connection to reader mode first. + conn.shortcmd('mode reader') + r,c,first,last,n = conn.group(mlist.linked_newsgroup) first = int(first) last = int(last) wm = watermarks.get(name, 0) -- Please encrypt all mail whenever possible. The following Public Keys for Lazarus Long <lazarus@overdue.dhis.net> are available upon request: Type Bits/KeyID Fingerprint (GnuPG (GPG) is preferred.) GPG/ELG: 2048g/92F6493B 2C55 E967 278B 4E8B D25B F5F3 352B 9B0E 32C3 3BA4 GPG/DSA: 1024D/32C33BA4 (none for DSA keys)

On Wed, Feb 09, 2000 at 11:36:41AM +0100, Gergely Madarasz wrote:
Package: mailman Version: 1.1-2 Severity: important
Feb 09 03:47:55 2000 post: Traceback (innermost last): post: File "/var/lib/mailman/scripts/post", line 73, in ? post: mlist.Post(msg, approved=fromusenet) post: File "/usr/lib/mailman/Mailman/MailList.py", line 1331, in Post post: self.SendMailToNewsGroup(msg) post: File "/usr/lib/mailman/Mailman/GatewayManager.py", line 204, in SendMailToNewsGroup post: con.post(msg) post: File "/usr/lib/python1.5/nntplib.py", line 417, in post post: resp = self.shortcmd('POST') post: File "/usr/lib/python1.5/nntplib.py", line 158, in shortcmd post: return self.getresp() post: File "/usr/lib/python1.5/nntplib.py", line 134, in getresp post: raise error_perm, resp
Gatewaying seems completely broken.
Indeed. I'm not sure what kind of newsserver is being used, but apparently it doesn't even do POSTing without 'mode reader' first. This is different from the setup we use, so I'm not sure what other commands are tricky to try.
There are three possible fixes:
Hack around it in mailman like we did in gate_news (by catching the error_perm and doing a 'mode reader' at that time)
backporting the newest nntplib from the python cvs tree to the Mailman/pythonlib and explicitly importing that copy
wrapping the nntplib.NNTP constructor with something that sends 'mode reader' and possibly resends authentication data, before releasing the object to the caller.
fix #1 is ok for a quick-fix in one or two places (diff attached) but not a very good mailman-wide solution. I'm not sure which of #2 or #3 is better, i believe Barry prefers #2 (or so he said ;) but i think wrapping nntplib.NNTP might be more maintainable. On the other hand, Mailman does not currently use any kind of authentication, so maybe #1 is the best (easiest) fix after all.
The good news is, nntplib is only used in two places, cron/gate_news and Mailman/GatewayManager.py (Mailman/Handlers/ToUsenet.py in 1.2-cvs) so when this fix is applied, all NNTP problems should be solved... honest ;)
(Attached: 2 diffs, one for mailman 1.1, and one for the current CVS tree. Barry or another Cabal member can figure out what is the proper fix, and implement or apply the right fix.)
-- Thomas Wouters <thomas@xs4all.net>
Hi! I'm a .signature virus! copy me into your .signature file to help me spread!
participants (3)
-
Gergely Madarasz
-
Lazarus Long
-
Thomas Wouters