summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbwarsaw2000-02-07 20:13:33 +0000
committerbwarsaw2000-02-07 20:13:33 +0000
commit9472a54f3553c2e2d46140a0fd4e658b7cee6fc0 (patch)
tree1766afde05ee8d029ae77a1362d7e7e9e8e165ff
parent190cf39298500748670020dc7e4660504bb3871c (diff)
downloadmailman-9472a54f3553c2e2d46140a0fd4e658b7cee6fc0.tar.gz
mailman-9472a54f3553c2e2d46140a0fd4e658b7cee6fc0.tar.zst
mailman-9472a54f3553c2e2d46140a0fd4e658b7cee6fc0.zip
main(): Watch out for error 500 when using the group command on the
NNTP connection. If the Mailman gateway is on the same machine as the news server, you probably need to set the news server to reader mode first. Patch given by Thomas Wouters inspired by a patch from Jim Tittsler.
-rwxr-xr-xcron/gate_news11
1 files changed, 10 insertions, 1 deletions
diff --git a/cron/gate_news b/cron/gate_news
index c550af9c9..4263e37ab 100755
--- a/cron/gate_news
+++ b/cron/gate_news
@@ -125,7 +125,16 @@ def main():
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, 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,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)