[tpop3d-discuss]tpop3d+Exim with hashed maildir directories

Kevin Bonner keb at pa.net
Sun, 30 May 2004 11:10:53 -0400


=2D----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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 =
you=20
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
> lines.

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=
id,=20
0 padded>/uid<uid>/mail/

This is a little hard to understand, so an example is about the only useful=
=20
way of describing the above.

Let's say my uid is 500.  Using the above hashing method, my maildir spool=
=20
would be at '/var/spool/mail/00/05/uid500/mail/'.  If my uid was 32768, the=
=20
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=
p.

One benefit to using the uid is if someone wants to change their username,=
=20
they will still be able to retrieve all of their email that was delivered t=
o=20
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=
=20
able to find another more suitable way based on the information you have=20
available.

Kevin Bonner
=2D----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQFAufmB/9i/ml3OBYMRApxzAKCZqEpLeZZuGjXqcWqjY0NBE6l/GQCeJz1W
rWdniLhJVmk/siIZtwTTYbw=3D
=3DVS+/
=2D----END PGP SIGNATURE-----