Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Programming/Scripts

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Thread Tools Display Modes
Old 12th May 2012, 18:17
mmidgett mmidgett is offline
Senior Member
Join Date: Aug 2006
Location: Mooresville, North Carolina - USA
Posts: 117
Thanks: 5
Thanked 14 Times in 13 Posts
Default Batch Rename emails in vmail

I have moved mail from my old server to the new one and the server name is stored into the file name. just copying the mail over it is displayed in IMAP but the new servers mails and other old servers mail are not sorted properly. I thought it might be the file name.

I want to change

-rw------- 1 vmail vmail 9455 May 6 06:31 1336300280.M851460P7400V000000000000FC00I002A0136_ 0.webster.trickhosting.biz,S=9455:2,S


-rw------- 1 vmail vmail 9455 May 6 06:31 1336300280.M851460P7400V000000000000FC00I002A0136_ 0.web1.trickhosting.biz,S=9455:2,S

and I have hundreds of files to change so it would be nice if I could just point a script to a directory and let it change them recursively.

Will someone help me with this?
Reply With Quote
Sponsored Links
Old 19th May 2012, 02:58
A4P A4P is offline
Junior Member
Join Date: Sep 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Batch Vmail Renaming


It's really simple using "sed".

There was a time long ago when I had a similar issue and it double dawned on me that some of the best tools in NIX are the oldest AND best which are "sed" & "awk".

I could write a bash script for you but as I did many years ago before there were great tools to post like this one, just IRC that I found learning how to use "sed" and "awk" on my own has kept the knowledge intact for a few decades.

Hope this helps?

And forgive the bad pun following:

"Just listen to what the man sed".
Paul McCartney & Wings 1976

Reply With Quote


Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
mailbox structure crypted General 8 26th July 2012 21:22
Missing Junk Mail Folder? FeraTechInc General 11 16th January 2012 10:51
dovecot permission problems frankkahle Installation/Configuration 5 3rd November 2011 16:52
what should be in a vmail folder? crypted General 9 29th October 2010 23:15
Postfix not receive but send mail !!! mixian Installation/Configuration 22 4th August 2010 10:31

All times are GMT +2. The time now is 21:02.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.