--- C:/x/sievec/masssievecdomains	Fr Sep  3 16:47:40 2010
+++ C:/x/sievec/masssievec	Mo Aug 30 14:48:18 2010
@@ -61,7 +61,6 @@
 }
 
 $sievedir = "/usr/sieve";
-$hasdomains = 0;
 
 if(! -x $SIEVEC) {
     print "$SIEVEC is not executable\n";
@@ -91,9 +90,6 @@
 	if (/^sievedir:\s+(.*)$/) {
 	    $sievedir = $1;
 	}
-	if (/^virtdomains:\s+(userid|on)/) {
-	    $hasdomains= 1;
-	}
     }
     close CONF;
 }
@@ -105,97 +101,66 @@
 }
 
 print "you are using $sievedir as your sieve directory.\n";
-if ($hasdomains eq 1)
-{
-	    print "you are using virtual domains\n";
-	    opendir DOMAIN, $sievedir . "/domain";
-	    
-	    while (defined($s = readdir DOMAIN)) {
-		next if ($s eq "." || $s eq "..");
-            chdir $sievedir . "/domain" . "/$s";
-            $letterdir= $sievedir . "/domain" . "/$s";
-            opendir DOMAINLETTERS, ".";
 
+opendir TOP, $sievedir;
+while (defined($s = readdir TOP)) {
+    next if ($s eq "." || $s eq "..");
+    chdir $sievedir . "/$s";
+    opendir THISONE, ".";
 
-	            while(defined($t = readdir DOMAINLETTERS)) {
-    			next if ($t eq "." || $t eq "..");
-			    print "processing domain $t\n";
-			    # print "calling sievec for: " . $letterdir . "/" . $t . "\n";
-			    processUsers($letterdir . "/" . $t);
-		     }
-		    closedir DOMAINLETTERS
-	    }
-            	    
-	    closedir DOMAIN;
-}
-else
-{
-    processUsers($sievedir);
-}
+    while(defined($t = readdir THISONE)) {
+	next if ($t eq "." || $t eq "..");
+	print "processing user $t\n";
+	chdir $t;
 
-sub processUsers
-{
-	opendir TOP, $_[0];
-	while (defined($s = readdir TOP)) {
-	    next if ($s eq "." || $s eq "..");
-	    chdir $_[0] . "/$s";
-	    opendir THISONE, ".";
-	
-	    while(defined($t = readdir THISONE)) {
-		next if ($t eq "." || $t eq "..");
-		print "processing user $t\n";
-		chdir $t;
-	
-		opendir USER, ".";
-		while(defined($u = readdir USER)) {
-		    next if ($u eq "." || $u eq "..");
-		    if($u eq "default" && -l $u) {
-			# special case
-			$dest = readlink $u;
-			next unless($dest =~ m/\.script$/);
-			$dest =~ s/\.script$//;
-			symlink "$dest.bc", "defaultbc" || warn "can't symlink $dest.bc to defaultbc: $!";
-			unlink ("default");
-		    } elsif ($u eq "default.bc" && -l $u) {
-			# slightly different upgrade foramt
-			$dest = readlink $u;
-			next unless($dest =~ m/\.bc$/ && $dest ne "default.bc");
-			symlink "$dest", "defaultbc" || warn "can't symlink $dest to defaultbc: $!";
-			unlink ("default.bc");
-		    } elsif ($u eq "default" || $u eq "default.bc") {
-			warn "$u is not a symlink";
-		    } else {
-			next unless($u =~ m/\.script$/);
-			$out = $u;
-			$out =~ s/\.script$//;
-	
-		FORK: {
-			if($pid = fork()) {
-			    #parent, do nothing
-			    waitpid $pid, 0;
-			} elsif (defined $pid) {
-			    # child
-			    exec $SIEVEC, $u, "$out.bc";
-			    die "souldn't be here";
-			} elsif ($! =~ /No more process/) {
-			    # EAGAIN
-			    sleep 5; redo FORK;
-			} else {
-			    die "cant fork: $!";
-			}
-		      }
-	
-			$rc = $? & 0xff00;
-			$rc >>= 8;
-			if($rc) {
-			    print "got error compiling $u.\n";
-			}
-		    }
+	opendir USER, ".";
+	while(defined($u = readdir USER)) {
+	    next if ($u eq "." || $u eq "..");
+	    if($u eq "default" && -l $u) {
+		# special case
+		$dest = readlink $u;
+		next unless($dest =~ m/\.script$/);
+		$dest =~ s/\.script$//;
+		symlink "$dest.bc", "defaultbc" || warn "can't symlink $dest.bc to defaultbc: $!";
+		unlink ("default");
+	    } elsif ($u eq "default.bc" && -l $u) {
+		# slightly different upgrade foramt
+		$dest = readlink $u;
+		next unless($dest =~ m/\.bc$/ && $dest ne "default.bc");
+		symlink "$dest", "defaultbc" || warn "can't symlink $dest to defaultbc: $!";
+		unlink ("default.bc");
+	    } elsif ($u eq "default" || $u eq "default.bc") {
+		warn "$u is not a symlink";
+	    } else {
+		next unless($u =~ m/\.script$/);
+		$out = $u;
+		$out =~ s/\.script$//;
+
+	FORK: {
+		if($pid = fork()) {
+		    #parent, do nothing
+		    waitpid $pid, 0;
+		} elsif (defined $pid) {
+		    # child
+		    exec $SIEVEC, $u, "$out.bc";
+		    die "souldn't be here";
+		} elsif ($! =~ /No more process/) {
+		    # EAGAIN
+		    sleep 5; redo FORK;
+		} else {
+		    die "cant fork: $!";
 		}
-		chdir $_[0] . "/$s";
+	      }
+
+		$rc = $? & 0xff00;
+		$rc >>= 8;
+		if($rc) {
+		    print "got error compiling $u.\n";
+		}
 	    }
-	    closedir THISONE;
 	}
-	closedir TOP
+	chdir $sievedir . "/$s";
+    }
+    closedir THISONE;
 }
-
+closedir TOP