https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8050

--- Comment #22 from RvdH <[email protected]> ---
Still not tested, but to give you an idea what i mean

sub set_global_state_dir {
  my ($self) = @_;
  # try home_dir_for_helpers
  my $helper_dir = $self->{home_dir_for_helpers} || '';
  if ($helper_dir) {
    my $dir = File::Spec->catdir($helper_dir, ".spamassassin");
    return if $self->test_global_state_dir($dir);
  }
  if (am_running_on_windows()) {
    my $dir = File::Spec->catdir($ENV{'ALLUSERSPROFILE'}, ".spamassassin");
    return if $self->test_global_state_dir($dir);
  }
  else {
    # try user home (if different from helper home)
    my $home = (Mail::SpamAssassin::Util::portable_getpwuid ($>))[7];
    if ($home && $home ne $helper_dir) {
      my $dir = File::Spec->catdir($home, ".spamassassin");
      return if $self->test_global_state_dir($dir);
    }
  }
  # try LOCAL_STATE_DIR
  return if $self->test_global_state_dir($self->{LOCAL_STATE_DIR});
  # fallback to userstate
  $self->{global_state_dir} = $self->get_and_create_userstate_dir();
  dbg("config: global_state_dir set to userstate_dir:
$self->{global_state_dir}");
}

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to