View | Details | Raw Unified | Return to bug 2555
Collapse All | Expand All

(-)spamd/spamd.raw (-6 / +26 lines)
Lines 2660-2673 Link Here
2660
    my $domain    = '';
2660
    my $domain    = '';
2661
    if ( $safename =~ /^(.*)\@(.*)$/ ) { $localpart = $1; $domain = $2; }
2661
    if ( $safename =~ /^(.*)\@(.*)$/ ) { $localpart = $1; $domain = $2; }
2662
2662
2663
    $dir =~ s/\%u/${safename}/g;
2663
    # Do userdir lookup exim-style. 
2664
    $dir =~ s/\%l/${localpart}/g;
2664
    # If a config for the full address exists, use that one
2665
    $dir =~ s/\%d/${domain}/g;
2665
    # else look for a domain default
2666
    $dir =~ s/\%\%/\%/g;
2666
    if ($dir=~/%x/) {
2667
      ($userdir=$dir)=~s/%x/${safename}/g;
2667
2668
2668
    $userdir   = $dir;
2669
      $prefsfile=$userdir.'/user_prefs';
2669
    $prefsfile = $dir . '/user_prefs';
2670
      if (-f $prefsfile) {
2671
        $dir = $userdir;
2670
2672
2673
      } else {
2674
        $dir =~ s/%x/${domain}/g;
2675
2676
        $prefsfile = $dir.'/user_prefs';
2677
        $userdir   = $dir;
2678
      }
2679
2680
    # Use the normal escaping
2681
    } else { 
2682
      $dir =~ s/\%u/${safename}/g;
2683
      $dir =~ s/\%l/${localpart}/g;
2684
      $dir =~ s/\%d/${domain}/g;
2685
      $dir =~ s/\%\%/\%/g;
2686
2687
      $userdir   = $dir;
2688
      $prefsfile = $dir . '/user_prefs';
2689
    }
2690
2671
    # Log that the default configuration is being used for a user.
2691
    # Log that the default configuration is being used for a user.
2672
    info("spamd: using default config for $username: $prefsfile");
2692
    info("spamd: using default config for $username: $prefsfile");
2673
  }
2693
  }

Return to bug 2555