Table of Contents
Solving "Error: mkdir/chown(.../.imap/INBOX, group=8(mail)) failed"
According to wiki2.dovecot.org the problem is solved by removing the write persmissions to the group on
Note: The locally running replicator allways pushes the local changes to the far side (provided it is running without the
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-resyncis 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 email@example.com by
while doveadm deduplicate -u firstname.lastname@example.org mailbox INBOX OR mailbox Spam do fgrep -c Message-ID: example.com/user/mail/Spam xid.at/xen/mail/INBOX echo "++++ `date` +++++" done
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 ] then echo "CRIT: doveadm replicator status: Waiting 'failed' requests $repl_n_wait_fail" exit 2 fi ;; esac echo "UNKNOWN: Strange value in doveadm replicator status for waiting 'failed' requests: $repl_n_wait_fail" exit 3
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> '*'
grep -c '^Message-ID:' path/to/mailbox grep '^Message-ID:' path/to/mailbox | sort -u | wc -l
show the same number.