On Thursday 15 January 2004 11:51 am, Systems Administrator wrote:
> And the -c option doesn't seem to be creating .spamassassin dirs inside
> their homedirs

I found a problem with spamassassin version 2.61 and latest cvs 2.70

Here is a patch that should allow for auto creation of vpopmail
.spamassassin/user_prefs file. It should be applied to your
SpamAssassin.pm file, then restart spamd


--- SpamAssassin.pm.orig	2004-01-15 11:57:05.000000000 -0800
+++ SpamAssassin.pm	2004-01-15 12:00:17.000000000 -0800
@@ -1268,7 +1268,7 @@
 }
 
 sub get_and_create_userstate_dir {
-  my ($self) = @_;
+  my ($self,$userdir) = @_;
 
   # user state directory
   my $fname = $self->{userstate_dir};
@@ -1276,8 +1276,8 @@
 
   # If vpopmail is enabled then set fname to virtual homedir
   #
-  if (defined $self->{user_dir}) {
-    $fname = File::Spec->catdir ($self->{user_dir}, ".spamassassin");
+  if ($userdir) {
+    $fname = "$userdir/.spamassassin";
   }
 
   if (defined $fname && !$self->{dont_copy_prefs}) {
@@ -1309,8 +1309,8 @@
     return(0);
   }
 
-  if ($userdir && $userdir ne $self->{user_dir}) {
-    warn "Oops! user_dirs don't match! '$userdir' vs '$self->{user_dir}'\n";
+  if ($userdir) { 
+    $self->{user_dir} = $userdir;
   }
 
   if (!-f $fname)

Reply via email to