migrating 2.1 to 3.x, sql pass scheme, pass value?

voytek at sbt.net.au voytek at sbt.net.au
Tue Aug 15 01:18:16 EEST 2017


I'm trying to migrate from Centos 6/dovecot 2.1.17/mysql to new server on
Centos 7/dovecot 2.2.31 (65cde28)/mariadb

I've dumped on oldserver 'dovecot.conf' and used it on newserver
doveconf -n > dovecot.conf
also, transferred /etc/doveconf/*.conf

I've also dumped MySQL 'vmail' and imported database, created user vmail,
vmailadmin

dumb question: should the password hash from oldserver work 'as is' on
newserver..? (different machine, different SQL..)

I've tried 'as is', then, attepmted to change both "default_pass_scheme"
and 'password=' values, but, no luck

postfixadmin works, I can login and see domains/mailboxes

what default_pass_scheme should I use ?
where/how do I take password= value ?

when I attempt to login to pop, I see this:

# doveadm stop
# dovecot
# telnet 127.0.0.1 110
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
+OK Dovecot ready.
USER voytek at sbt.net.au
+OK
PASS mypass
-ERR [SYS/TEMP] Temporary authentication failure. [voytek-web01:2017-08-14
22:06:33]
-ERR Unknown command.
-ERR Disconnected for inactivity.
Connection closed by foreign host.

log has:

Aug 15 08:04:33 master: Warning: Killed with signal 15 (by pid=9743 uid=0
code=kill)
Aug 15 08:04:44 master: Info: Dovecot v2.2.31 (65cde28) starting up for
pop3, imap, sieve (core dumps disabled)
Aug 15 08:05:31 auth-worker(9763): Error: mysql(127.0.0.1): Connect failed
to database (vmail): Access denied for user 'vmail'@'localhost' (using
password: YES) - waiting for 1 seconds before retry
Aug 15 08:05:31 auth-worker(9763): Error: mysql(127.0.0.1): Connect failed
to database (vmail): Access denied for user 'vmail'@'localhost' (using
password: YES) - waiting for 1 seconds before retry
//6 more repeats//
Aug 15 08:06:31 auth: Error: auth worker: Aborted PASSV request for
voytek at sbt.net.au: Lookup timed out
Aug 15 08:06:31 auth-worker(9763): Error:
sql(voytek at sbt.net.au,127.0.0.1,<9/h93L1WqLt/AAAB>): Password query
failed: Not connected to database
Aug 15 08:06:31 auth-worker(9763): Warning: Auth master disconnected us
while handling request for voytek at sbt.net.au for 60 secs (result=FAIL)
Aug 15 08:06:31 auth-worker(9780): Error: mysql(127.0.0.1): Connect failed
to database (vmail): Access denied for user 'vmail'@'localhost' (using
password: YES) - waiting for 1 seconds before retry
Aug 15 08:06:32 auth-worker(9780): Error: mysql(127.0.0.1): Connect failed
to database (vmail): Access denied for user 'vmail'@'localhost' (using
password: YES) - waiting for 5 seconds before retry
//2 more repeats//

oldserver & newserver

# cat dovecot-mysql.conf
driver = mysql
default_pass_scheme = CRYPT
connect = host=127.0.0.1 dbname=vmail user=vmail
password=etXwz...trimmmed...........
# Required by 'doveadm mailbox ...'.
iterate_query = SELECT username AS user FROM mailbox
password_query = SELECT password FROM mailbox WHERE username='%u' AND
active='1'
user_query = SELECT \
    '%u' AS master_user, \
    CONCAT(mailbox.storagebasedirectory, '/', mailbox.storagenode, '/',
mailbox.maildir) AS home, \
    CONCAT('*:bytes=', mailbox.quota*1048576) AS quota_rule \
FROM mailbox,domain \
WHERE mailbox.username='%u' \
    AND mailbox.domain='%d' \
    AND mailbox.`enable%Ls%Lc`=1 \
    AND mailbox.domain=domain.domain \
    AND domain.backupmx=0 \
    AND domain.active=1 \
    AND mailbox.active=1
#

newserver
# cat dovecot.conf

# 2.1.17: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.32-642.15.1.el6.x86_64 x86_64 CentOS release 6.8 (Final)
auth_master_user_separator = *
auth_mechanisms = PLAIN LOGIN
dict {
  acl = mysql:/etc/dovecot/dovecot-share-folder.conf
  quotadict = mysql:/etc/dovecot/dovecot-used-quota.conf
}
first_valid_uid = 2000
last_valid_uid = 2000
listen = *
log_path = /var/log/dovecot.log
mail_gid = 2000
mail_location = maildir:/%Lh/Maildir/:INDEX=/%Lh/Maildir/
mail_plugins = quota mail_log notify
mail_uid = 2000
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope encoded-character
vacation subaddress comparator-i;ascii-numeric relational regex imap4flags
copy include variables body enotify environment mailbox date ihave
namespace {
  inbox = yes
  location =
  prefix =
  separator = /
  type = private
}
namespace {
  list = children
  location = maildir:/%%Lh/Maildir/:INDEX=/%%Lh/Maildir/Shared/%%u
  prefix = Shared/%%u/
  separator = /
  subscriptions = yes
  type = shared
}
passdb {
  args = /etc/dovecot/dovecot-mysql.conf
  driver = sql
}
passdb {
  args = /etc/dovecot/dovecot-master-users-password
  driver = passwd-file
  master = yes
}
plugin {
  acl = vfile
  acl_shared_dict = proxy::acl
  auth_socket_path = /var/run/dovecot/auth-master
  autocreate = INBOX
  autocreate2 = Sent
  autocreate3 = Trash
  autocreate4 = Drafts
  autocreate5 = Junk
  autosubscribe = INBOX
  autosubscribe2 = Sent
  autosubscribe3 = Trash
  autosubscribe4 = Drafts
  autosubscribe5 = Junk
  mail_log_events = delete undelete expunge copy mailbox_delete
mailbox_rename
  mail_log_fields = uid box msgid size
  quota = dict:user::proxy::quotadict
  quota_rule = *:storage=1G
  quota_warning = storage=85%% quota-warning 85 %u
  quota_warning2 = storage=90%% quota-warning 90 %u
  quota_warning3 = storage=95%% quota-warning 95 %u
  sieve = /%Lh/sieve/dovecot.sieve
  sieve_dir = /%Lh/sieve
  sieve_global_dir = /var/vmail/sieve
  sieve_global_path = /var/vmail/sieve/dovecot.sieve
}
protocols = pop3 imap sieve
service auth {
  unix_listener /var/spool/postfix/dovecot-auth {
    group = postfix
    mode = 0666
    user = postfix
  }
  unix_listener auth-master {
    group = vmail
    mode = 0666
    user = vmail
  }
  unix_listener auth-userdb {
    group = vmail
    mode = 0660
    user = vmail
  }
}
service dict {
  unix_listener dict {
    group = vmail
    mode = 0660
    user = vmail
  }
}
service imap-login {
  process_limit = 500
  service_count = 1
}
service pop3-login {
  service_count = 1
}
service quota-warning {
  executable = script /usr/local/bin/dovecot-quota-warning.sh
  unix_listener quota-warning {
    group = vmail
    mode = 0660
    user = vmail
  }
}
ssl = required
ssl_cert = </etc/pki/dovecot/certs/dovecot.pem
ssl_key = </etc/pki/dovecot/private/dovecot.pem
userdb {
  args = /etc/dovecot/dovecot-mysql.conf
  driver = sql
}

protocol lda {
  auth_socket_path = /var/run/dovecot/auth-master
  lda_mailbox_autocreate = yes
  log_path = /var/log/sieve.log
  mail_plugins = quota sieve autocreate
  postmaster_address = root
}
protocol imap {
  imap_client_workarounds = tb-extra-mailbox-sep
  mail_max_userip_connections = 60
  mail_plugins = quota imap_quota autocreate
}
protocol pop3 {
  mail_plugins = quota
  pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
  pop3_uidl_format = %08Xu%08Xv
}




More information about the dovecot mailing list