"Mark Nicholas" <[EMAIL PROTECTED]> writes:

> create a single /etc/tmdarc file and in it include a single incoming 
> reference:
> 
> FILTER_INCOMING = /home/vpopmail/tmda/lists/incoming
> 
> then in that incoming file include something like:
> ----------------------------------------------------------
> import os
> 
> from-file /home/vpopmail/tmda/lists/whitelist ok
> from-file /home/vpopmail/tmda/lists/blacklist drop
> from-file os.path.expanduser("~/lists/whitelist") ok
> from-file os.path.expanduser("~/lists/blacklist") drop
> ----------------------------------------------------------

Well, you're mixing up the config file syntax, which is actually
Python code, with the filter file syntax, which is something that we
came up with and that we parse ourselves.

'import os' and 'os.path.expanduser(...)' are Python code.  They will
not work in either the incoming or outgoing filter.  They only work in
configuration files; either /etc/tmdarc or ~/.tmda/config.

Assuming you remove the 'import os' line and the calls to
'os.path.expanduser()', it would look like this:

from-file /home/vpopmail/tmda/lists/whitelist ok
from-file /home/vpopmail/tmda/lists/blacklist drop
from-file ~/lists/whitelist ok
from-file ~/lists/blacklist drop

This is a perfectly valid incoming filter.  I would flip the
whitelist/blacklist order, though.  You'll occasionally run into
situations where you want a wildcard in your whitelist (*@domain.com)
but want a particular user from that domain blacklisted.  With the
order you have now, s/he'll always get through, because first match
wins.

My next question is, is this what you really want?  The second two
'from-file' rules will search /home/vpopmail/lists/whitelist or
/home/vpopmail/lists/blacklist.  I assume you were hoping that '~'
meant the virtual user's home directory.  In the case of tmda-ofmipd,
where I have added virtual domain support, that's exactly what it does
mean.

At this point, however, in tmda-filter '~' still refers to the system
user that TMDA runs as, which is 'vpopmail'.  I have not yet tackled
making '~' mean the virtual user.  It's pretty much the next thing on
my plate, so stay tuned.  My goal is to make what you've posted work
exactly the way you'd expect.

> Hmmm, I guess if that does work the one other variable I would want to add 
> is domain-specific white and black lists....-- 

Hmmm.  I'll ponder that.  Not sure how to provide that yet.  When I'm
done with the tmda-filter work, I can get you user-specific black and
white lists, but I'm not sure how to deal with the domains.  I'll at
least think about it.


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

Reply via email to