On Sun, 2025-02-16 at 09:30 +0200, Timo Sirainen wrote:
> On 16. Feb 2025, at 6.33, Ken Wright via dovecot
> <dovecot@dovecot.org> wrote:
> > 
> > On Sat, 2025-02-15 at 18:31 -0500, Doug via dovecot wrote:
> > > " Access denied for user.. 'dovecot'@'localhost' " 
> > > 
> > > Is a mysql error. mysql isn't allowing the user dovecot to open
> > > the
> > > database to run your SQL query.  Until you can open the database,
> > > you
> > > aren't even retrieving the account password. That is where you
> > > should
> > > concentrate your efforts. I don't use mysql for authentication so
> > > I
> > > can't really tell you how to configure dovecot or mysql to make
> > > it
> > > work.
> > 
> > This makes sense.  What doesn't make sense (to me at least) is why
> > Dovecot is trying to connect using the user 'dovecot' when I
> > specified
> > a different user in dovecot.conf.  (Forgive me for not disclosing
> > the
> > actual user name.)  Is there a setting for mysql user I need to
> > correct?  What is the correct syntax, anyway?
> 
> Maybe you're missing all the mysql settings?
> 
> mysql localhost {
>   user = something
>   password = something-else
> }
Here are my sql settings:
mysql localhost {
  user = something
  password = MYPASSWORD
  dbname = something
}
mail_uid = vmail
mail_gid = vmail
mail_driver = maildir
mail_path = /var/vmail/%{user | domain }/%{user | username }/Maildir
mail_inbox_path = /var/vmail/%{user | domain}/%{user | username }
mailbox_list_utf8 = yes

passdb_default_password_scheme = ARGON2I

passdb sql {
query = SELECT username AS username, domain, password FROM mailbox
WHERE username = '%{user | username}' AND domain = '%{user | domain}'
AND active= '1'
}
userdb sql {
query = SELECT mail_path, uid, gid FROM mailbox WHERE username =
'%{user | username}' AND domain = '%{user | domain}' AND active= '1'
# For using doveadm -A:
iterate_query = SELECT username AS username, domain FROM mailbox
}

According to the logs, Dovecot isn't trying to connect using the user
something, it's using the user dovecot.  That's not the user for the
database.

Ken
_______________________________________________
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org

Reply via email to