I maintain an IMAP server running Dovecot which uses Maildir as the storage format for the user mailboxes. Every night, an rsync process runs to create a backup of the mailboxes. Recently, I noticed that rsync occasionally prints messages like
file has vanished: "/home/vmail/lists/archive/Maildir/.sales/dovecot-uidlist.lock" rsync warning: some files vanished before they could be transferred (code 24) at main.c(1655) [generator=3.1.1]
My understanding based on the Locking section in the Dovecot wiki is that this lock file is a custom extension of Dovecot which is held while the
dovecot-uidlist file is being written to. Hence, if a file is being delivered while the backup is running, it may happen that the
.lock file gets removed during the backup - triggering above warning message.
It would be easy to exclude this lock file from the backup, but I wonder: should we maybe rather lock the mailbox (such that no modifications to it take place) during the rsync backup? If so, how can one do this using Dovecot?