I really did not clarify this.
If you want to offer different levels of spam protection you have to
re-write (incoming.html) and the associated python file.
It's a little messy but it beats letting people mess with there own
filters.
This allows them to select options instead of messing up a filter file
they do not understand.
My code is a little messy but you can get the picture.
First modify EditFilter.py
# Load the display template
if Form["cmd"].value == "incoming":
T = Template.Template("incoming.html")
T["FilePath"] = Filename =
CgiUtil.ExpandUser(Defaults.FILTER_INCOMING)
T["DataDir"] = DataDir = CgiUtil.ExpandUser(Defaults.DATADIR)
else:
T = Template.Template("outgoing.html")
T["FilePath"] = Filename =
CgiUtil.ExpandUser(Defaults.FILTER_OUTGOING)
T["DataDir"] = DataDir = CgiUtil.ExpandUser(Defaults.DATADIR)
Second, modify incoming.html
<!--Normal Spam Protection-->
<form method="post" action="%(Script)s">
<tr>
<td height="30" align="center" valign="top"><b></b></td>
</tr>
<tr>
<td>
<input type="hidden" name="filter" value="
# NORMAL level
from-file -autocdb %(DataDir)slists/blacklist reject
to-file -autocdb %(DataDir)slists/revoked confirm
from-file -autocdb %(DataDir)slists/whitelist ok
from-file -autocdb %(DataDir)slists/confirmed ok
">
<input type="hidden" name="subcmd" value="save">
<input type="hidden" name="cmd" value="incoming">
<input type="hidden" name="SID" value="%(SID)s">
</td>
</tr>
<tr align="center">
<td height="30" valign="bottom"><!-- var: SaveButton --><input
type="submit" value="Select NORMAL spam protection"><!-- /var
--></td>
</tr>
</form>
<!--End Spam Normal-->
<!--Lite Spam Protection-->
<form method="post" action="%(Script)s">
<tr>
<td height="30" align="center" valign="top"><b></b><BR>
</td>
</tr>
<tr>
<td>
<input type="hidden" name="filter" value="
# LITE level
from-file -autocdb %(DataDir)slists/blacklist reject
to-file -autocdb %(DataDir)slists/revoked confirm
from-file -autocdb %(DataDir)slists/whitelist ok
from-file -autocdb %(DataDir)slists/confirmed ok
headers 'X-Spam-Status: Yes' confirm
headers 'Received-SPF: pass' ok
headers 'Received-SPF: *' confirm
from * ok
">
<input type="hidden" name="subcmd" value="save">
<input type="hidden" name="cmd" value="incoming">
<input type="hidden" name="SID" value="%(SID)s">
</td>
</tr>
<tr align="center">
<td height="30" valign="bottom"><!-- var: SaveButton --><input
type="submit" value="Select LITE spam protection"><!-- /var -->
<BR><BR><BR><BR>
Current Spam Protection Level:
<input type="text" name="T1" size="8" maxlength="8"
value="%(FileContents)s">
<BR>(If the above is not clear you have the normal protection level)
</td>
</tr>
</form>
<!--End Spam Lite-->
<!-- CUT -->
Sam
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Samuel Hill
Sent: Thursday, June 10, 2004 3:53 PM
To: [EMAIL PROTECTED]
Subject: RE: TMDA-CGI Template Variables
Nevermind, the answer is below...
<input type="hidden" name="filter" value="
# LITE level
from-file -autocdb %(DataDir)slists/blacklist reject
to-file -autocdb %(DataDir)slists/revoked confirm
from-file -autocdb %(DataDir)slists/whitelist ok
from-file -autocdb %(DataDir)slists/confirmed ok
headers 'X-Spam-Status: Yes' confirm
headers 'Received-SPF: pass' ok
headers 'Received-SPF: *' confirm
from * ok
">
Sam
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Samuel Hill
Sent: Thursday, June 10, 2004 10:52 AM
To: [EMAIL PROTECTED]
Subject: TMDA-CGI Template Variables
I am working on a way to give different levels of TMDA protections.
For example, the incoming.html gives a way to modify the filter template
directly. Bad for a typical user so what I am trying to do is give
options instead. For example, one would challenge only if it met a
certain spam level, one would challenge all except if in whitelist or
confirmed, etc.
I can give options by re-writing the template but need to know how to
get the users homw directory in a template. For example, in the
incoming.html template there is a %(FilePath)s variable which is defined
in EditFilter.py. On the tmda-cgi page there is also mention of some
embedded variables.
So, my question is how can I call the home directory using a variable in
the template?
Sam
_____________________________________________
tmda-users mailing list ([EMAIL PROTECTED])
http://tmda.net/lists/listinfo/tmda-users
_____________________________________________
tmda-users mailing list ([EMAIL PROTECTED])
http://tmda.net/lists/listinfo/tmda-users
_____________________________________________
tmda-users mailing list ([EMAIL PROTECTED])
http://tmda.net/lists/listinfo/tmda-users