docs:tips_n_tricks:dovecot.html
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
docs:tips_n_tricks:dovecot.html [22.10.2017 11:37 CEST] – peter | docs:tips_n_tricks:dovecot.html [01.02.2019 13:36 CET] (current) – [Remediation] peter | ||
---|---|---|---|
Line 5: | Line 5: | ||
According to [[http:// | According to [[http:// | ||
- | ===== Troubleshooting replication | + | ===== Replication |
+ | ==== Troubleshooting ==== | ||
+ | |||
+ | **Note:** The locally running replicator allways pushes the local changes to the far side (provided it is running without the '' | ||
doveadm replicator status < | doveadm replicator status < | ||
//< | //< | ||
+ | |||
+ | Run | ||
+ | |||
+ | doveadm replicator status ' | ||
+ | |||
+ | to find failing mailboxes. | ||
+ | |||
+ | Times shown are the time passed since last fast/full sync. | ||
doveadm replicator dsync-status | doveadm replicator dsync-status | ||
Accepts a username pattern as well, but works without it. | Accepts a username pattern as well, but works without it. | ||
- | :!: '' | + | |
+ | triggers a new full sync. (Needs | ||
+ | <note tip>'' | ||
Credits: | Credits: | ||
* https:// | * https:// | ||
+ | ==== Deduplication ==== | ||
+ | |||
+ | Sometimes, root cause of replication troubles seem to be duplicated emails. Those might be cleaned up in mailboxes //INBOX// and //Spam// for account // | ||
+ | |||
+ | <code bash deduplicate.sh> | ||
+ | while doveadm deduplicate -u user@example.com mailbox INBOX OR mailbox Spam | ||
+ | do | ||
+ | fgrep -c Message-ID: example.com/ | ||
+ | echo "++++ `date` +++++" | ||
+ | done | ||
+ | </ | ||
+ | |||
+ | This will run forever ans should be stopped when numbers do not change any more. | ||
+ | ==== Monitoring ==== | ||
+ | //This solution is for nagios-like monitoring systems// | ||
+ | |||
+ | This needs a //sudo// entry to allow //nagios// running '' | ||
+ | <file bash check_dovecot.sh> | ||
+ | #! /bin/sh | ||
+ | | ||
+ | # LANG=C doveadm replicator status|fgrep "' | ||
+ | repl_n_wait_fail=" | ||
+ | # LANG=C doveadm replicator status|fgrep "' | ||
+ | # echo " | ||
+ | | ||
+ | case " | ||
+ | " | ||
+ | exit 0 ;; | ||
+ | " | ||
+ | exit 1 ;; | ||
+ | *) if [ " | ||
+ | then | ||
+ | echo "CRIT: doveadm replicator status: Waiting ' | ||
+ | exit 2 | ||
+ | fi ;; | ||
+ | esac | ||
+ | | ||
+ | |||
+ | echo " | ||
+ | exit 3 | ||
+ | </ | ||
+ | {{tag> | ||
+ | {{entry> | ||
+ | {{entry> | ||
+ | |||
+ | ==== Remediation ==== | ||
+ | |||
+ | Most cases I observed replication failures could be remedied by forcing deduplication. To my experience, '' | ||
+ | |||
+ | dovecot deduplicate -u < | ||
+ | |||
+ | Repeat until | ||
+ | |||
+ | <file bash> | ||
+ | grep -c ' | ||
+ | grep ' | ||
+ | </ | ||
+ | |||
+ | show the same number. | ||
====== | ====== | ||
{{tag> | {{tag> | ||
{{entry> | {{entry> | ||
{{entry> | {{entry> | ||
- | {{entry>dovect}} | + | {{entry>dovecot}} |
docs/tips_n_tricks/dovecot.html.1508665075.txt.gz · Last modified: 22.10.2017 11:37 CEST by peter