List Info

Thread: Re: how to test autoreplier.py




Re: how to test autoreplier.py
user name
2005-09-03 11:42:03
Running ./dbmail.py alone - get this:

Dbmail configuration error: missing key [STORAGE] for stanza
[DBMAIL]


On 9/3/05, April Lorenzen <outboundindexgmail.com> wrote:
>     def _setPgsqlDictCursor(self):
>         import psycopg
>         conn = psycopg.connect("host=%s dbname=%s
user=%s password=%s" % 
>                 self.getConfig('host'),
self.getConfig('user'), 
>                 self.getConfig('db'),
self.getConfig('pass'))
>         conn.autocommit(1)
>         self._cursor = conn.cursor()
> 
> 
> Paul - if you could tell me where to put some
"print"s or something to
> make it print to the screen when it gets thru certain
sections of the
> dbmail.py or autoreplier.py? then I could maybe see why
a reply isn't
> coming out of it.
> 
> Well first let me look at permissions on the py files i
guess. When
> you cat pipe a message to the autoreplier.py, the
cursor just returns
> as if everything went normally. I haven't found
relevant logs yet.
> 
> Thank you,
> 
> - April Lorenzen
> http://ors.blogs4change.
org/
> http://adl.blogware.com
> 
> On 9/2/05, April Lorenzen <outboundindexgmail.com> wrote:
> > Paul - My postgresql / py guy hooked up
autoreplier.py to pg today but
> > so far it does not autoreply.
> >
> > I am wondering if you can tell me how to test it
from the command line
> > or what log file I might observe for info on the
output or errors when
> > the mail is piped to
> >
> > |/usr/local/bin/autoreplier.py  -u grahamexample.com -a grahamexample..com
> >
> > (my userids are full email addresses)
> >
> > Thank you,
> >
> > April Lorenzen
> > http://ors.blogs4change.o
rg
> > http://adl.blogware.com
> >
>
_______________________________________________
Dbmail mailing list
Dbmaildbmail.org
htt
ps://mailman.fastxs.nl/mailman/listinfo/dbmail
Re: Re: how to test autoreplier.py
user name
2005-09-03 14:49:20
April Lorenzen wrote:
> Running ./dbmail.py alone - get this:
> 
> Dbmail configuration error: missing key [STORAGE] for
stanza [DBMAIL]

Which tell you *exactly* why I don't work, no? 

This script does *not* use libdbmail. It doesn't share the
normal dbmail utils'
way of knowing what backend-driver to use. To compensate for
this lack of common
knowlegde it requires a new config item:

[DBMAIL]
# add one of these for the python libs and utils (for now)
#STORAGE=pgsql
#STORAGE=sqlite
#STORAGE=mysql
db=
user=
host=

etc...

You also need to check the path to your dbmail.conf as
defined in lib/dbmail.py
(for now).


> On 9/3/05, April Lorenzen <outboundindexgmail.com> wrote:
> 
>>    def _setPgsqlDictCursor(self):
>>        import psycopg
>>        conn = psycopg.connect("host=%s
dbname=%s user=%s password=%s" % 
>>                self.getConfig('host'),
self.getConfig('user'), 
>>                self.getConfig('db'),
self.getConfig('pass'))
>>        conn.autocommit(1)
>>        self._cursor = conn.cursor()

Thanks.

>>
>>
>>Paul - if you could tell me where to put some
"print"s or something to
>>make it print to the screen when it gets thru
certain sections of the
>>dbmail.py or autoreplier.py? then I could maybe see
why a reply isn't
>>coming out of it.

The code is self-testing. Running python lib/dbmail.py
should finish with no
errors. There's a set of unit-tests in there, use them!



>>Well first let me look at permissions on the py
files i guess. When
>>you cat pipe a message to the autoreplier.py, the
cursor just returns
>>as if everything went normally. I haven't found
relevant logs yet.

Mmmm, it should probably trigger an exception here. Too
quiet is too quiet.

Run the tests.

 python lib/dbmail.py -v
testGetConfig (__main__.testDbmail) ... ok
testSetCursor (__main__.testDbmail) ... ok
testDelete (__main__.testDbmailAlias) ... ok
testGet (__main__.testDbmailAlias) ... ok
testSet (__main__.testDbmailAlias) ... ok
testGetReply (__main__.testDbmailAutoreply) ... ok
testGetConfig (__main__.testDbmailConfig) ... ok
testParse (__main__.testDbmailConfig) ... ok
testGet (__main__.testDbmailUser) ... ok
testGetGidNumber (__main__.testDbmailUser) ... ok
testGetUidNumber (__main__.testDbmailUser) ... ok

------------------------------------------------------------
----------
Ran 11 tests in 0.079s

OK

-- 
 
____________________________________________________________
____
  Paul Stevens                                 
mailto:paulnfg.nl
  NET FACILITIES GROUP                     PGP: finger
paulnfg.nl
  The Netherlands________________________________http://www.nfg.nl
_______________________________________________
Dbmail mailing list
Dbmaildbmail.org
htt
ps://mailman.fastxs.nl/mailman/listinfo/dbmail
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )