dovecot duplicate emails

Битус Павел bitus at rozetka.com.ua
Tue Sep 10 15:49:45 EEST 2019


Hello. I have problems with duplicate emails when using replication and 
configured message filters on the client.
Looks like when letter comes, it processed by replication and 
immediately after this processed by filter on client and moved to 
another folder.
When it arrives to slave server into INBOX, it replicated back to master 
into INBOX and only after that - slave receives MOVE command.
The only thing I see in the log is that the letter comes 2 times with 
same msgid:

Sep 10 15:01:31 
lmtp(USERNAME at DOMAIN.com.ua)<9306><UD3fJJuQd11aJAAA8J4ONg>: Info: sieve: 
msgid=<f3701949-360e-e15d-3d76-7465f23fb0ba at DOMAIN.com.ua>: stored mail 
into mailbox 'INBOX'
Sep 10 15:01:31 
indexer-worker(USERNAME at DOMAIN.com.ua)<12248><UD3fJJuQd11aJAAA8J4ONg:GEsdNJuQd13YLwAA8J4ONg>: 
Info: Indexed 1 messages in INBOX (UIDs 55963..55963)
Sep 10 15:01:32 imap(USERNAME at DOMAIN.com.ua)<9674><zqysnTGSU8tYUeJ+>: 
Info: copy from INBOX: box=INBOX.Jira, uid=5034, 
msgid=<f3701949-360e-e15d-3d76-7465f23fb0ba at DOMAIN.com.ua>, size=23393
Sep 10 15:01:32 imap(USERNAME at DOMAIN.com.ua)<9674><zqysnTGSU8tYUeJ+>: 
Info: expunge: box=INBOX, uid=55963, 
msgid=<f3701949-360e-e15d-3d76-7465f23fb0ba at DOMAIN.com.ua>, size=23393
Sep 10 15:01:32 
indexer-worker(USERNAME at DOMAIN.com.ua)<12248><zqysnTGSU8tYUeJ+:oC6vHZyQd13YLwAA8J4ONg>: 
Info: Indexed 1 messages in INBOX.Jira (UIDs 5034..5034)
Sep 10 15:01:33 
indexer-worker(USERNAME at DOMAIN.com.ua)<12248><pQBKNpuQd13/OgAA8J4ONg:WIrkC52Qd13YLwAA8J4ONg>: 
Info: Indexed 1 messages in INBOX (UIDs 55964..55964)
Sep 10 15:01:33 imap(USERNAME at DOMAIN.com.ua)<9674><zqysnTGSU8tYUeJ+>: 
Info: copy from INBOX: box=INBOX.Jira, uid=5035, 
msgid=<f3701949-360e-e15d-3d76-7465f23fb0ba at DOMAIN.com.ua>, size=23393
Sep 10 15:01:33 imap(USERNAME at DOMAIN.com.ua)<9674><zqysnTGSU8tYUeJ+>: 
Info: expunge: box=INBOX, uid=55964, 
msgid=<f3701949-360e-e15d-3d76-7465f23fb0ba at DOMAIN.com.ua>, size=23393
Sep 10 15:01:34 
indexer-worker(USERNAME at DOMAIN.com.ua)<9417><zqysnTGSU8tYUeJ+:gKqSOJ2Qd13JJAAA8J4ONg>: 
Info: Indexed 1 messages in INBOX.Jira (UIDs 5035..5035)

Can you help me with this problem?

dovecot --version
2.3.7.2 (3c910f64b)

dovecot -n
# 2.3.7.2 (3c910f64b): /etc/dovecot/dovecot.conf
# Pigeonhole version 0.5.7.2 (7372921a)
# OS: Linux 4.19.66-gentoo x86_64 Gentoo Base System release 2.6
# Hostname: leon.DOMAIN.com.ua
auth_cache_negative_ttl = 30 secs
auth_cache_size = 256 M
auth_cache_verify_password_with_worker = yes
auth_gssapi_hostname = $ALL
auth_krb5_keytab = /etc/krb5.keytab
auth_mechanisms = gssapi ntlm plain login cram-md5 digest-md5
auth_worker_max_count = 2048
debug_log_path = /var/log/dovecot/dovecot_debug.log
default_client_limit = 8492
default_vsz_limit = 2 G
dict {
   lastlogin = mysql:/etc/dovecot/dovecot-dict-sql-lastlogin.conf
}
doveadm_password = # hidden, use -P to show it
first_valid_uid = 8
imap_client_workarounds = delay-newmail tb-extra-mailbox-sep tb-lsub-flags
listen = *
log_path = /var/log/dovecot/dovecot.log
mail_attribute_dict = file:%h/Maildir/dovecot-attributes
mail_fsync = never
mail_gid = mail
mail_location = maildir:%h
mail_max_keyword_length = 4096
mail_plugins = " notify replication zlib fts fts_solr mail_log notify"
mail_uid = mail
maildir_stat_dirs = yes
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 index ihave duplicate mime foreverypart extracttext
mbox_lazy_writes = no
metric imap_commands {
   event_name = imap_command_finished
}
namespace inbox {
   inbox = yes
   location =
   mailbox Drafts {
     special_use = \Drafts
   }
   mailbox Junk {
     auto = subscribe
     special_use = \Junk
   }
   mailbox Sent {
     special_use = \Sent
   }
   mailbox "Sent Messages" {
     special_use = \Sent
   }
   mailbox Trash {
     special_use = \Trash
   }
   prefix =
}
passdb {
   args = /etc/dovecot/dovecot-sql.conf.ext
   driver = sql
}
passdb {
   args = /etc/dovecot/dovecot-ldap-people.conf.ext
   driver = ldap
}
passdb {
   args = /etc/dovecot/dovecot-ldap-calendar.conf.ext
   driver = ldap
}
plugin {
   fts = solr
   fts_autoindex = yes
   fts_autoindex_max_recent_msgs = 100
   fts_solr = url=http://SOLR_IP_ADDRESS:8983/solr/dovecot/
   last_login_dict = proxy::lastlogin
   mail_log_cached_only = yes
   mail_log_events = delete undelete expunge copy mailbox_delete 
mailbox_rename
   mail_log_fields = uid box msgid size
   mail_replica = tcp:REPLICATE.DOMAIN.com.ua:4092
   replication_dsync_parameters = -d -N -l 30 -U
   replication_full_sync_interval = 7 days
   sieve = file:~/sieve;active=~/.dovecot.sieve
   sieve_before = /etc/dovecot/sieve/default.sieve
   sieve_before2 = /etc/dovecot/sieve/default_spam.sieve
   zlib_save = gz
   zlib_save_level = 9
}
postmaster_address = root at DOMAIN.com.ua
protocols = imap pop3 lmtp sieve
replication_max_conns = 50
service aggregator {
   fifo_listener replication-notify-fifo {
     user = mail
   }
   unix_listener replication-notify {
     user = mail
   }
}
service auth {
   unix_listener auth-client {
     mode = 0660
     user = mail
   }
   unix_listener auth-master {
     mode = 0600
     user = mail
   }
   unix_listener auth-userdb {
     mode = 0600
     user = mail
   }
}
service config {
   unix_listener config {
     mode = 0600
     user = mail
   }
}
service dict {
   unix_listener dict {
     group = mail
     mode = 0600
     user = mail
   }
}
service doveadm {
   inet_listener {
     port = 4092
   }
}
service imap-login {
   process_min_avail = 8
   service_count = 0
   vsz_limit = 256 M
}
service imap {
   client_limit = 10
   process_limit = 4096
   process_min_avail = 50
   service_count = 100
}
service lmtp {
   process_limit = 70
   process_min_avail = 20
}
service managesieve-login {
   inet_listener sieve {
     port = 4190
   }
}
service pop3-login {
   inet_listener pop3 {
     port = 0
   }
   inet_listener pop3s {
     port = 0
   }
}
service replicator {
   process_min_avail = 1
   unix_listener replicator-doveadm {
     group = mail
     mode = 0660
   }
   vsz_limit = 20 G
}
ssl_cert = </etc/ssl/my_certs/fullchain1.pem
ssl_dh = # hidden, use -P to show it
ssl_key = # hidden, use -P to show it
userdb {
   args = /etc/dovecot/dovecot-sql.conf.ext
   driver = sql
}
userdb {
   args = /etc/dovecot/dovecot-ldap-people.conf.ext
   driver = ldap
}
userdb {
   args = uid=mail gid=mail home=/home/DOMAIN.com.ua/%Ln 
username_format=%Ln at DOMAIN.com.ua mail=maildir:/home/DOMAIN.com.ua/%Ln:UTF-8
   driver = static
}
protocol lmtp {
   auth_username_format = %Lu
   mail_fsync = optimized
   mail_plugins = " notify replication zlib fts fts_solr mail_log notify 
sieve"
}
protocol lda {
   mail_fsync = optimized
}
protocol imap {
   imap_idle_notify_interval = 5 mins
   imap_max_line_length = 4 M
   imap_metadata = yes
   mail_max_userip_connections = 2048
   mail_plugins = " notify replication zlib fts fts_solr mail_log notify 
fts fts_solr last_login"
}
protocol sieve {
   managesieve_max_line_length = 65536
}



More information about the dovecot mailing list