LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-03-2013, 04:50 PM   #1
asylum_craig
LQ Newbie
 
Registered: Apr 2013
Posts: 1

Rep: Reputation: Disabled
Migrating mail server from debian 5 to debian 6- Maildir folder renaming script


I am taking over the IT for the small business I work for and I inherited an older box running debian 5. Its sole purpose is just for our email server. I built a newer box with debian 6 on it an have been working on switching everyone over to the new server. I have all the courier imap and postfix installed and configured and working in my test environment for sending and receiving mail. I want the transition to be seamless so none of the users ever even know it happened (with the exception of them having to pull a new certificate). I am not super linux savvy and have ran into a small snag with this seamless transition.

Most of my users prefer mozilla thunderbird as their imap client of choice, and it works really well for us. Upon testing how thunderbird behaves when using the new server i noticed some of the users folders were not automatically showing up in thunderbird and had to be re-subscribed to. After digging into the old server a bit I noticed some users have folders in their mail directories named like this: ".INBOX.foldername.subfoldername" and others simply ".folder.subfoldername".

I noticed the problem of the subscribed folders not showing up in thunderbird only seems to happen for the users with folders having the ".INBOX" prefix. Using rsync i successfully copied everyones info to the new server. I don't have a large user group but they do have a ton of emails organized into a ton of folders and it would take forever for me to rename them by hand. Again not being super linux savvy, was wondering if someone could help me write a script that would go through and remove the "INBOX" prefix whilst maintaining the exact remainder of the foldername (which in some cases includes spaces) and any subfolders it may contain. Thanks in advance for the help.
 
Old 04-05-2013, 06:46 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
.INBOX is actually a folder, and .INBOX.whatever is the .whatever folder under the INBOX rather than as a folder under their user account. I'm not explaining this well, so a picture....

Code:
Myname@domain.com
|
+-Foldername <- This would be .Foldername
|
++-INBOX <- This is .INBOX
 |
 ++-Foldername <- This is .INBOX.Foldername
 |+--SubFoldername <- This is .INBOX.Foldername.SubFoldername
 |
If you do your rename that you suggest this will flatten and move all the folders people have in their INBOX to outside their INBOX, and will probably break any rules in place.

Last edited by TenTenths; 04-05-2013 at 06:47 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: The Perfect Push Mail Server - Debian Squeeze (Debian 6.0) With ISPConfig 3 & Z-push LXer Syndicated Linux News 0 11-23-2012 08:30 AM
Mail delivered to /home/user/Maildir instead of /var/mail/vdomain/vuser/Maildir snowweb Linux - Software 1 08-16-2012 09:59 PM
Error Retrieving Mail from Linux Mail Server: Unable to Scan $HOME/Maildir tmghendi General 0 06-15-2009 07:35 AM
Migrating Mail - Courier Imap /Maildir > Cyrus /var/spool/imap swilliams2006 Linux - Server 3 10-13-2006 05:47 PM
Migrating a Debian Server from one System to another wodan39 Linux - Hardware 0 05-18-2005 03:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration