LN-PostfixAdmin _sqlite
PostfixAdmin sqlite
# postconf -m インストール済みのモジュールの確認 . . . . . . sqlite . .
virtual_mailbox_domains
/etc/postfix/sqlite_virtual_domains_maps.cf の作成 dbpath = /srv/postfixadmin/database/postfixadmin.db query = SELECT domain FROM domain WHERE domain = '%s' AND active = '1'
virtual_mailbox_maps
/etc/postfix/sqlite_virtual_mailbox_maps.cf の作成
dbpath = /srv/postfixadmin/database/postfixadmin.db
query = SELECT maildir FROM mailbox WHERE username = '%s' AND active = '1'
/etc/postfix/sqlite_virtual_alias_domain_mailbox_maps.cf の作成
dbpath = /srv/postfixadmin/database/postfixadmin.db
query = SELECT maildir FROM mailbox, alias_domain WHERE alias_domain.alias_domain = '%d' and mailbox.username = printf('%u', '@', alias_domain.target_domain) AND mailbox.active = '1' AND alias_domain.active = '1'
virtual_alias_maps
/etc/postfix/sqlite_virtual_alias_maps.cf の作 成
dbpath = /srv/postfixadmin/database/postfixadmin.db
query = SELECT goto FROM alias WHERE address = '%s' AND active = '1'
/etc/postfix/sqlite_virtual_alias_domain_maps.cf の作成
dbpath = /srv/postfixadmin/database/postfixadmin.db
query = SELECT goto FROM alias, alias_domain WHERE alias_domain.alias_domain = '%d' and alias.address = printf('%u', '@', alias_domain.target_domain) AND alias.active = '1' AND alias_domain.active = '1'
/etc/postfix/sqlite_virtual_alias_domain_catchall_maps.cf の作成
dbpath = /srv/postfixadmin/database/postfixadmin.db
query = SELECT goto FROM alias,alias_domain WHERE alias_domain.alias_domain = '%d' and alias.address = printf('@', alias_domain.target_domain) AND alias.active = '1' AND alias_domain.active = '1'
main.cf
/etc/postfix/main.cf の編集 virtual_mailbox_domains = sqlite:/etc/postfix/sqlite_virtual_domains_maps.cf virtual_mailbox_maps = sqlite:/etc/postfix/sqlite_virtual_mailbox_maps.cf, sqlite:/etc/postfix/sqlite_virtual_alias_domain_mailbox_maps.cf virtual_alias_maps = sqlite:/etc/postfix/sqlite_virtual_alias_maps.cf, sqlite:/etc/postfix/sqlite_virtual_alias_domain_maps.cf, sqlite:/etc/postfix/sqlite_virtual_alias_domain_catchall_maps.cf mydestination = $myhostname,localhost.$mydomain,localhost
CHECK MailBOX
#ls /var/vmail make_your_domain #ls /var/vmail/make_your_domain user01
DOVECOT
/etc/dovecot/conf.d/10-mail.conf の編集
mail_location = maildir:/var/vmail/%d/%n mail_uid = vmail mail_gid = mail mail_privileged_group = mail first_valid_uid = 974 last_valid_uid = 974
/etc/dovecot/conf.d/10-master.conf の編集
service auth {
# Postfix smtp-auth
unix_listener /var/spool/postfix/private/auth {
mode = 0666
user = postfix
group = postfix
}
}
/etc/dovecot/conf.d/10-auth.conf の編集
#!include auth-system.conf.ext #コメントアウト !include auth-sql.conf.ext #コメントイン
/etc/dovecot/conf.d/auth-sql.conf.extの中身
passdb {
driver = sql
args = /etc/dovecot/dovecot-sql.conf.ext
}
userdb {
driver = sql
args = /etc/dovecot/dovecot-sql.conf.ext
}
/etc/dovecot/dovecot-sql.conf.ext の作成
driver = sqlite
connect = /srv/postfixadmin/database/postfixadmin.db
password_query = \
SELECT \
username as user, \
password, \
'/var/vmail/%d/%n' as userdb_home, \
'maldir:/var/vmail/%d/%n' as userdb_mail \
FROM \
mailbox \
WHERE username = '%u' AND active = '1'
user_query = \
SELECT \
'/var/vmail/%d/%n' as home, \
'maildir:/var/vmail/%d/%n' as mail \
FROM \
mailbox \
WHERE username = '%u' AND active = '1'