Thread View: news.software.nntp
4 messages
4 total messages
Started by Steve Crook
Sun, 01 Aug 2010 12:30
Empty Articles
Author: Steve Crook
Date: Sun, 01 Aug 2010 12:30
Date: Sun, 01 Aug 2010 12:30
27 lines
2014 bytes
2014 bytes
Hi all, Appologies for raising this issue again but I'm still struggling understand what's going on. I'm using Python's nntplib to inject articles to three newsservers (via IHAVE). Glorb always accepts them but Altopia and Mixmin reject them for having no body. Following some diagnosis and assistance from Russ, it appears that nntplib converts /n to /r/n so I'm at a loss as to why these articles are getting rejected by newer INN versions. 2010-08-01 06:02:37 3586 INFO <20100801050235.5LZ2QxzF81oa@nymserv.mixmin.net> successful IHAVE to news.glorb.com. 2010-08-01 06:02:38 3586 INFO IHAVE to newsin.alt.net returned a temporary error: 437 No body. 2010-08-01 06:02:38 3586 INFO IHAVE to localhost returned a temporary error: 437 Empty article. 2010-08-01 11:11:17 22813 INFO <20100801101109.w6A7tRT7vnJj@nymserv.mixmin.net> successful IHAVE to news.glorb.com. 2010-08-01 11:11:18 22813 INFO IHAVE to newsin.alt.net returned a temporary error: 437 No body. 2010-08-01 11:11:19 22813 INFO IHAVE to localhost returned a temporary error: 437 Empty article.
Re: Empty Articles
Author: Julien ÉLIE
Date: Sun, 01 Aug 2010 13:47
Date: Sun, 01 Aug 2010 13:47
72 lines
3459 bytes
3459 bytes
Hi Steve,
> I'm using Python's nntplib to inject articles to three newsservers (via
> IHAVE). Glorb always accepts them but Altopia and Mixmin reject them
> for having no body. Following some diagnosis and assistance from Russ,
> it appears that nntplib converts /n to /r/n so I'm at a loss as to why
> these articles are getting rejected by newer INN versions.
#!/usr/bin/python
import nntplib
server = nntplib.NNTP('news.trigofacile.com')
server.set_debuglevel(2)
file = open('/home/news/test-article')
server.ihave('<test@test>', file)
file.close()
server.quit()
It works fine with me. Article properly posted.
Python 2.4.4 and latest version of INN (CURRENT 2.6.0).
Note that if I run unix2dos on /home/news/test-article, I receive the
following error:
nntplib.NNTPTemporaryError: 437 No body
Are you sure the articles you try to inject contain mere "\n" (LF)?
An interesting option is server.set_debuglevel(2), which gives:
*put* 'Xref: news.trigofacile.com trigofacile.test:392\r\r\n'
*put* '\r\r\n'
*put* 'pouet\r\r\n'
*put* '.\r\n'
*get* '437 No body\r\n'
*resp* '437 No body'
INN looks for "\r\n\r\n" to start a body. It never saw one here.
> 2010-08-01 06:02:37 3586 INFO
> <20100801050235.5LZ2QxzF81oa@nymserv.mixmin.net> successful
> IHAVE to news.glorb.com.
> 2010-08-01 06:02:38 3586 INFO IHAVE to newsin.alt.net returned a
> temporary error: 437 No body.
> 2010-08-01 06:02:38 3586 INFO IHAVE to localhost returned a temporary
> error: 437 Empty article.
I bet you're testing three different versions of INN :-)
A commit which may have changed something here:
http://inn.eyrie.org/trac/changeset/8682
Fix a bug when articles were fed to innd via IHAVE or TAKETHIS
with an empty article: the article terminator was not recognized.
Therefore, subsequent NNTP commands were eaten inside the article...
--
Julien ÉLIE
« Se coucher tard... nuit. » (Raymond Devos)
Re: Empty Articles
Author: Steve Crook
Date: Sun, 01 Aug 2010 17:24
Date: Sun, 01 Aug 2010 17:24
16 lines
1896 bytes
1896 bytes
On Sun, 1 Aug 2010 15:47:47 +0200, Julien ÉLIE wrote in Message-Id: <i33tu3$mpd$1@news.trigofacile.com>: > An interesting option is server.set_debuglevel(2) Hi Julien, Setting this immediately enabled me to see what was going wrong. I'm not passing a file to nntplib but instead using Python's StringIO to pass it a file-like buffer. I was doing this within a loop for each nntp peer but wasn't resetting the pointer within the file-like object after each iteration. As a result, on the second pass, the article is indeed empty. Thanks so much for putting me out of my misery, I've been staring at that for days and going completely down the wrong path! :-)
Re: Empty Articles
Author: Julien ÉLIE
Date: Sun, 01 Aug 2010 18:01
Date: Sun, 01 Aug 2010 18:01
17 lines
1791 bytes
1791 bytes
Hi Steve, >> An interesting option is server.set_debuglevel(2) > > Setting this immediately enabled me to see what was going wrong. I'm glad you found out the issue. StringIO is indeed better to use than a real file. Or, even better, cStringIO. The best of luck for the next step of your script. -- Julien ÉLIE « Inter pradendum sit saepe parumque bibendum. »
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads