Recursive conversion of a Linux Directory to windows naming conventions 2004-09-30

download (10 kb)



Shell script to convert common unix file and directory names to the windows naming convention by replacing : with . , ? with - and by removing leading dots from file and directory names.



Working with Linux and Windows at combined network infrastructures is usually covered with compatibility servers like samba. As long as you use a samba server to store and retrieve files an directories you will usually not have conversion problems.

But what if you want to convert your Linux IMAP-Directory to use it with an Windows-MailServer? Well then you will quickly discover some obscure features of some IMAP-Servers to store mails like:,S=594:2,S,S=715:2,S,S=761:2,S

or IMAP-Dirs like:    pre:post

With this, a regular copy to any windows based platform will fail.



Don't think to much how to solve this. Copy the Directory_To_Convert to a certain location, name the srcDir and dstDir in the attached script and let it go.

If your permissions are set properly you will end up with a converted copy in dstDir. You can not use this as a fully converted IMAP-Directory - We did only convert to use the dirs & files in Windows but not to use the IMAP-Sources.


Mail Conversions

If you do have to migrate from Linux to Windows with your MailServer Solution and you do need help with this task, let me now it. I will find a solution for you migrating MailBox or MailDirs to known formats. I am currently working on a Solution to convert Qmail- MailDir's to Ivar Lumi's .NET Mailserver (Lumisoft).

But be warned. It is not as easy as it seems. It is a lot of work due to the different versions of Target MailServers.


Common Files & Dirs

As mentioned, just use the and have fun with it ;-)


your willi moser

[ top ]