rsync problem backing up cyrus-imap emails

Jeff jlar310 at
Tue Feb 8 10:52:27 EST 2011

Nikos Gatsis - Qbit <ngatsis <at>> writes:
>     Hello list
> I use rsync to backup cyrus mail dirs using the following command:
> rsync -vaR --delete --log-file=/var/log/rsync /var/lib/imap
> /var/spool/imap/ /mnt/backup
> The destination is a Lacie external network drive in ntfs format.
> The problem I have is that rsync change email names from, lets say 102.
> to 2RB3UX~6.
> I also backup to a local ext3 format hard drive where files save with
> exactly same name with right attributes, and rights with no problem.
> I try to rsync to a window pc shared folder and the emails saved also
> with the same names as used (102. to 102.)
> The external disk cant change from ntfs to ext format.
> Does someone had the same problem?
> Thank you in advance.

I have not seen your exact problem with the files being renamed, but I do know
that Windows/NTFS makes life very difficult for cyrus mail files. While NTFS
allows file names that end with a dot, virtually all of the Windows OS tools for
accessing files do not work with such file names. It's hard to say what is
happening on the Lacie drive. Could the Lacie NAS drive be running a linux
implementation of NTFS behind the scenes? That would be another potential source
of problems.

One solution would be to rsync /var/spool/imap to a local directory on the imap
server and then tar it up to /mnt/backup.

We store our mail backups on a Windows server using the Microsoft implementation
of NFS (regrettable, I know). We didn't have any issues getting the imap email
files to the NFS share, but again, we couldn't work with them from the Windows
OS. We solved the problem with a rather convoluted script that first mirrors the
directory structure of /var/spool/imap, then in the mirror directory, it
softlinks to every file in /var/spool/imap, but adds a "eml" extension to the
all links that refer to mail files that end with a dot. Then we rsync the mirror
structure to NFS using the --copy-links option which copies the content of the
symlink referrent, thus generating the same file on the Windows server, but with
a .eml extension, which then can be easily managed with Windows tools. Oh, the
hoops we jump through to deal with Windows...

I once emailed the cyrus-devel list asking about possibly changing the file-name
convention of mail files and received an unofficial patch that seemed to work
just fine.


More information about the Info-cyrus mailing list