Здравствуйте! Почему-то переменная %d в Dovecot пуста, почтовый сервер работает в связке Postfix + Dovecot + MySQL
Пытаюсь авторизоваться по IMAP через Mozilla Thunderbird, выяснилось, что авторизация не работает, так как в запросе передается только имя пользователя ,при попытке авторизации с email test@example.com запрос выглядит так:
SELECT email as user, password FROM mailbox WHERE email='test';
Сам шаблон:
SELECT email as user, password FROM virtual_users WHERE email='%u';
postconf -n
root@mail:~# postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
inet_interfaces = all
inet_protocols = all
mailbox_command =
mailbox_size_limit = 0
milter_default_action = accept
milter_mail_macros = i {mail_addr} {client_addr} {client_name} {auth_authen}
milter_protocol = 6
mydestination = yubex.ru, localhost.netangels.ru, localhost
mydomain = yubex.ru
myhostname = yubex.ru
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = $mydomain
queue_directory = /var/spool/postfix
readme_directory = no
recipient_delimiter = +
relayhost =
smtp_tls_note_starttls_offer = yes
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtp_use_tls = yes
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_path = private/auth
smtpd_sasl_type = dovecot
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = /etc/letsencrypt/live/yubex.ru/fullchain.pem
smtpd_tls_key_file = /etc/letsencrypt/live/yubex.ru/privkey.pem
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual-alias-maps.cf
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
doveconf -n
root@mail:~# doveconf -n
# 2.2.22 (fe789d2): /etc/dovecot/dovecot.conf
# Pigeonhole version 0.4.13 (7b14904)
# OS: Linux 4.4.0-45-generic x86_64 Ubuntu 16.04.2 LTS
auth_debug = yes
debug_log_path = /var/log/dovecot.log
listen = *
login_greeting = My site mail server
mail_access_groups = mail
mail_debug = yes
mail_location = maildir:/var/mail/vhosts/%d/%n
mail_privileged_group = mail
namespace inbox {
inbox = yes
location =
mailbox Drafts {
special_use = \Drafts
}
mailbox Junk {
special_use = \Junk
}
mailbox Sent {
special_use = \Sent
}
mailbox "Sent Messages" {
special_use = \Sent
}
mailbox Trash {
special_use = \Trash
}
prefix =
}
passdb {
args = /etc/dovecot/dovecot-sql.conf.ext
driver = sql
}
plugin {
sieve = ~/.dovecot.sieve
sieve_dir = ~/sieve
}
protocols = " imap pop3"
service auth {
unix_listener /var/spool/postfix/private/auth {
group = postfix
mode = 0666
user = postfix
}
unix_listener auth-userdb {
mode = 0600
user = vmail
}
}
ssl_cert = /dovecot/private/fullchain.pem
ssl_key = /dovecot/private/privkey.pem
userdb {
args = uid=vmail gid=vmail home=/var/mail/vhosts/%d/%n
driver = static
}
verbose_ssl = yes
protocol pop3 {
pop3_uidl_format = %08Xu%08Xv
}
UPD:
проблема в Mozila Thunderbird, успешно авторизовался через openssl s_client