Hi, I'm a Dovecot newb playing with version 1.1.3 port under FreeBSD. After setting up dovecot-sql.conf for MySQL I can't check mail via POP3:
...
password_query =
SELECT CONCAT(username, '@', d.name) AS user, password
FROM users u JOIN domains d ON u.domain_id=d.id
WHERE username='%n' AND d.name='%d' AND active
(with or without \ line breaks - same thing)
rihad@rihad:~$ telnet nigar pop3 Trying 192.168.0.248... Connected to nigar.localnet. Escape character is '^]'. +OK Dovecot ready. user rihad@bar.com +OK pass 123456 -ERR Authentication failed. quit +OK Logging out Connection closed by foreign host.
MySQL query log shows: 080919 21:19:51 4 Query SELECT CONCAT(username, '@', d.name) AS user, password FROM users u JOIN domains d ON u.domain_id=d.id WHERE username='rihad' AND d.name='' AND active
Further investigation revealed that %u is just rihad and not rihad@bar.com.
Any hints?
TIA.
On Sat, 2008-09-20 at 13:44 +0500, rihad wrote:
user rihad@bar.com .. Further investigation revealed that %u is just rihad and not rihad@bar.com.
Any hints?
You're dropping the domain somewhere. Maybe in auth_username_format? If you can't fix it, send your dovecot -n output.
Timo Sirainen wrote:
On Sat, 2008-09-20 at 13:44 +0500, rihad wrote:
user rihad@bar.com .. Further investigation revealed that %u is just rihad and not rihad@bar.com.
Any hints?
You're dropping the domain somewhere. Maybe in auth_username_format? If you can't fix it, send your dovecot -n output.
I didn't change much. Here's my dovecot -n:
# 1.1.3: /usr/local/etc/dovecot.conf
protocols: imap imaps pop3 pop3s
ssl_disable: yes
disable_plaintext_auth: no
login_dir: /var/run/dovecot/login
login_executable(default): /usr/local/libexec/dovecot/imap-login
login_executable(imap): /usr/local/libexec/dovecot/imap-login
login_executable(pop3): /usr/local/libexec/dovecot/pop3-login
login_greeting_capability(default): yes
login_greeting_capability(imap): yes
login_greeting_capability(pop3): no
verbose_proctitle: yes
first_valid_uid: 1000
first_valid_gid: 1000
mail_privileged_group: mail
mail_location: mbox:~/mail/:INBOX=/var/mail/%u
maildir_copy_preserve_filename: yes
mail_executable(default): /usr/local/libexec/dovecot/imap
mail_executable(imap): /usr/local/libexec/dovecot/imap
mail_executable(pop3): /usr/local/libexec/dovecot/pop3
mail_plugin_dir(default): /usr/local/lib/dovecot/imap
mail_plugin_dir(imap): /usr/local/lib/dovecot/imap
mail_plugin_dir(pop3): /usr/local/lib/dovecot/pop3
imap_client_workarounds(default): delay-newmail netscape-eoh
tb-extra-mailbox-sep
imap_client_workarounds(imap): delay-newmail netscape-eoh
tb-extra-mailbox-sep
imap_client_workarounds(pop3):
pop3_enable_last(default): no
pop3_enable_last(imap): no
pop3_enable_last(pop3): yes
pop3_client_workarounds(default):
pop3_client_workarounds(imap):
pop3_client_workarounds(pop3): outlook-no-nuls oe-ns-eoh
auth default:
mechanisms: plain login
username_format: %Ln
passdb:
driver: sql
args: /usr/local/etc/dovecot-sql.conf
userdb:
driver: passwd
userdb:
driver: static
args: uid=postfix gid=postfix home=/home/rihad/mail/%d/%n
socket:
type: listen
client:
path: /var/spool/postfix/private/auth
mode: 432
user: postfix
group: postfix
Here's my diff -u /usr/local/share/examples/dovecot/dovecot.conf
/usr/local/etc/dovecot.conf:
Basically I turned off ssl, pam, ldap, and turned on static & sql.
--- /usr/local/share/examples/dovecot/dovecot.conf 2008-09-19
16:47:55.000000000 +0500
+++ /usr/local/etc/dovecot.conf 2008-09-22 23:14:34.000000000 +0500
@@ -85,6 +85,7 @@
# Disable SSL/TLS support.
#ssl_disable = no
+ssl_disable = yes
# PEM encoded X.509 SSL/TLS certificate and private key. They're
opened before
# dropping root privileges, so keep the key file unreadable by anyone but
@@ -825,7 +826,7 @@
# database (passwd usually), you can use static userdb.
# REMEMBER: You'll need /etc/pam.d/dovecot file created for PAM
# authentication to actually work.
Timo Sirainen wrote:
On Mon, 2008-09-22 at 23:17 +0500, rihad wrote:
auth default: username_format: %Ln
Why did you set this? You're the second person already having this problem recently. Is there some HOWTO or something recommending to do this?
Use %Lu instead.
It ain't me, it's stock FreeBSD's Port /usr/local/share/examples/dovecot/dovecot.conf that does this, or better yet, /usr/ports/mail/dovecot/files/patch-dovecot-example.conf:
-#auth_username_format = +auth_username_format = %Ln
Nevertheless, thanks for helping newbies. I'll try your suggested fix :)
participants (2)
-
rihad
-
Timo Sirainen