Good day, everyone.
I'm playing around with replication to create a backup host. I have hosts
backend3 (192.168.100.112) and backend3-replica (192.168.100.113). backend3
acts as a mail-receiving host, backend3-replica is a backup for the case of
failure.
Both versions are 2.2.13 (form Debian Jessie repository). backend3 receives
mail via LMTP-proxy. So far I've managed to setup replication via ssh, but
didn't have success with TCP replication. Any help would be much
appreciated.
Here is what I have in logs when processing a newly delivered e-mail.
backend3:
Dec 4 17:04:07 backend3 dovecot: lmtp(5451): Debug: none: root=, index=,
indexpvt=, control=, inbox=, alt=
Dec 4 17:04:07 backend3 dovecot: lmtp(5451): Connect from 192.168.100.101
Dec 4 17:04:07 backend3 dovecot: lmtp(5451): Debug: Loading modules from
directory: /usr/lib/dovecot/modules
Dec 4 17:04:07 backend3 dovecot: lmtp(5451): Debug: Module loaded:
/usr/lib/dovecot/modules/lib15_notify_plugin.so
Dec 4 17:04:07 backend3 dovecot: lmtp(5451): Debug: Module loaded:
/usr/lib/dovecot/modules/lib20_replication_plugin.so
Dec 4 17:04:07 backend3 dovecot: auth: Debug: master in:
USER#0111#011postmaster(a)mailnet.local
#011service=lmtp#011lip=192.168.100.112#011lport=24#011rip=127.0.0.1#011rport=33133
Dec 4 17:04:07 backend3 dovecot: auth-worker(5446): Debug:
sql(postmaster(a)mailnet.local,127.0.0.1): SELECT pop AS home, uid, gid,
CONCAT('*:bytes=', CAST(quota*1024*1024 AS CHAR)) AS quota_
rule FROM users WHERE username = 'postmaster(a)mailnet.local'
Dec 4 17:04:07 backend3 dovecot: auth: Debug: userdb out:
USER#0111#011postmaster(a)mailnet.local
#011home=/usr/local/mail/mailnet.local/postmaster#011uid=8#011gid=8#011quota_rule=*:bytes=1048
57600
Dec 4 17:04:07 backend3 dovecot: lmtp(5451): Debug: auth input:
postmaster(a)mailnet.local home=/usr/local/mail/mailnet.local/postmaster
uid=8 gid=8 quota_rule=*:bytes=104857600
Dec 4 17:04:07 backend3 dovecot: lmtp(5451): Debug: Added userdb setting:
plugin/quota_rule=*:bytes=104857600
Dec 4 17:04:07 backend3 dovecot: lmtp(5451): Debug: Effective uid=8,
gid=8, home=/usr/local/mail/mailnet.local/postmaster
Dec 4 17:04:07 backend3 dovecot: lmtp(5451): Debug: Namespace inbox:
type=private, prefix=, sep=, inbox=yes, hidden=no, list=yes,
subscriptions=yes location=maildir:/usr/local/mail/mailnet.
local/postmaster/Maildir
Dec 4 17:04:07 backend3 dovecot: lmtp(5451): Debug: maildir++:
root=/usr/local/mail/mailnet.local/postmaster/Maildir, index=, indexpvt=,
control=, inbox=/usr/local/mail/mailnet.local/postma
ster/Maildir, alt=
Dec 4 17:04:07 backend3 dovecot: lmtp(5451, postmaster(a)mailnet.local)
Debug: Effective uid=8, gid=8, home=/usr/local/mail/mailnet.local/postmaster
Dec 4 17:04:07 backend3 dovecot: lmtp(5451, postmaster(a)mailnet.local)
Debug: Namespace inbox: type=private, prefix=, sep=, inbox=yes, hidden=no,
list=yes, subscriptions=yes location=maildi
r:/usr/local/mail/mailnet.local/postmaster/Maildir
Dec 4 17:04:07 backend3 dovecot: lmtp(5451, postmaster(a)mailnet.local)
Debug: maildir++: root=/usr/local/mail/mailnet.local/postmaster/Maildir,
index=, indexpvt=, control=, inbox=/usr/local
/mail/mailnet.local/postmaster/Maildir, alt=
Dec 4 17:04:07 backend3 dovecot: lmtp(5451, postmaster(a)mailnet.local)
F0skIVedYVZLFQAAamJeGw: msgid=unspecified: saved mail to INBOX
Dec 4 17:04:07 backend3 dovecot: lmtp(5451): Disconnect from 127.0.0.1:
Successful quit
Dec 4 17:04:07 backend3 dovecot: auth: Debug: master in:
PASS#0111#011postmaster(a)mailnet.local#011service=doveadm
Dec 4 17:04:07 backend3 dovecot: auth-worker(5446): Debug:
sql(postmaster(a)mailnet.local): query: SELECT username AS user, crypt AS
password, proxy_maybe, host FROM users WHERE username =
'postmaster(a)mailnet.local' AND enabled = 1
Dec 4 17:04:07 backend3 dovecot: auth: Debug: passdb out:
PASS#0111#011user=postmaster(a)mailnet.local#011host=192.168.100.112#011proxy
Dec 4 17:04:07 backend3 dovecot: doveadm(postmaster(a)mailnet.local): Debug:
auth input: user=postmaster(a)mailnet.local host=192.168.100.112 proxy
Dec 4 17:04:07 backend3 dovecot: auth: Debug: master in:
PASS#0111#011postmaster(a)mailnet.local
#011service=doveadm#011lip=192.168.100.112#011lport=12345#011rip=192.168.100.112#011rport=58217
Dec 4 17:04:07 backend3 dovecot: auth-worker(5446): Debug:
sql(postmaster(a)mailnet.local,192.168.100.112): query: SELECT username AS
user, crypt AS password, proxy_maybe, host FROM users WHERE username =
'postmaster(a)mailnet.local' AND enabled = 1
Dec 4 17:04:07 backend3 dovecot: auth: Debug: passdb out:
PASS#0111#011user=postmaster(a)mailnet.local
Dec 4 17:04:07 backend3 dovecot:
doveadm(192.168.100.112,postmaster(a)mailnet.local): Debug: auth input:
user=postmaster(a)mailnet.local
Dec 4 17:04:07 backend3 dovecot: auth: Debug: master in:
USER#0112#011postmaster(a)mailnet.local
#011service=doveadm#011lip=192.168.100.112#011lport=12345#011rip=192.168.100.112#011rport=58217
Dec 4 17:04:07 backend3 dovecot: auth-worker(5446): Debug:
sql(postmaster(a)mailnet.local,192.168.100.112): SELECT pop AS home, uid,
gid, CONCAT('*:bytes=', CAST(quota*1024*1024 AS CHAR)) AS
quota_rule FROM users WHERE username = 'postmaster(a)mailnet.local'
Dec 4 17:04:07 backend3 dovecot: auth: Debug: userdb out:
USER#0112#011postmaster(a)mailnet.local
#011home=/usr/local/mail/mailnet.local/postmaster#011uid=8#011gid=8#011quota_rule=*:bytes=1048
57600
Dec 4 17:04:07 backend3 dovecot:
doveadm(192.168.100.112,postmaster(a)mailnet.local): Debug: auth input:
postmaster(a)mailnet.local home=/usr/local/mail/mailnet.local/postmaster
uid=8 gid=8 quo
ta_rule=*:bytes=104857600
Dec 4 17:04:07 backend3 dovecot:
doveadm(192.168.100.112,postmaster(a)mailnet.local): Debug: Added userdb
setting: plugin/quota_rule=*:bytes=104857600
Dec 4 17:04:07 backend3 dovecot: auth: Debug: master in:
PASS#0111#011postmaster(a)mailnet.local
#011service=doveadm#011lip=192.168.100.112#011lport=12345#011rip=192.168.100.113#011rport=43001
Dec 4 17:04:07 backend3 dovecot: auth-worker(5446): Debug:
sql(postmaster(a)mailnet.local,192.168.100.113): query: SELECT username AS
user, crypt AS password, proxy_maybe, host FROM users WHE
RE username = 'postmaster(a)mailnet.local' AND enabled = 1
Dec 4 17:04:07 backend3 dovecot: auth: Debug: passdb out:
PASS#0111#011user=postmaster(a)mailnet.local
Dec 4 17:04:07 backend3 dovecot:
doveadm(192.168.100.113,postmaster(a)mailnet.local): Debug: auth input:
user=postmaster(a)mailnet.local
Dec 4 17:04:07 backend3 dovecot: auth: Debug: master in:
USER#0112#011postmaster(a)mailnet.local
#011service=doveadm#011lip=192.168.100.112#011lport=12345#011rip=192.168.100.113#011rport=43001
Dec 4 17:04:07 backend3 dovecot: auth-worker(5446): Debug:
sql(postmaster(a)mailnet.local,192.168.100.113): SELECT pop AS home, uid,
gid, CONCAT('*:bytes=', CAST(quota*1024*1024 AS CHAR)) AS
quota_rule FROM users WHERE username = 'postmaster(a)mailnet.local'
Dec 4 17:04:07 backend3 dovecot: auth: Debug: userdb out:
USER#0112#011postmaster(a)mailnet.local
#011home=/usr/local/mail/mailnet.local/postmaster#011uid=8#011gid=8#011quota_rule=*:bytes=1048
57600
Dec 4 17:04:07 backend3 dovecot:
doveadm(192.168.100.113,postmaster(a)mailnet.local): Debug: auth input:
postmaster(a)mailnet.local home=/usr/local/mail/mailnet.local/postmaster
uid=8 gid=8 quo
ta_rule=*:bytes=104857600
Dec 4 17:04:07 backend3 dovecot:
doveadm(192.168.100.113,postmaster(a)mailnet.local): Debug: Added userdb
setting: plugin/quota_rule=*:bytes=104857600
Dec 4 17:04:07 backend3 dovecot:
doveadm(192.168.100.113,postmaster(a)mailnet.local): Debug: Effective uid=8,
gid=8, home=/usr/local/mail/mailnet.local/postmaster
Dec 4 17:04:07 backend3 dovecot:
doveadm(192.168.100.113,postmaster(a)mailnet.local): Debug: Namespace inbox:
type=private, prefix=, sep=, inbox=yes, hidden=no, list=yes,
subscriptions=yes lo
cation=maildir:/usr/local/mail/mailnet.local/postmaster/Maildir
Dec 4 17:04:07 backend3 dovecot:
doveadm(192.168.100.113,postmaster(a)mailnet.local): Debug: maildir++:
root=/usr/local/mail/mailnet.local/postmaster/Maildir, index=, indexpvt=,
control=, inb
ox=/usr/local/mail/mailnet.local/postmaster/Maildir, alt=
Dec 4 17:04:07 backend3 dovecot:
doveadm(192.168.100.112,postmaster(a)mailnet.local): Debug: Effective uid=8,
gid=8, home=/usr/local/mail/mailnet.local/postmaster
Dec 4 17:04:07 backend3 dovecot:
doveadm(192.168.100.112,postmaster(a)mailnet.local): Debug: Namespace inbox:
type=private, prefix=, sep=, inbox=yes, hidden=no, list=yes,
subscriptions=yes lo
cation=maildir:/usr/local/mail/mailnet.local/postmaster/Maildir
Dec 4 17:04:07 backend3 dovecot:
doveadm(192.168.100.112,postmaster(a)mailnet.local): Debug: maildir++:
root=/usr/local/mail/mailnet.local/postmaster/Maildir, index=, indexpvt=,
control=, inb
ox=/usr/local/mail/mailnet.local/postmaster/Maildir, alt=
Dec 4 17:04:07 backend3 dovecot:
doveadm(192.168.100.112,postmaster(a)mailnet.local): Debug: Namespace : Using
permissions from /usr/local/mail/mailnet.local/postmaster/Maildir:
mode=0700 gid
=default
Dec 4 17:04:07 backend3 dovecot: dsync-local(postmaster(a)mailnet.local):
Error: read(backend3-replica.mailnet.local) failed: EOF (version not
received)
Dec 4 17:04:07 backend3 dovecot: dsync-server(postmaster(a)mailnet.local):
Error: read(192.168.100.113) failed: EOF (version not received)
Here is what goes to backend3-replica's log:
Dec 4 17:04:07 backend3-replica dovecot: auth: Debug: master in:
PASS#0111#011postmaster(a)mailnet.local
#011service=doveadm#011lip=192.168.100.113#011lport=12345#011rip=192.168.100.112#011rport=46266
Dec 4 17:04:07 backend3-replica dovecot: auth-worker(4057): Debug:
sql(postmaster(a)mailnet.local,192.168.100.112): query: SELECT username AS
user, crypt AS password, proxy_maybe, host FROM users WHERE username =
'postmaster(a)mailnet.local' AND enabled = 1
Dec 4 17:04:07 backend3-replica dovecot: auth: Debug: passdb out:
PASS#0111#011user=postmaster(a)mailnet.local#011host=192.168.100.112#011proxy
Dec 4 17:04:07 backend3-replica dovecot:
doveadm(192.168.100.112,postmaster(a)mailnet.local): Debug: auth input:
user=postmaster(a)mailnet.local host=192.168.100.112 proxy
Dec 4 17:04:07 backend3-replica dovecot:
doveadm(192.168.100.112,postmaster(a)mailnet.local): Error: doveadm client:
Unknown flag: V
Dec 4 17:09:07 backend3-replica dovecot: auth: Debug: master in:
PASS#0111#011postmaster(a)mailnet.local
#011service=doveadm#011lip=192.168.100.113#011lport=12345#011rip=192.168.100.112#011rport=46269
Dec 4 17:09:07 backend3-replica dovecot: auth-worker(4062): Debug: Loading
modules from directory: /usr/lib/dovecot/modules/auth
Dec 4 17:09:07 backend3-replica dovecot: auth-worker(4062): Debug: Module
loaded: /usr/lib/dovecot/modules/auth/libdriver_mysql.so
Dec 4 17:09:07 backend3-replica dovecot: auth-worker(4062): Debug:
sql(postmaster(a)mailnet.local,192.168.100.112): query: SELECT username AS
user, crypt AS password, proxy_maybe, host FROM users WHERE username =
'postmaster(a)mailnet.local' AND enabled = 1
Dec 4 17:09:07 backend3-replica dovecot: auth: Debug: passdb out:
PASS#0111#011user=postmaster(a)mailnet.local#011host=192.168.100.112#011proxy
Dec 4 17:09:07 backend3-replica dovecot:
doveadm(192.168.100.112,postmaster(a)mailnet.local): Debug: auth input:
user=postmaster(a)mailnet.local host=192.168.100.112 proxy
Dec 4 17:09:07 backend3-replica dovecot:
doveadm(192.168.100.112,postmaster(a)mailnet.local): Error: doveadm client:
Unknown flag: V
Here is the output of dovecot -n for backend3:
# 2.2.13: /etc/dovecot/dovecot.conf
# OS: Linux 3.16.0-4-amd64 x86_64 Debian 8.2 ext4
auth_cache_negative_ttl = 0
auth_cache_size = 100 M
auth_cache_ttl = 0
auth_debug = yes
auth_mechanisms = plain login
auth_verbose = yes
disable_plaintext_auth = no
doveadm_password = doveadmpass
doveadm_port = 12345
first_valid_gid = 8
first_valid_uid = 8
last_valid_gid = 8
last_valid_uid = 8
lda_mailbox_autocreate = yes
lmtp_rcpt_check_quota = yes
login_trusted_networks = 192.168.100.100/32 192.168.100.101/32
mail_debug = yes
mail_gid = 8
mail_location = maildir:/usr/local/mail/%d/%n/Maildir
mail_plugins = " notify replication"
mail_uid = 8
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
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
}
mailbox name {
auto = subscribe
}
prefix =
}
passdb {
args = /etc/dovecot/dovecot-sql.conf.ext
driver = sql
}
plugin {
mail_replica = tcp:backend3-replica.mailnet.local
sieve = ~/.dovecot.sieve
sieve_dir = ~/sieve
}
pop3_client_workarounds = oe-ns-eoh
postmaster_address = postmaster@%d
protocols = " imap lmtp sieve pop3"
service aggregator {
fifo_listener replication-notify-fifo {
user = mail
}
unix_listener replication-notify {
user = mail
}
}
service doveadm {
inet_listener {
port = 12345
}
}
service imap-login {
inet_listener imap {
port = 143
}
inet_listener imaps {
port = 993
ssl = yes
}
process_min_avail = 10
}
service lmtp {
inet_listener lmtp {
port = 24
}
}
service pop3-login {
inet_listener pop3 {
port = 110
}
inet_listener pop3s {
port = 995
ssl = yes
}
}
service replicator {
process_min_avail = 1
unix_listener replicator-doveadm {
mode = 0600
}
}
ssl = no
userdb {
args = /etc/dovecot/dovecot-sql.conf.ext
driver = sql
}
For backend3-replica:
# 2.2.13: /etc/dovecot/dovecot.conf
# OS: Linux 3.16.0-4-amd64 x86_64 Debian 8.2 ext4
auth_cache_negative_ttl = 0
auth_cache_size = 100 M
auth_cache_ttl = 0
auth_debug = yes
auth_mechanisms = plain login
auth_verbose = yes
disable_plaintext_auth = no
doveadm_password = doveadmpass
doveadm_port = 12345
first_valid_gid = 8
first_valid_uid = 8
last_valid_gid = 8
last_valid_uid = 8
lda_mailbox_autocreate = yes
lmtp_rcpt_check_quota = yes
login_trusted_networks = 192.168.100.100/32 192.168.100.101/32
mail_debug = yes
mail_gid = 8
mail_location = maildir:/usr/local/mail/%d/%n/Maildir
mail_plugins = " notify replication"
mail_uid = 8
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
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
}
mailbox name {
auto = subscribe
}
prefix =
}
passdb {
args = /etc/dovecot/dovecot-sql.conf.ext
driver = sql
plugin {
mail_replica = tcp:backend3.mailnet.local
sieve = ~/.dovecot.sieve
sieve_dir = ~/sieve
}
pop3_client_workarounds = oe-ns-eoh
postmaster_address = postmaster@%d
protocols = " imap lmtp sieve pop3"
service aggregator {
fifo_listener replication-notify-fifo {
user = mail
}
unix_listener replication-notify {
user = mail
}
}
service doveadm {
inet_listener {
port = 12345
}
}
service imap-login {
inet_listener imap {
port = 143
}
inet_listener imaps {
port = 993
ssl = yes
}
process_min_avail = 10
}
service lmtp {
inet_listener lmtp {
port = 24
}
}
service pop3-login {
inet_listener pop3 {
port = 110
}
inet_listener pop3s {
port = 995
ssl = yes
}
}
service replicator {
process_min_avail = 1
unix_listener replicator-doveadm {
mode = 0600
}
}
ssl = no
userdb {
args = /etc/dovecot/dovecot-sql.conf.ext
driver = sql
}