I figured this out, for the sake of the archives I will post the solution. 
The answer was to hack spamd itself, since its perl, this was not too 
difficult. Maybe this change will be of interest to developers.

In these lines, starting at line 798 in spamd
if ($safename =~ /^(.*)\@(.*)$/) { $localpart = $1; $domain = $2; }

$dir =~ s/\%u/${safename}/g;
$dir =~ s/\%l/${localpart}/g;
$dir =~ s/\%d/${domain}/g;

$userdir = $dir;

added the following:
if ($safename =~ /^(.*)\@(.*)$/) { $localpart = $1; $domain = $2; }

my $first = substr($safename,0,1);

$dir =~ s/\%u/${safename}/g;
$dir =~ s/\%l/${localpart}/g;
$dir =~ s/\%d/${domain}/g;
$dir =~ s/\%f/${first}/g;

$userdir = $dir;

Then I have these options set for spamd:

-d -m 100 -c -u speakeasy -x --virtual-config-dir=/home/speakeasy/spamrules/%f/%u

I did not store the rules in the users actual home directories
(/home/speakeasy/u/user/Maildir, etc.) since there is a mixture of domain
users and non-domain users (domain users in
/home/speakeasy/d/[EMAIL PROTECTED]/Maildir/) and that would break. But it 
still allows storage of rules in letter directories, if there are a huge 
number of users, this would help. Easy to go up another if you want, 
/home/speakeasy/u/s/user, etc.

Andreas

On Thu, 4 Sep 2003, Andreas Stollar wrote:

> Date: Thu, 4 Sep 2003 10:49:26 -0700 (PDT)
> From: Andreas Stollar <[EMAIL PROTECTED]>
> To: "[EMAIL PROTECTED]"
>     <[EMAIL PROTECTED]>
> Subject: [SAtalk] virtual user config for large site
> 
> Hello,
> 
> I have spamassassin set up and working with maildrop and qmail. The global 
> maildroprc file calls spamd like this:
> 
> xfilter "/usr/bin/spamc -u $LOGNAME"
> 
> and spamd prefs are set up like this:
> 
> OPTIONS="-d -m 100 -c -u speakeasy -x 
> --virtual-config-dir=/home/speakeasy/spamrules/%u/"
> 
> This all works fine, but for my setup, over 100,000 email accounts, the 
> directory /home/speakeasy/spamrules would quickly reach the 65.556 limit 
> of directories within a directory (all this is stored on a NetApp filer) 
> even if this limit did not exist, and directory with 100,000 
> subdirectories would be quite inefficient, and take up much CPU time to 
> just find the right one. All the virtual users Maildirs are in 
> /home/speakeasy/u/username, using the 'letterhomes' prevents me from 
> having any directory with too many subdirectories. I would like to be able 
> to pull the first letter of the username `cut -c1 %u` would do it, but I 
> can't seem to pass this to spamd properly. Anyone ever use spamassassin on 
> a very large site with virutal users try anything like this?
> 
> Andreas
> 
> 
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Spamassassin-talk mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/spamassassin-talk
> 


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Spamassassin-talk mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/spamassassin-talk

Reply via email to