I have a Debian mail server running Postfix, Courier and Maildir, with disks on EXT3 filesystem.

I have noticed that when I use my webmail application (Squirrelmail, in this case). It gets some kind of slow when using some email accounts (I have various domains with each one having several email accounts in the same server).

So, monitoring to discover what is the botteneck that may be causing the slowness, I have noticed that my RAM and CPU are mostly free, what I identified was some processes eating high ammounts of disk I/O, the processes that are constantly consuming the disk I/O are:


imapd Maildir

courierpop3d Maildir

pipe -n maildrop -t unix flags=R user=maildrop argv=/usr/bin/maildrop -d ${recipient}

I came into a conclusion that what is causing the slowness is the Maildir of some users that are too big (too much files in the cur and new directories) so, when an operation using the maildir is used, it eats insane ammounts of disk I/O.

And here's my question, is there a way to reduce the number of files in a Maildir? for example, there's an user cur folder with more than 80000 files, and everytime he gets to open his email client, the whole server becomes slow.

I don't know what is the recommended number of files in a directory, but if I could divide the 80000 files in various folders inside the cur directory (is it possible?) maybe the disk would get some rest.

Thank you.

  • You could archive messages that are older than a number of days by moving them to another directory, using something like find /path/to/folder -mtime +100 Commented Mar 21, 2014 at 14:20
  • I've tried that, but this generates in the Inbox folder being divided into several "archive" folders, isn't there a way to do it that is transparent to the user? (I don't know if you're fammiliar, but something like Zimbra does with its folders, it divides the messages into a lot of directories but the user only sees a single "inbox")
    – gtbono
    Commented Mar 21, 2014 at 14:58
  • Not sure I understand where the several archive folders come from, you can have one 'archive' folder per user, there are several scripts that can help you with the move, see for ex: ducea.com/2006/11/25/… Commented Mar 21, 2014 at 15:25


You must log in to answer this question.

Browse other questions tagged .