Alan Chandler wrote:
>
>Checking the logs in /var/log/mailman/error I find this entry 
>
>Aug 14 21:47:12 2005 (2418) (NNTPDirect) NNTP error for list 
>"eclipse-webtools": 480 Authentication required for command 
>
>Which looks as though it is not even trying to login, rather than I made a 
>mistake with username or password. 
>
>Do I have to do any other steps to ensure that I am properly authenticated 
>for messages to the news server, as opposed to news from it? 


The NNTP posting code in Mailman/Queue/NewsRunner.py is (except for
indentation level):

        try:
            nntp_host, nntp_port = Utils.nntpsplit(mlist.nntp_host)
            conn = nntplib.NNTP(nntp_host, nntp_port,
                                readermode=True,
                                user=mm_cfg.NNTP_USERNAME,
                                password=mm_cfg.NNTP_PASSWORD)
            conn.post(fp)
        except nntplib.error_temp, e:
            syslog('error',
                   '(NNTPDirect) NNTP error for list "%s": %s',
                   mlist.internal_name(), e)
        except socket.error, e:
            syslog('error',
                   '(NNTPDirect) socket error for list "%s": %s',
                   mlist.internal_name(), e)


The exact same nntplib.NNTP() class instantiation is used by
cron/gate_news to open a connection to the NNTP server to retrieve
messages. See http://docs.python.org/lib/module-nntplib.html for more
info on nntplib.NNTP().

If it works properly in gate_news, it seems it should work in
NewsRunner.py. You might try posting directly from an interactive
Python session using something like

>>>import nntplib
>>>f = open('path_to_file_containing_post_with_aqppropriate_headers')
>>>msg = f.read()
>>>conn = nntplib.NNTP('news.example.com', 119, readermode=True,
...                    user='user_name', password='password')
>>>conn.set_debuglevel(2)
>>>conn.post(msg)
>>>conn.quit()

And see if that gives more insight.

--
Mark Sapiro <[EMAIL PROTECTED]>       The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan

------------------------------------------------------
Mailman-Users mailing list
Mailman-Users@python.org
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org

Security Policy: 
http://www.python.org/cgi-bin/faqw-mm.py?req=show&amp;file=faq01.027.htp

Reply via email to