dj <[EMAIL PROTECTED]> writes:

> 0) Redhat 7.3 system with python rpms
> 
>  python2-2.1.1-2.72
>  mod_python-2.7.6-1
>  python-tools-1.5.2-42.72

This is the first clue.  On Redhat systems, the 'python' program is
version 1.5.x.  Python 2 is installed as 'python2'.  This might have
been the problem below with trying to 'compileall'.

> 2) So, not knowing any python, I installed it as a RPM with no
> reported probs. Still wondering if the above is a problem????

When you install TMDA from RPMs, I believe it finds and properly uses
the 'python2' binary, so you shouldn't see problems from that anymore.

> 3) converted plain test to db
> 
>  cat whitelist | db_load -T -t hash whitelist.db

Does 'db_load' produce a DBM file with the first column from the input
as the key and a blank field as the value?  Also, can it lowercase the
input before hashing it?

In any case, a much easier way to do this is not to do it at all.
Instead of using the 'from-dbm' rule, use the 'from-file' rule with
the '-autodbm' flag.  It will create a DBM file for you anytime the
source file (the text whitelist) is newer than the DBM file.  It will
always search the DBM.

> 4) other useful info:
> 
> cat ~/.tmda/logs/debug
> 
> Uncaught Python 2.1.1 Exception (Thu Jan 30 23:00:04 2003):
> -----------------------------------------------------------
> Traceback (most recent call last):
>   File "/usr/bin/tmda-filter", line 53, in ?
>     execfile(os.path.join(execdir, 'tmda-rfilter'))
>   File "/usr/bin/tmda-rfilter", line 763, in ?
>     main()
>   File "/usr/bin/tmda-rfilter", line 710, in main
>     orig_msgin_size)
>   File "/usr/lib/python2.1/site-packages/TMDA/FilterParser.py", line
> 850, in firstmatch
>     import cdb
> ImportError: No module named cdb
> 
> **** Am I missing a module ??? *******

Yes.  The cdb module is not part of the base Python distribution.  It
is a third-party module.  The documentation on filters mentions this
and provides a link to the author's page, so you can download and
build it.

http://www.tmda.net/config-filter.html
http://www.tmda.net/filter-sources.html

> **** below is a basic /home/.tmda/filter/incoming *******
> 
> # Bounce all messages from yahoo.com
> from *@=yahoo.dom bounce
------------------^
dom?

> # Include my blacklist and whitelist
> from-dbm ~/.tmda/lists/blacklist.db drop
> from-cdb ~/.tmda/lists/whitelist.cdb accept
> #from-file -autodbm ~/.tmda/lists/nastygrams bounce
> #from-file -autocdb ~/.tmda/lists/confirmed ok
> #from-file ~/.tmda/lists/whitelist_wildcards accept

As I mentioned above, the 'from-file' variants are much more
convenient, since they automatically maintain your database files.

The '-autodbm' flag should work "out-of-the-box".  You'll have to
install the CDB module for '-autocdb' to work.  Again, see the two
filter file documentation pages that I listed above.

> 2003-01-30 23:50:20.719355500 delivery 1: deferral:
> See_/home/dj/.tmda/logs/debug_for_traceback/

If TMDA encounters an unrecoverable error, it will always defer the
mail, so that you don't lose it.  qmail will try again for up to a
week.  Once your configuration is correct, it will come through.

> cat ~dj/.tmda/logs/debug
> 
> Uncaught Python 2.1.1 Exception (Thu Jan 30 23:50:20 2003):
> -----------------------------------------------------------
> Traceback (most recent call last):
>   File "/usr/bin/tmda-filter", line 53, in ?
>     execfile(os.path.join(execdir, 'tmda-rfilter'))
>   File "/usr/bin/tmda-rfilter", line 763, in ?
>     main()
>   File "/usr/bin/tmda-rfilter", line 710, in main
>     orig_msgin_size)
>   File "/usr/lib/python2.1/site-packages/TMDA/FilterParser.py", line
> 845, in firstmatch
>     raise MatchError(lineno, str(e))
> MatchError: [line 16]: need 'c' or 'n' flag to open new db

This is caused by the 'from-dbm' rule not finding a DBM file.  In
other words, since it didn't find a file with the pathname you gave,
the DBM library thinks that it was asked to create a new DBM without
the right creation flags.

The 'from-dbm' and 'from-cdb' rules expect you to have created a
properly named DB file.  Different DBM-style databases use different
naming conventions.  We use the 'anydbm' Python module, which
essentially chooses the first one it finds on your system; maybe the
Berkeley DB, maybe the GNU DBM, whatever.

Yet another reason that 'from-file -autodbm' is much easier.  Can you
tell I'm a fan of the '-auto*' flags? <wink>

> Sorry if I posted to much info, I am greatful for any help offered.
> thanks

Not at all.  The more information, the better.


Tim
_____________________________________________
tmda-users mailing list ([EMAIL PROTECTED])
http://tmda.net/lists/listinfo/tmda-users

Reply via email to