|
Packit |
e8bc57 |
SQLITE3 DATABASE DRIVER FOR BOGOFILTER
|
|
Packit |
e8bc57 |
======================================
|
|
Packit |
e8bc57 |
|
|
Packit |
e8bc57 |
This document only applies if you want to use bogofilter with SQLite3
|
|
Packit |
e8bc57 |
databases.
|
|
Packit |
e8bc57 |
|
|
Packit |
e8bc57 |
1. Overview -----------------------------------------------------------
|
|
Packit |
e8bc57 |
|
|
Packit |
e8bc57 |
Bogofilter 0.93.3 and newer can use recent SQLite3 versions to store
|
|
Packit |
e8bc57 |
their tokens; see section 2.1 below for supported versions.
|
|
Packit |
e8bc57 |
|
|
Packit |
e8bc57 |
SQLite is a database that handles a large SQL subset and stores all
|
|
Packit |
e8bc57 |
tables in one permanent file, and the journal for changes in one
|
|
Packit |
e8bc57 |
temporary file that gets automatically removed when no longer needed.
|
|
Packit |
e8bc57 |
SQLite3 ships with a command-line client for the shell, named sqlite3.
|
|
Packit |
e8bc57 |
|
|
Packit |
e8bc57 |
2. Prerequisites ------------------------------------------------------
|
|
Packit |
e8bc57 |
|
|
Packit |
e8bc57 |
2.1 Compatibility - supported SQLite versions
|
|
Packit |
e8bc57 |
|
|
Packit |
e8bc57 |
At this time, only SQLite v3.6.13, and v3.6.22 and newer are supported.
|
|
Packit |
e8bc57 |
Please check the SQLite website <http://sqlite.org/> for upgrade
|
|
Packit |
e8bc57 |
recommendations.
|
|
Packit |
e8bc57 |
Older versions back to 3.0.8 may work, but you are advised to
|
|
Packit |
e8bc57 |
carefully review the sqlite3 ChangeLog, because there have been several
|
|
Packit |
e8bc57 |
important bug fixes since 3.0.8, including fixes for bugs that can
|
|
Packit |
e8bc57 |
corrupt the database. Note that sqlite v3.3.9 and newer sometimes
|
|
Packit |
e8bc57 |
generate error messages that are clearer when executing SQL statements
|
|
Packit |
e8bc57 |
(that bogofilter generates internally).
|
|
Packit |
e8bc57 |
|
|
Packit |
e8bc57 |
Bogofilter prints a warning (but continues to run) when used with SQLite
|
|
Packit |
e8bc57 |
versions older than v3.6.12. This warning can be suppressed by defining
|
|
Packit |
e8bc57 |
the environment variable BF_USE_OLD_SQLITE to any value, including the
|
|
Packit |
e8bc57 |
empty value.
|
|
Packit |
e8bc57 |
|
|
Packit |
e8bc57 |
The Oracle Berkeley DB SQLite3 API that is available since Berkeley DB
|
|
Packit |
e8bc57 |
5.0.21 is unsupported. Use Berkeley DB's native API instead, see
|
|
Packit |
e8bc57 |
README.db for details.
|
|
Packit |
e8bc57 |
|
|
Packit |
e8bc57 |
|
|
Packit |
e8bc57 |
2.2 Installation
|
|
Packit |
e8bc57 |
|
|
Packit |
e8bc57 |
To use bogofilter with the SQLite3 back-end driver, you must install a
|
|
Packit |
e8bc57 |
sufficiently recent SQLite3 version before configuring bogofilter. You
|
|
Packit |
e8bc57 |
can download SQLite 3 and find installation instructions for SQLite 3 at
|
|
Packit |
e8bc57 |
<http://sqlite.org/>, the SQLite installation is pretty straightforward.
|
|
Packit |
e8bc57 |
|
|
Packit |
e8bc57 |
After that, you can configure bogofilter, add --with-database=sqlite
|
|
Packit |
e8bc57 |
to the ./configure command.
|
|
Packit |
e8bc57 |
|
|
Packit |
e8bc57 |
3. Use ----------------------------------------------------------------
|
|
Packit |
e8bc57 |
|
|
Packit |
e8bc57 |
3.1 Care and feeding
|
|
Packit |
e8bc57 |
|
|
Packit |
e8bc57 |
SQLite is pretty self-maintaining. After larger maintenance operations
|
|
Packit |
e8bc57 |
to remove older tokens you may want to run this command:
|
|
Packit |
e8bc57 |
|
|
Packit |
e8bc57 |
sqlite3 ~/.bogofilter/wordlist.db 'VACUUM;'
|
|
Packit |
e8bc57 |
|
|
Packit |
e8bc57 |
to remove unused pages from the database file and reduce the file size.
|
|
Packit |
e8bc57 |
|
|
Packit |
e8bc57 |
A. Miscellaneous ------------------------------------------------------
|
|
Packit |
e8bc57 |
|
|
Packit |
e8bc57 |
A.1 Why does bogofilter use BLOB for both columns?
|
|
Packit |
e8bc57 |
|
|
Packit |
e8bc57 |
bogofilter has traditionally managed its own data structure inside key
|
|
Packit |
e8bc57 |
and value, BLOB allows the verbatim retrieval of such data without
|
|
Packit |
e8bc57 |
stumbling across embedded NUL characters and without adding even more
|
|
Packit |
e8bc57 |
translations between data formats.
|
|
Packit |
e8bc57 |
|
|
Packit |
e8bc57 |
END--------------------------------------------------------------------
|