[Spambayes] HowTo disable the "Save and Shutdown" Button in the Webinterface on linux ?

Richie Hindle richie at entrian.com
Thu Oct 27 18:03:56 CEST 2005


Hi Florian,

> I found the file "ui.html" in the source directory which seems to be the
> template of the page but I am not really familar to Python and my
> changes in this file took no effect.

I assume you're running from source.  You need to install resourcepackage
from http://resourcepackage.sourceforge.net/ in order for your changes to
anything in the "resource" directory to take effect.  Download
ResourcePackage-1.0.0.tar.gz, unpack it into a temporary area, cd to that
area, and run "python setup.py install".  You can then delete the unpacked
files.

> I would also like to have the feature to show only the headers of the
> classified mails to anybody who uses the webinterface .....

In ProxyUI.py there's a class called ProxyUserInterface with a member
function called onView() - it's that function that shows the emails:

        if message is not None:
            self.write("<pre>%s</pre>" % cgi.escape(message.as_string()))

You need to change that to just show the headers... I don't know off the
top of my head whether the "email" package has a way to do that, but this
hack should work:

        if message is not None:
            whole_message = message.as_string()
            split_message = re.split(r'\r*\n\r*\n', whole_message, 1)
            self.write("<pre>%s</pre>" % cgi.escape(split_message[0]))

-- 
Richie Hindle
richie at entrian.com




More information about the SpamBayes mailing list