User Tools

Site Tools



Solving "Error: mkdir/chown(.../.imap/INBOX, group=8(mail)) failed"

According to the problem is solved by removing the write persmissions to the group on /var/spool/mail/username.



Note: The locally running replicator allways pushes the local changes to the far side (provided it is running without the -R flag)

doveadm replicator status <username pattern>

<username pattern> is something like *,, u* or just *


doveadm replicator status '*' | fgrep ' y'

to find failing mailboxes.

Times shown are the time passed since last fast/full sync.

doveadm replicator dsync-status

Accepts a username pattern as well, but works without it.

doveadm replicator replicate -f <username pattern>

triggers a new full sync. (Needs to be called twice sometimes?)

doveadm force-resync is not related to replication!



Sometimes, root cause of replication troubles seem to be duplicated emails. Those might be cleaned up in mailboxes INBOX and Spam for account by
while doveadm deduplicate -u mailbox INBOX OR mailbox Spam
  fgrep -c Message-ID:
  echo "++++ `date` +++++"

This will run forever ans should be stopped when numbers do not change any more.


This solution is for nagios-like monitoring systems

This needs a sudo entry to allow nagios running doveadm as dovecot
  #! /bin/sh
  # LANG=C doveadm replicator status|fgrep "'failed'"
  repl_n_wait_fail="`LANG=C sudo -u dovecot doveadm replicator status|sed -ne \"s/^Waiting 'failed' requests *\([0-9]\+\) *$/\1/pg\"`"
  # LANG=C doveadm replicator status|fgrep "'failed'"
  # echo "\"$repl_n_wait_fail\""
  case "$repl_n_wait_fail" in
  "0") echo "OK: doveadm replicator status: Waiting 'failed' requests $repl_n_wait_fail"
       exit 0 ;;
  "1") echo "WARN: doveadm replicator status: Waiting 'failed' requests $repl_n_wait_fail"
       exit 1 ;;
  *)   if [ "$repl_n_wait_fail" -gt 1 ]
          echo "CRIT: doveadm replicator status: Waiting 'failed' requests $repl_n_wait_fail"
          exit 2
       fi ;;
  echo "UNKNOWN: Strange value in doveadm replicator status for  waiting 'failed' requests: $repl_n_wait_fail"
  exit 3

monitoring nagios


Most cases I observed replication failures could be remedied by forcing deduplication. To my experience, dovecot deduplicate had to be run several times until all duplicate emails were removed.

dovecot deduplicate -u <user> '*'

Repeat until

  grep -c '^Message-ID:' path/to/mailbox
  grep '^Message-ID:' path/to/mailbox | sort -u | wc -l

show the same number.

docs/tips_n_tricks/dovecot.html.txt · Last modified: 01.02.2019 13:36 CET by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki