simonpie

Q: dovecot replication not working

I am trying to setup Dovecot replication between two El Capitan servers.  I have tried to follow the instruction here and the newletter as much as I could.  But to no avail. 

 

I keep having the following errors :

Mar 14 20:50:42 auth: Error: od[getpwnam_ext](submit): No record for user

Mar 14 20:52:53 auth: Error: od[getpwnam_ext](submit,192.168.2.1): No record for user

for one server and for the second :

Mar 14 20:52:53 auth: Error: od[getpwnam_ext](submit): No record for user

Mar 14 20:52:53 dsync-local(submit): Error: Couldn't create lock /var/empty/.dovecot-sync.lock: Permission denied

 

Both server have essentially the same configuration as a diff on the output doveconf -n on each server will show :

 

 

 

diff /tmp/labanquedoveconf.txt /tmp/lapostedoveconf.txt

2a3

> auth_gssapi_hostname = $ALL

4c5

< auth_realms = labanque.mycompany.com

---

> auth_realms = laposte.mycompany.com

16a18

> imap_urlauth_submit_user = submit

22c24

< mail_location = maildir:/Library/Server/Mail/Data/mail/%u

---

> mail_location = maildir:/Volumes/tank/Library/Server/Mail/Data/mail/%u

75c77

<   mail_replica = tcp:laposte.mycompany.com

---

>   mail_replica = tcp:labanque.mycompany.com

84c86

< postmaster_address = postmaster@labanque.mycompany.com

---

> postmaster_address = postmaster@laposte.mycompany.com

197c199

< ssl_cipher_list = ALL:!LOW:!SSLv2:!EXP:!aNULL:!ADH:!eNULL

---

> ssl_cipher_list = ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM- SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GC M-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA -AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SH A384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-A ES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA -AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES1 28-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5 :!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA

199a202

> ssl_protocols = !SSLv2 !SSLv3

 

Any help would be appreciated as I do have one user and submit is not a user on my system.  I have found this newsletter, but I dont know what to do with it.

 

Here is the configuration for laposte :

 

# 2.2.5: /Library/Server/Mail/Config/dovecot/dovecot.conf

# OS: Darwin 15.3.0 x86_64  hfs

auth_gssapi_hostname = $ALL

auth_mechanisms = cram-md5 digest-md5 gssapi

auth_realms = laposte.mycompany.com

auth_socket_path = /var/run/dovecot/auth-userdb

auth_username_format = %n

debug_log_path = /Library/Logs/Mail/mail-debug.log

default_internal_user = _dovecot

default_login_user = _dovenull

doveadm_password = XXXXXXXXXXXX

doveadm_port = 12345

dsync_remote_cmd = ssh -l%{login} %{host} doveadm dsync-server -u%u

first_valid_gid = 6

first_valid_uid = 6

imap_id_log = *

imap_id_send = "name" * "version" *

imap_urlauth_submit_user = submit

info_log_path = /Library/Logs/Mail/mail-info.log

log_path = /Library/Logs/Mail/mail-err.log

login_log_format_elements = user=<%u> method=%m rip=%r lip=%l mpid=%e %c

mail_access_groups = mail

mail_attribute_dict = file:/Library/Server/Mail/Data/attributes/attributes.dict

mail_location = maildir:/Volumes/tank/Library/Server/Mail/Data/mail/%u

mail_log_prefix = "%s(pid %p user %u): "

mail_plugins = quota zlib acl fts fts_sk notify replication

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

mdbox_rotate_size = 200 M

namespace acl-mailboxes {

  list = children

  location = maildir:/Library/Server/Mail/Data/mail/users/%%u:INDEX=/Library/Server/Mail/Dat a/mail/shared/%%u

  prefix = shared.%%u.

  separator = .

  subscriptions = no

  type = shared

}

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 =

}

namespace list-archives {

  list = children

  location = maildir:/Library/Server/Mail/Data/listserver/messages/archive/lists/%%u:INDEX=/ Library/Server/Mail/Data/listserver/messages/archive/shared/%%u

  prefix = archives.%%u.

  separator = .

  subscriptions = no

  type = shared

}

passdb {

  driver = od

}

passdb {

  args = /Library/Server/Mail/Config/dovecot/submit.passdb

  driver = passwd-file

}

plugin {

  acl = vfile:/Library/Server/Mail/Config/dovecot/global-acls:cache_secs=300

  acl_shared_dict = file:/Library/Server/Mail/Data/shared/shared-mailboxes

  fts = sk

  mail_replica = tcp:labanque.mycompany.com

  quota = maildir:User quota

  quota_warning = storage=100%% quota-exceeded %u

  quota_warning2 = storage=80%% quota-warning %u

  sieve = /Library/Server/Mail/Data/rules/%u/dovecot.sieve

  sieve_dir = /Library/Server/Mail/Data/rules/%u

  stats_refresh = 30 secs

  stats_track_cmds = yes

}

postmaster_address = postmaster@laposte.mycompany.com

protocols = imap lmtp sieve pop3

quota_full_tempfail = yes

service aggregator {

  fifo_listener replication-notify-fifo {

    user = _dovecot

  }

  unix_listener replication-notify {

    user = _dovecot

  }

}

service auth-worker {

  extra_groups = _keytabusers

  unix_listener auth-worker {

    mode = 0600

    user = _dovecot

  }

  user = _dovecot

}

service auth {

  extra_groups = _keytabusers

  idle_kill = 15 mins

  unix_listener auth-userdb {

    mode = 0777

    user = _dovecot

  }

}

service dns_client {

  unix_listener dns-client {

    mode = 0600

  }

}

service doveadm {

  inet_listener {

    port = 12345

  }

  user = _dovecot

}

service imap-login {

  inet_listener imap {

    port = 143

  }

  inet_listener imaps {

    port = 993

    ssl = yes

  }

  service_count = 0

}

service imap {

  client_limit = 5

  process_limit = 200

  service_count = 0

}

service indexer-worker {

  user = _dovecot

}

service lmtp {

  unix_listener lmtp {

    mode = 0600

  }

}

service managesieve-login {

  inet_listener sieve {

    port = 4190

  }

}

service pop3-login {

  inet_listener pop3 {

    port = 110

  }

  inet_listener pop3s {

    port = 995

    ssl = yes

  }

}

service pop3 {

  client_limit = 5

  process_limit = 200

  service_count = 0

}

service quota-exceeded {

  executable = script /Applications/Server.app/Contents/ServerRoot/usr/libexec/dovecot/quota-exceeded .sh

  unix_listener quota-exceeded {

    group = mail

    mode = 0660

    user = _dovecot

  }

  user = _dovecot

}

service quota-warning {

  executable = script /Applications/Server.app/Contents/ServerRoot/usr/libexec/dovecot/quota-warning. sh

  unix_listener quota-warning {

    group = mail

    mode = 0660

    user = _dovecot

  }

  user = _dovecot

}

service replicator {

  process_min_avail = 1

  unix_listener replicator-doveadm {

    mode = 0600

  }

}

service stats {

  fifo_listener stats-mail {

    mode = 0600

    user = _dovecot

  }

}

ssl = required

ssl_ca = </etc/certificates/labanque.mycompany.com.423929C9712FE705D69805A43769B318C7D3C BB3.chain.pem

ssl_cert = </etc/certificates/labanque.mycompany.com.423929C9712FE705D69805A43769B318C7D3C BB3.cert.pem

ssl_cipher_list = ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM- SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GC M-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA -AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SH A384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-A ES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA -AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES1 28-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5 :!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA

ssl_key = </etc/certificates/labanque.mycompany.com.423929C9712FE705D69805A43769B318C7D3C BB3.key.pem

ssl_key_path = /etc/certificates/labanque.mycompany.com.423929C9712FE705D69805A43769B318C7D3CB B3.key.pem

ssl_protocols = !SSLv2 !SSLv3

userdb {

  args = partition=/Library/Server/Mail/Config/dovecot/partition_map.conf global_quota=5000 enforce_quotas=yes

  driver = od

}

userdb {

  args = /Library/Server/Mail/Config/dovecot/submit.passdb

  driver = passwd-file

}

verbose_proctitle = yes

protocol lmtp {

  mail_plugins = quota zlib acl fts fts_sk sieve

}

protocol lda {

  mail_plugins = quota zlib acl fts fts_sk sieve

}

protocol imap {

  mail_max_userip_connections = 20

  mail_plugins = quota zlib acl fts fts_sk imap_acl imap_quota imap_zlib

}

protocol pop3 {

  mail_max_userip_connections = 6

}

Mac Pro, OS X El Capitan (10.11.3), Server

Posted on Mar 14, 2016 6:03 PM

Close

Q: dovecot replication not working

  • All replies
  • Helpful answers

  • by simonpie,

    simonpie simonpie Apr 6, 2016 5:37 PM in response to simonpie
    Level 1 (38 points)
    Servers Enterprise
    Apr 6, 2016 5:37 PM in response to simonpie

    Here is an update that I hope will be useful to someone.  I am fairly convinced that replication does not work on El Capitan.  So instead, I went with doveadm sync.  Here's the script that I used :

     

    #!/bin/bash

     

    userlist=$(dscl /LDAPv3/127.0.0.1 -read /Groups/messagerie GroupMembership | cut -d ' ' -f 2- - | tr  ' ' '\n')

    for user in $userlist ; do

      state=$(cat "/Users/_dovecot/.bin/syncStates/syncstate$user" )

      doveadm  sync -u $user  -s $state tcp:secondServer.com > "/Users/_dovecot/.bin/syncStates/syncstate$user"

    done

     

    I kept all the modifications to dovecot mentioned above.  The problem with replicaiton hinges on the fact that querying the OD driver hangs and will not return a user list.  Instead I resorted in querying OD by myself as all my users having access to email belong to one group called "messagerie" on my system.