Dovecot passdb and postfix login
Laura Smith
n5d9xq3ti233xiyif2vp at protonmail.ch
Fri May 22 20:18:56 EEST 2020
Hi,
Long story short I've got a fully functional Dovecot IMAP instance and I am now looking to upgrade some perimiter authenticated SMTP relays to authenticate against the Dovecot instance.
Trouble is that I am seeing errors such as "auth: Warning: sql: Ignoring changed user_query in /etc/dovecot/local_sql_users.conf, because userdb sql not used." in my Postfix server logs and not able to successfully authenticate via AUTH LOGIN on the Postfi instance.
Perhaps I'm missing something obvious from my config ? Here is the doveconf -n from the Postfix server in question:
# 2.3.10.1 (a3d0e1171): /etc/dovecot/dovecot.conf
# OS: Linux 4.19.0-9-amd64 x86_64 Debian 10.4
# Hostname: foobar.example.com
auth_mechanisms = plain login
auth_verbose = yes
auth_verbose_passwords = sha1:7
disable_plaintext_auth = no
mail_location = mbox:~/mail:INBOX=/var/mail/%u
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/local_sql_users.conf
driver = sql
}
service auth {
inet_listener {
address = 127.0.0.1
port = 7425
}
inet_listener {
address = ::1
port = 7425
}
unix_listener /var/spool/postfix-authrelay/private/dovecot-auth {
group = postfix
mode = 0660
user = postfix
}
}
ssl = no
The local_sql_users.conf is the same one that's used on the functioning IMAP servers, just copied accross to the authenticated relay server:
$ sudo cat /etc/dovecot/local_sql_users.conf
driver = pgsql
connect = host=foo dbname=bar user=secret password=squirrel
default_pass_scheme = ARGON2ID
password_query = select dovecot_username as user,password from get_user('%u')
user_query = select 'vmail' as uid, 'vmail' as gid
iterate_query = select dovecot_username as user from get_users()
More information about the dovecot
mailing list