On our current sendmail (8.11.4) system (note that I said we were 
migrating), we have a in-house perl daemon that communicates with a 
provisioning (central management) server via an encrypted tcp connection 
(MD5).  We are using procmail as our local delivery agent, which is 
compiled with the hash depth set to 2.

The daemon includes a configuration module based on the platform :

____SNIP____
my $os = lc( $^O ).".pm";
eval require $os;
____SNIP____

Then we modify the module based on what the server needs to do.

Here is one version the code (not in a module) that I use for the 
hashing (prints to STDOUT):

____SNIP____
#!/usr/local/bin/perl
$username = $ARGV[0]; # give username as input
$hashlevel = 2; # depth of hashing
$home = "/usr/local/cust/home"; # no trailing /

if($hashlevel == 0) {
     $hashdir = $home . "/" . $username;
}
elsif ($hashlevel == 1) {
     $hash1 = substr($username,0,1);
     $hashdir = $hash1 . "/" . $username;
}
elsif ($hashlevel == 2) {
     $hash1 = substr($username,0,1);
     $hash2 = substr($username,1,1);
     $hashdir =  $hash1 . "/" . $hash2 . "/" . $username;
}
print $home . "/" . $hashdir;
____SNIP____

The total comes out to 762 lines of code for each server (excluding the 
177 for the MD5 module).

pop corn wrote:

>> I was looking at arranging my mail spools and hosted sites like this.
>>
>> /webs/f/o/foo.com/users/s/i/sillyemailuser

>>
>>                  ^ /html webroot for domain here

Permit me to correct myself.  In the interest of allowing customers to 
create other websites off of their root zone (e.g. www, images, etc.) I 
was going to create sub directores under the base domain:

/webs/f/o/foo.com/{www|images|users}/{html|cgi-bin}

> That's an interesting idea, it should help performance.
> 
> 1) How do you implement this hashing mechanism?


see above

> 2) How are you creating the hashing subdirectories?


you could modify the makehomedir script

> 3) How are you assigning users to the hashing subdirectories?


see above

> 4) Do you just put the actual hashed subdirectory location in 
> mailMessageStore or do you calculate the hashed location on the fly?


I haven't implemented this yet.  I'm going to create the directory when 
I add the user to our system via the provisioning interface.

At this time I'm looking at extending ISPMan (see ispman.org) to support 
qmail-ldap (and other things; by default it uses Postfix).  I haven't 
looked at its message passing interface yet (it uses perl), but I plan 
on adding MD5 encrypting to it.  If anyone's interested in working with 
me on this project, please let me know.  AFIAK, the primary developers 
are not interested in developing ISPMan for qmail.

I'm planning on using the LDAP-Control patch to configure a cluster 
(7-14) of mail servers load-balanced behind a LVS (DR).

Sorry some of that was off topic... :\

Cheers,

Mike

Reply via email to