Dovecot Systax Problem
parent
bbbb9480f7
commit
0dde4e616d
|
|
@ -85,7 +85,11 @@ dbname = ${DB_NAME}
|
||||||
query = SELECT 1
|
query = SELECT 1
|
||||||
FROM mail_users u
|
FROM mail_users u
|
||||||
JOIN domains d ON d.id = u.domain_id
|
JOIN domains d ON d.id = u.domain_id
|
||||||
WHERE u.email = '%s' AND u.is_active = 1 AND d.is_active = 1
|
WHERE u.email = '%s'
|
||||||
|
AND u.is_active = 1
|
||||||
|
AND u.can_login = 1
|
||||||
|
AND u.password_hash IS NOT NULL
|
||||||
|
AND d.is_active = 1
|
||||||
LIMIT 1;
|
LIMIT 1;
|
||||||
CONF
|
CONF
|
||||||
chown root:postfix /etc/postfix/sql/mysql-virtual-mailbox-maps.cf
|
chown root:postfix /etc/postfix/sql/mysql-virtual-mailbox-maps.cf
|
||||||
|
|
@ -97,11 +101,18 @@ hosts = 127.0.0.1
|
||||||
user = ${DB_USER}
|
user = ${DB_USER}
|
||||||
password = ${DB_PASS}
|
password = ${DB_PASS}
|
||||||
dbname = ${DB_NAME}
|
dbname = ${DB_NAME}
|
||||||
query = SELECT destination
|
|
||||||
FROM mail_aliases a
|
query = SELECT COALESCE(mu.email, r.email) AS destination
|
||||||
JOIN domains d ON d.id = a.domain_id
|
FROM mail_aliases a
|
||||||
WHERE a.source = '%s' AND a.is_active = 1 AND d.is_active = 1
|
JOIN domains d ON d.id = a.domain_id
|
||||||
LIMIT 1;
|
JOIN mail_alias_recipients r ON r.alias_id = a.id
|
||||||
|
LEFT JOIN mail_users mu ON mu.id = r.mail_user_id
|
||||||
|
WHERE d.domain = SUBSTRING_INDEX('%s','@',-1)
|
||||||
|
AND a.local = SUBSTRING_INDEX('%s','@', 1)
|
||||||
|
AND a.is_active = 1
|
||||||
|
AND d.is_active = 1
|
||||||
|
AND (mu.email IS NOT NULL OR r.email IS NOT NULL)
|
||||||
|
ORDER BY r.position ASC;
|
||||||
CONF
|
CONF
|
||||||
chown root:postfix /etc/postfix/sql/mysql-virtual-alias-maps.cf
|
chown root:postfix /etc/postfix/sql/mysql-virtual-alias-maps.cf
|
||||||
chmod 640 /etc/postfix/sql/mysql-virtual-alias-maps.cf
|
chmod 640 /etc/postfix/sql/mysql-virtual-alias-maps.cf
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,36 @@ first_valid_uid = ${VMAIL_UID}
|
||||||
last_valid_uid = ${VMAIL_UID}
|
last_valid_uid = ${VMAIL_UID}
|
||||||
CONF
|
CONF
|
||||||
|
|
||||||
|
# Standard-Mailboxen automatisch erstellen/abonnieren
|
||||||
|
cat > /etc/dovecot/conf.d/15-mailboxes.conf <<'CONF'
|
||||||
|
namespace inbox {
|
||||||
|
inbox = yes
|
||||||
|
|
||||||
|
mailbox Drafts {
|
||||||
|
special_use = \Drafts
|
||||||
|
auto = subscribe
|
||||||
|
}
|
||||||
|
mailbox Junk {
|
||||||
|
special_use = \Junk
|
||||||
|
auto = subscribe
|
||||||
|
}
|
||||||
|
mailbox Trash {
|
||||||
|
special_use = \Trash
|
||||||
|
auto = subscribe
|
||||||
|
}
|
||||||
|
mailbox Sent {
|
||||||
|
special_use = \Sent
|
||||||
|
auto = subscribe
|
||||||
|
}
|
||||||
|
|
||||||
|
# optional: Archive
|
||||||
|
mailbox Archive {
|
||||||
|
special_use = \Archive
|
||||||
|
auto = create
|
||||||
|
}
|
||||||
|
}
|
||||||
|
CONF
|
||||||
|
|
||||||
# Auth
|
# Auth
|
||||||
cat > /etc/dovecot/conf.d/10-auth.conf <<'CONF'
|
cat > /etc/dovecot/conf.d/10-auth.conf <<'CONF'
|
||||||
disable_plaintext_auth = yes
|
disable_plaintext_auth = yes
|
||||||
|
|
@ -67,9 +97,14 @@ cat > /etc/dovecot/dovecot-sql.conf.ext <<CONF
|
||||||
driver = mysql
|
driver = mysql
|
||||||
connect = host=127.0.0.1 dbname=${DB_NAME} user=${DB_USER} password=${DB_PASS}
|
connect = host=127.0.0.1 dbname=${DB_NAME} user=${DB_USER} password=${DB_PASS}
|
||||||
default_pass_scheme = BLF-CRYPT
|
default_pass_scheme = BLF-CRYPT
|
||||||
password_query = SELECT email AS user, password_hash AS password
|
password_query = SELECT u.email AS user, u.password_hash AS password
|
||||||
FROM mail_users
|
FROM mail_users u
|
||||||
WHERE email = '%u' AND is_active = 1
|
JOIN domains d ON d.id = u.domain_id
|
||||||
|
WHERE u.email = '%u'
|
||||||
|
AND u.is_active = 1
|
||||||
|
AND u.can_login = 1
|
||||||
|
AND u.password_hash IS NOT NULL
|
||||||
|
AND d.is_active = 1
|
||||||
LIMIT 1;
|
LIMIT 1;
|
||||||
CONF
|
CONF
|
||||||
chown root:dovecot /etc/dovecot/dovecot-sql.conf.ext
|
chown root:dovecot /etc/dovecot/dovecot-sql.conf.ext
|
||||||
|
|
@ -89,7 +124,7 @@ CONF
|
||||||
chown root:dovecot /etc/dovecot/conf.d/auth-sql.conf.ext
|
chown root:dovecot /etc/dovecot/conf.d/auth-sql.conf.ext
|
||||||
chmod 640 /etc/dovecot/conf.d/auth-sql.conf.ext
|
chmod 640 /etc/dovecot/conf.d/auth-sql.conf.ext
|
||||||
|
|
||||||
# Master-Services (LMTP + AUTH + IMAP/POP3 Listener )
|
# Master-Services (LMTP + AUTH + IMAP/POP3 Listener v)
|
||||||
cat > /etc/dovecot/conf.d/10-master.conf <<'CONF'
|
cat > /etc/dovecot/conf.d/10-master.conf <<'CONF'
|
||||||
service lmtp {
|
service lmtp {
|
||||||
unix_listener /var/spool/postfix/private/dovecot-lmtp {
|
unix_listener /var/spool/postfix/private/dovecot-lmtp {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue