
Originally Posted by
Roy@ENHOST
I think you have to add extra detection to the script.
From what I know, this script will also switch the pipings that are required by helpdesk softwares to :fail:
You have to use pregmatch regex to check that the destination is not a php,cgi or a binary.
Hope that helps.

Chirpy, thanks for the script!
Roy, I modified the regex so that the perl script does not change any piped redirects (mailman seems to use such), and also script will leave default redirects to mail adresses but will still remove redirects to the unix username. This is to not mess with users who actually want to catch all mail of a domain and redirect it an existing mailbox.
Code:
#!/usr/bin/perl
print "Converting all domain Default Accounts to :fail: ...\n\n";
opendir (DIR, "/etc/valiases/") or die;
while (my $file = readdir (DIR)) {
if ($file =~ /^\./) {next}
open (IN, "</etc/valiases/$file") or die;
my @data = <IN>;
close (IN);
open (OUT, ">/etc/valiases/$file") or die;
foreach my $line (@data)
{
if ($line =~ /^((\*\:\s+[a-zA-Z0-9]+\s*)|(\*\:\s*))$/)
{
print OUT "*: :fail:\n";
print "Converted: [$file] $line";
}
else
{
print OUT $line;
if ($line =~ !/^\*\:\s+\:fail\:/)
{
print "Kept: [$file] $line";
}
}
}
close (OUT);
}
print "\n\nDone!\n";