dovecot replication and pop3 deletion
Nigel Metheringham
nigel at dotdot.cloud
Thu Jul 30 16:03:18 EEST 2020
Hi,
I am investigating the use of dovecot for a voicemail storage system
(which is effectively a SMTP/POP3 system), which we want to use
replication to give us some resilience.
Tests have mostly been on dovecot 2.3.8 (9df20d2db) - as packaged on
Centos 8 - but I have also used a couple of similar versions on
different platforms, so this is not a specific build problem.
The platform has replication working, over an SSL TCP link, for delivery.
With the pop3 configuration as default as is possible (although the
mail_plugins are explicitly included into the protocol sections to
ensure notify and replication is called for), any pop3 delete operation
does not cause a notify or replication operation. The two servers show
the mailboxes in a different state up until something else prods a
replication into progress.
I would suggest that a pop3 delete/expunge of a message should be
flagged as a mailbox change can cause a notify/replication, and that the
current behaviour is a bug.
There are workarounds to this, and I am considering adding a note to the
wiki page https://wiki.dovecot.org/Replication to flag this - not sure
what your wiki editing policy is.
# Workaround 1 - Change pop3 deletion to set a flag
If the setting
pop3_deleted_flag = '$POP3Deleted'
is added, then rather than the mail being deleted, it is flagged, and
this change causes a notification and replication to the other server.
However since the mail is not actually deleted, you additionally need
another (cron?) task to periodically remove flagged mail, for example:-
doveadm expunge -A MAILBOX inbox KEYWORD '$POP3Deleted'
# Workaround 2 - Use Lazy Expunge
You can use the lazy_expunge plugin - this has the same effect, and
automates the removal of the messages after a period of time.
https://doc.dovecot.org/configuration_manual/lazy_expunge_plugin/
For example, you can set the following changed config fragments:-
mail_plugins = $mail_plugins notify replication lazy_expunge
namespace inbox {
separator = /
prefix =
inbox = yes
# automatic lazy expunge mailbox
mailbox .EXPUNGED {
autoexpunge = 3 days
autoexpunge_max_mails = 1000
}
}
plugin {
# Move messages to an .EXPUNGED mailbox
lazy_expunge = .EXPUNGED
}
Nigel.
--
[ Nigel Metheringham --------------------------- nigel at dotdot.cloud ]
[ Ellipsis Intangible Cloudy Technologies ]
More information about the dovecot
mailing list