[tpop3d-discuss]tpop3d+Exim with hashed maildir directories
keb at pa.net
Sun, 30 May 2004 11:10:53 -0400
=2D----BEGIN PGP SIGNED MESSAGE-----
On Saturday 29 May 2004 07:27, Odhiambo Washington wrote:
> Thanks Chris for the outstanding work!
Indeed. We've been using tpop3d for a while now, and couldn't be happier.
> If one has over 1k e-mail domains, it occurs to me that the hashed
> directory delivery method can give improved performance, yes?
Probably. At the very least, it's easy to navigate to the proper place if =
ever need to find something.
> At the moment I am using Vmail-sql and Exim delivering mail to
> /var/spool/virtual/$domain/$user/ - maildir format.
> I am thinking about hashing all this to something like:
> /var/spool/virtual/d/do/domain/u/us/user or something along those
What we've done here is assign each user their own unique uid, which most=20
other places do as well. The hashing scheme we used was as follows:
<some base dir>/<last 2 digits of uid>/<2 digits before the last 2 of the u=
This is a little hard to understand, so an example is about the only useful=
way of describing the above.
Let's say my uid is 500. Using the above hashing method, my maildir spool=
would be at '/var/spool/mail/00/05/uid500/mail/'. If my uid was 32768, the=
maildir would be '.../68/27/uid32768/mail/'. Using some quick math=20
calculations and LPAD in MySQL, this hashing scheme was pretty easy to setu=
One benefit to using the uid is if someone wants to change their username,=
they will still be able to retrieve all of their email that was delivered t=
their old address, without having someone login and move the mail around.
This is just one of many ways to hash your mail directories. You might be=
able to find another more suitable way based on the information you have=20
=2D----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
=2D----END PGP SIGNATURE-----