Skip to content

Instantly share code, notes, and snippets.

@dinocore1
Last active December 15, 2015 13:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dinocore1/5266863 to your computer and use it in GitHub Desktop.
Save dinocore1/5266863 to your computer and use it in GitHub Desktop.
driver = sqlite
connect = /etc/mailbox.sqlite
password_query = SELECT password, (username || '@' || domain) AS user FROM mailbox WHERE username = '%n' AND domain = '%d'
user_query = SELECT '/var/vmail/%d/%n' AS mail, 999 AS uid, 8 AS gid FROM mailbox WHERE username = '%n' AND domain = '%d' AND active = '1'
iterate_query = SELECT username, domain FROM mailbox
CREATE TABLE mailbox (
username varchar(255) NOT NULL,
domain varchar(255) NOT NULL,
password varchar(255) NOT NULL,
active tinyint(1) NOT NULL default '1'
);
dbpath = /etc/mailbox.sqlite
query = SELECT '%d/%u/' FROM mailbox WHERE username = '%u' AND domain = '%d'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment