[Mailman-Users] Conflicting evidence in the logs

Mark Sapiro msapiro at value.net
Tue Aug 16 17:36:39 CEST 2005


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 <msapiro at value.net>       The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan




More information about the Mailman-Users mailing list