mirror of
https://github.com/Stichting-MINIX-Research-Foundation/netbsd.git
synced 2025-08-31 00:40:19 -04:00
102 lines
2.4 KiB
HTML
102 lines
2.4 KiB
HTML
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"
|
|
"http://www.w3.org/TR/html4/loose.dtd">
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>Postfix SQLite Howto</title>
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<h1><img src="postfix-logo.jpg" width="203" height="98" ALT="">Postfix SQLite Howto</h1>
|
|
|
|
<hr>
|
|
|
|
<h2>Introduction</h2>
|
|
|
|
<p> The Postfix sqlite map type allows you to hook up Postfix to a
|
|
SQLite database. This implementation allows for multiple sqlite
|
|
databases: you can use one for a virtual(5) table, one for an
|
|
access(5) table, and one for an aliases(5) table if you want. </p>
|
|
|
|
<h2>Building Postfix with SQLite support</h2>
|
|
|
|
<p> The Postfix SQLite client utilizes the sqlite3 library,
|
|
which can be obtained from: </p>
|
|
|
|
<blockquote>
|
|
<p> http://www.sqlite.org/ </p>
|
|
</blockquote>
|
|
|
|
<p> In order to build Postfix with sqlite map support, you will
|
|
need to add to CCARGS the flags -DHAS_SQLITE and -I with the directory
|
|
containing the sqlite header files, and you will need to add to
|
|
AUXLIBS the directory and name of the sqlite3 library, plus the
|
|
name of the standard POSIX thread library (pthread). For example:
|
|
</p>
|
|
|
|
<blockquote>
|
|
<pre>
|
|
make -f Makefile.init makefiles \
|
|
'CCARGS=-DHAS_SQLITE -I/usr/local/include' \
|
|
'AUXLIBS=-L/usr/local/lib -lsqlite3 -lpthread'
|
|
</pre>
|
|
</blockquote>
|
|
|
|
<p> Then, just run 'make'.</p>
|
|
|
|
<h2>Using SQLite tables</h2>
|
|
|
|
<p> Once Postfix is built with sqlite support, you can specify a
|
|
map type in main.cf like this: </p>
|
|
|
|
<blockquote>
|
|
<pre>
|
|
alias_maps = sqlite:/etc/postfix/sqlite-aliases.cf
|
|
</pre>
|
|
</blockquote>
|
|
|
|
<p> The file /etc/postfix/sqlite-aliases.cf specifies lots of
|
|
information telling Postfix how to reference the sqlite database.
|
|
For a complete description, see the sqlite_table(5) manual page. </p>
|
|
|
|
<h2>Example: local aliases </h2>
|
|
|
|
<pre>
|
|
#
|
|
# sqlite config file for local(8) aliases(5) lookups
|
|
#
|
|
|
|
# Path to database
|
|
dbpath = /some/path/to/sqlite_database
|
|
|
|
# See sqlite_table(5) for details.
|
|
query = SELECT forw_addr FROM mxaliases WHERE alias='%s' AND status='paid'
|
|
</pre>
|
|
|
|
<h2>Additional notes</h2>
|
|
|
|
<p> The SQLite configuration interface setup allows for multiple
|
|
sqlite databases: you can use one for a virtual table, one for an
|
|
access table, and one for an aliases table if you want. </p>
|
|
|
|
<h2>Credits</h2>
|
|
|
|
<p> SQLite support was added with Postfix version 2.8. </p>
|
|
|
|
<ul>
|
|
|
|
<li>Implementation by Axel Steiner</li>
|
|
<li>Documentation by Jesus Garcia Crespo</li>
|
|
|
|
</ul>
|
|
|
|
</body>
|
|
|
|
</html>
|