~ubuntu-branches/ubuntu/saucy/postfix/saucy

« back to all changes in this revision

Viewing changes to html/SQLITE_README.html

  • Committer: Bazaar Package Importer
  • Author(s): LaMont Jones
  • Date: 2011-02-22 11:20:43 UTC
  • mfrom: (1.1.27 upstream)
  • Revision ID: james.westby@ubuntu.com-20110222112043-c34ht219w3ybrilr
Tags: 2.8.0-2
* a little more lintian cleanup
* Fix missing format strings in smtp-sink.c

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"
 
2
        "http://www.w3.org/TR/html4/loose.dtd">
 
3
 
 
4
<html>
 
5
 
 
6
<head>
 
7
 
 
8
<title>Postfix SQLite Howto</title>
 
9
 
 
10
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
 
11
 
 
12
</head>
 
13
 
 
14
<body>
 
15
 
 
16
<h1><img src="postfix-logo.jpg" width="203" height="98" ALT="">Postfix SQLite Howto</h1>
 
17
 
 
18
<hr>
 
19
 
 
20
<h2>Introduction</h2>
 
21
 
 
22
<p> The Postfix sqlite map type allows you to hook up Postfix to a
 
23
SQLite database. This implementation allows for multiple sqlite
 
24
databases: you can use one for a <a href="virtual.5.html">virtual(5)</a> table, one for an
 
25
<a href="access.5.html">access(5)</a> table, and one for an <a href="aliases.5.html">aliases(5)</a> table if you want.  </p>
 
26
 
 
27
<h2>Building Postfix with SQLite support</h2>
 
28
 
 
29
<p> The Postfix SQLite client utilizes the sqlite3 library,
 
30
which can be obtained from: </p>
 
31
 
 
32
<blockquote>
 
33
    <p> <a href="http://www.sqlite.org/">http://www.sqlite.org/</a> </p>
 
34
</blockquote>
 
35
 
 
36
<p> In order to build Postfix with sqlite map support, you will
 
37
need to add to CCARGS the flags -DHAS_SQLITE and -I with the directory
 
38
containing the sqlite header files, and you will need to add to
 
39
AUXLIBS the directory and name of the sqlite3 library, plus the
 
40
name of the standard POSIX thread library (pthread).  For example:
 
41
</p>
 
42
 
 
43
<blockquote>
 
44
<pre>
 
45
make -f Makefile.init makefiles \
 
46
     'CCARGS=-DHAS_SQLITE -I/usr/local/include' \
 
47
     'AUXLIBS=-L/usr/local/lib -lsqlite3 -lpthread'
 
48
</pre>
 
49
</blockquote>
 
50
 
 
51
<p> Then, just run 'make'.</p>
 
52
 
 
53
<h2>Using SQLite tables</h2>
 
54
 
 
55
<p> Once Postfix is built with sqlite support, you can specify a
 
56
map type in <a href="postconf.5.html">main.cf</a> like this: </p>
 
57
 
 
58
<blockquote>
 
59
<pre>
 
60
<a href="postconf.5.html#alias_maps">alias_maps</a> = <a href="sqlite_table.5.html">sqlite</a>:/etc/postfix/sqlite-aliases.cf
 
61
</pre>
 
62
</blockquote>
 
63
 
 
64
<p> The file /etc/postfix/sqlite-aliases.cf specifies lots of
 
65
information telling Postfix how to reference the sqlite database.
 
66
For a complete description, see the <a href="sqlite_table.5.html">sqlite_table(5)</a> manual page. </p>
 
67
 
 
68
<h2>Example: local aliases </h2>
 
69
 
 
70
<pre>
 
71
#
 
72
# sqlite config file for <a href="local.8.html">local(8)</a> <a href="aliases.5.html">aliases(5)</a> lookups
 
73
#
 
74
 
 
75
# Path to database 
 
76
dbpath = /some/path/to/sqlite_database
 
77
 
 
78
# See <a href="sqlite_table.5.html">sqlite_table(5)</a> for details.
 
79
query = SELECT forw_addr FROM mxaliases WHERE alias='%s' AND status='paid'
 
80
</pre>
 
81
 
 
82
<h2>Additional notes</h2>
 
83
 
 
84
<p> The SQLite configuration interface setup allows for multiple
 
85
sqlite databases: you can use one for a virtual table, one for an
 
86
access table, and one for an aliases table if you want. </p>
 
87
 
 
88
<h2>Credits</h2>
 
89
 
 
90
<p> SQLite support was added with Postfix version 2.8. </p>
 
91
 
 
92
<ul>
 
93
 
 
94
<li>Implementation by Axel Steiner</li>
 
95
<li>Documentation by Jesus Garcia Crespo</li>
 
96
 
 
97
</ul>
 
98
 
 
99
</body>
 
100
 
 
101
</html>