Created
November 27, 2013 17:12
-
-
Save oal/7679396 to your computer and use it in GitHub Desktop.
Schema and configuration example for using SQLite with OpenSMTPD.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# sqlite.conf | |
dbpath /mail/mail.db | |
query_alias select value from aliases where key=?; | |
query_domain select domain from domains where domain=?; | |
query_userinfo select uid, gid, directory from users where user=?; | |
query_credentials select key, value from credentials where key=?; | |
query_netaddr select value from netaddr where value=?; | |
# In smtpd.conf, define your tables like this, then use it just like any other table: | |
table domains sqlite:/mail/sqlite.conf | |
# SQLite schema: | |
CREATE TABLE "aliases" ( | |
"key" TEXT, | |
"value" TEXT | |
); | |
CREATE TABLE "users" ( | |
"user" TEXT, | |
"uid" INTEGER, | |
"gid" INTEGER, | |
"directory" TEXT | |
); | |
CREATE TABLE "credentials" ( | |
"key" TEXT, | |
"value" TEXT | |
); | |
CREATE TABLE "netaddr" ( | |
"value" TEXT | |
); | |
CREATE TABLE domains ( | |
"domain" TEXT | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment