Recently one of my Mitel SME Server clients took two weeks off. When he returned, Outlook Express told him he had 23,000 messages waiting on the server! Unfortunately, Outlook Express couldn't bring any of those messages to his PC; it just hung.
It's not unusual for Outlook Express to have problems like that. For example, if you don't delete messages from your Inbox AND purge deleted messages, you will eventually reach the point where Outlook can't bring in any messages at all. I don't know for sure how Outlook Express works, but it sure looks like it trys to bring everything into memory before it writes anything to disk. That this is incredibly naive doesn't need to be expanded upon. Anywhere, there we were, dead in the water. I tried having him change to IMAP from POP, but the same thing happened: Outlook Express just could not bring down the messages.
So, I ssh'ed into the machine and performed the following:
cd ~jpg # user name cd Maildir mv new newx mkdir new chown jpg:jpg new chmod 755 new
It would have been preferable to do this in single user mode, but I wasn't able to be there physically. I suppose we have a small possibility of an error delivering mail in the brief period that the mailbox does not exist, and I could have (and perhaps should have) stopped the qmail server before doing this. However, if some process was actively delivering mail it would have just ended up in newx (because "newx" would retain "new"'s inum) and the worst that could happen is that a message or two would bounce. As I said, better to do this single user, but this was probably OK.
Why move this like this? Two reasons: first, "new" had become unreasonably large, which would slow down both deliveries and pickups in the future - creating a new directory puts it back to reasonable size. Second, any new mail arriving after this would be easily picked up by Outlook Express because it would end up in "new", not "newx".
Now the problem was to move the messages back in, but slowly so that he would have time to delete the junk and file off the rest. The following script did the job:
cd /home/e-smith/files/users/jpg/Maildir/newx for i in * do mv $i /home/e-smith/files/users/jpg/Maildir/new/$i sleep 2 done
I ran this as "nohup movejpg &" so that I could log out after starting it. This will transfer 30 messages a minute back to "new", which should be slow enough for him to keep up. Of course this will take more than 10 hours to complete! I felt that was probably OK - some of the messages would transfer after hours, but that should be a small enough number that Outlook wouldn't choke the next day. And of course if it is - we'll just do it again!
It might have been impossible to do the "for i in *" if there had been tooo many more messages; in that case "xargs" would have let me control the scripts.
More Articles by Tony Lawrence - Find me on Google+
Have you tried Searching this site?
Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates
This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.
Many of the products and books I review are things I purchased for my own use. Some were given to me specifically for the purpose of reviewing them. I resell or can earn commissions from the sale of some of these items. Links within these pages may be affiliate links that pay me for referring you to them. That's mostly insignificant amounts of money; whenever it is not I have made my relationship plain. I also may own stock in companies mentioned here. If you have any question, please do feel free to contact me.
Specific links that take you to pages that allow you to purchase the item I reviewed are very likely to pay me a commission. Many of the books I review were given to me by the publishers specifically for the purpose of writing a review. These gifts and referral fees do not affect my opinions; I often give bad reviews anyway.
We use Google third-party advertising companies to serve ads when you visit our website. These companies may use information (not including your name, address, email address, or telephone number) about your visits to this and other websites in order to provide advertisements about goods and services of interest to you. If you would like more information about this practice and to know your choices about not having this information used by these companies, click here.
Click here to add your comments
Don't miss responses! Subscribe to Comments by RSS or by Email
Click here to add your comments
If you want a picture to show with your comment, go get a Gravatar