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.
The Postfix SQLite client utilizes the sqlite3 library, which can be obtained from:
In order to build Postfix with sqlite map support, you will need to add -DHAS_SQLITE and -I for the directory containing the sqlite headers, and the sqlite3 library to AUXLIBS, for example:
make -f Makefile.init makefiles \ 'CCARGS=-DHAS_SQLITE -I/usr/local/include' \ 'AUXLIBS=-L/usr/local/lib -lsqlite3 -lpthread'
Then, just run 'make'.
Once Postfix is built with sqlite support, you can specify a map type in main.cf like this:
alias_maps = sqlite:/etc/postfix/sqlite-aliases.cf
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.
# # 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'
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.