Wednesday 25 March 2015

Script to replace special characters from files or directories recursively.



As a linux administrator, there may be a situation where you may want to replace special characters from a file or directory name.

You can easily rename such file or folder by command "mv <old file name> <new file name>". But what if you want to replace special characters of all files and folders present inside a directory. And also it should replace special characters recursively.

You can use following script to replace special characters. In following script, we have replaced special characters by "_" character.

1) Following script will check for special characters in all files and directories present under /mailstore.

2) If you want to replace special characters from another directory then modify script by providing path name of new directory instead of /mailstore.

Monday 23 March 2015

Mail migration via Imapsync tool



As an administrator in mail service provider company, there may be a situation where you may want to switch from old email provider to new one.

During migration from old to new setup, you may need to migrate emails from old server to new server.
You can migrate emails easily and freely via Imapsync utility.
Below is short description on working and usage of mails migration via Imapsync.


-To migrate mails from one server to another we use imapsync utility. It connects to server and synchronise mails from source to destination using IMAP protocol.

-Imapsync is a command line utility that incrementally and recursively transfers mails from one mailbox to another.

Imapsync command is available to download from epel.repo.

You need to install imapsync from epel repository on linux or you can download Imapsync from following link.

https://fedorahosted.org/released/imapsync/

Install imapsync from epel repo.

For 32 Bit systems

wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm

For 64 bit Systems
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm