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

(-)/usr/sbin/spamd.orig (-6 / +26 lines)
Lines 797-810 Link Here
797
	my $domain = '';
797
	my $domain = '';
798
	if ($safename =~ /^(.*)\@(.*)$/) { $localpart = $1; $domain = $2; }
798
	if ($safename =~ /^(.*)\@(.*)$/) { $localpart = $1; $domain = $2; }
799
799
800
	$dir =~ s/\%u/${safename}/g;
800
	# Do userdir lookup exim-style. 
801
	$dir =~ s/\%l/${localpart}/g;
801
	# If a config for the full address exists, use that one
802
	$dir =~ s/\%d/${domain}/g;
802
	# else look for a domain default
803
	if ($dir=~/%x/) {
804
		($userdir=$dir)=~s/%x/${safename}/g;
805
806
		$prefsfile=$userdir.'/user_prefs';
807
		if (-f $prefsfile) {
808
			$dir=$userdir;
809
810
		} else {
811
			$dir=~s/%x/${domain}/g;
812
			$prefsfile=$dir.'/user_prefs';
813
			$userdir=$dir;
814
		}
815
816
	# Use the normal escaping
817
	} else { 
818
		$dir =~ s/\%u/${safename}/g;
819
		$dir =~ s/\%l/${localpart}/g;
820
		$dir =~ s/\%d/${domain}/g;
821
		$userdir = $dir;
822
		$prefsfile = $dir.'/user_prefs';
823
	}
803
824
804
	$userdir = $dir;
805
	$prefsfile = $dir.'/user_prefs';
806
	# Log that the default configuration is being used for a user.
825
	# Log that the default configuration is being used for a user.
807
	logmsg("Using default config for $username: $prefsfile");
826
	logmsg("Using config for $username: $prefsfile");
827
	logmsg("Using configdir for $username: $userdir");
808
828
809
    } else {
829
    } else {
810
	$dir=$opt{'virtual-config'};
830
	$dir=$opt{'virtual-config'};

Return to bug 2555