readers.conf with python_access and python_auth

Julien ÉLIE julien at trigofacile.com
Sat Jun 7 14:36:40 UTC 2008


Hi David,

> And what this means?
> Jun  7 16:21:34 dev01 nnrpd[2787]: python access method not defined

It means that the access method is not found in your nnrpd_auth.py file.
According to the sample shipped with INN, it should be something like:


class AUTH:
    def access(self, attributes):
        syslog('notice', 'n_a access() invoked: hostname %s, ipaddress %s, interface %s, user %s' % (\
            attributes['hostname'], \
            attributes['ipaddress'], \
            attributes['interface'], \
            attributes['user']))

        if '127.0.0.1' == str(attributes['ipaddress']):
            syslog('notice', 'authentication by IP address succeeded')
            return {'read':'*','post':'*'}
        else:
            syslog('notice', 'authentication by IP address failed')
            return {'read':'!*','post':'!*'}

from nnrpd import *
myauth = AUTH()

try:
    set_auth_hook(myauth)
    syslog('notice', "authentication module successfully hooked into nnrpd")
except Exception, errmsg:
    syslog('error', "Cannot obtain nnrpd hook for authentication method: %s" % errmsg[0])




Does this mere sample work on your news server?
(I have not tested.)

-- 
Julien ÉLIE

« Quand je raconterai mon odyssée, personne ne me croira ! » (Astérix)



More information about the inn-workers mailing list