Emails restore in production environment

Hello,
I have strange issue and after a week of trying variuos scenarious I give up and writting here. I have a server with scheduled weekly full backups from Virtualmin panel. After a half of the year my server crashed. I installed a new Centos 6, Virtualmin and restored a .gz backup using them same users UID.

The problem is then I restored a backup all my Outlook users redownload and multiply all messages 2-3 times. Outlook got full of dublicate messages marked as new in the end, middle and everywhere in messages window. In total users got around 20000 emails!

At this moment users have deleted dublicates. But what should I do then next time I need to restore a whole server? Is Virtualmin email feature is ready to use in production?

This week I took server backups A, B, C then restore on new server backup A. Configured an account on Outlook. User flawlessly download messages. Then restored B. My users download new messages, but dublicate old. Restored C. The same situation - new messages are downloaded and old ones got more dublicates. Some of them just 2 others 3 times…

My server is Centos 6.2+Virtualmin without any tweeks. One not standard feature is that it has fired up replication (mirroring) of /home to another remote server /home by Unison. Dovecot files are not sync’ed.

So of you have any ideas it would be nice to hear them. Because all organization is quite angry on me because of this accident.

Are your users using POP3 or IMAP to access their email?

With such a large amount of emails, IMAP is preferred, since the “email already downloaded” information is stored in the email itself there. (To be exact, each email is stored in a separate file, and the filename gets a postfix “,S” for seen emails.) For POP3, the mail client is responsible for tracking which mail it has already seen, and that info can get lost during a backup restore for various reasons.

Thanks for your suggestion. All my users prefer POP3 together with an option “Leave a message on the server” in email clients. They prefer to have all emails in their inbox in case the internet connection can’t be possible. Just some of them enabled IMAP on smartphones. I’m still experimenting with restore procedure in different ways, but unsuccessfully. One news is that if I restore full backup, then configure Outlook user and download messages and then I do incremental backup restore, not all of my users download new messages but maybe just half of them…

Also I enabled in /etc/dovecot/conf.d/20-pop3.conf options
pop3_reuse_xuidl = yes
pop3_save_uidl = yes
But now it seems that new emails have more multiplications than without this option…