I made a generic ClassInterceptor designed to be mixed in with Class or
FileClass at runtime as directed by schema.py (hence supporting all
backends). The two initial uses of this class are: 1] compression of
"content" (for messages primarily composed of text); and 2] suppression
of duplicate file entries (handy for people who have "image signatures"
setup in their email client.) It could also be used for encryption of
file content on disk.
The attached file contains the code. Feel free to post on the wiki, as
the wiki's permissions are still setup to prohibit postings by this
registered user. Also feel free to include in the standard distribution.
Use of the file in schema.py is as follows:
from interceptor import interceptor_factory, GzipFileClass, UniqueFileClass
# Make a message file class which compresses the content before storage.
# Make a file class which only stores unique files.
|2010-10-25 16:58:28||bnordgren||set||messageid: <email@example.com>|
|2010-10-25 16:58:28||bnordgren||link||issue2550677 messages|