Bill,
Be careful with this. There has been discussion on NANOG recently about
AOL blocking email from list servers and some indication that this happens
to those who sort by domain so they hit AOL with a block of traffic instead
of a few at a time. Can't say whether or not this is true, just a heads up.
- Tom
At 09:36 AM 6/21/2001 -0500, Anderson, Bill wrote:
>The recent discussions on how to improve majordomo/sendmail performance by
>sorting the list files by domain prompted me to try to do this for my own
>lists. Finding no script to do this already written, I put together the
>following perl script to do the sorting. The directory the list files are in
>is defined in the chdir function in the script. The script assumes the list
>files are the only files in the directory _without_ a period in the name.
>
>#! /usr/bin/perl
>
>chdir "/var/lib/majordomo/lists/testdir";
>@listnames = `ls`;
>@lists = grep (!/\./, @listnames);
>unlink 'lists.out';
>
>for my $list (@lists)
> {
> chomp $list;
> open LISTFILE, $list;
> print $list."\n";
> @fileaddresses = ();
>
> while (<LISTFILE>)
> {
> chomp;
> ($account, $host) = split (/\@/, $_);
> push @fileaddresses, lc($host)."@".lc($account)."\n";
> }
>
> @sortedaddresses = sort @fileaddresses;
> open OUTFILE, ">>sortedlist.out";
>
> for my $sortedaddress (@sortedaddresses)
> {
> chomp $sortedaddress;
> ($sortedhost, $sorteddest) = split (/\@/, $sortedaddress);
> print OUTFILE $sorteddest."@".$sortedhost."\n";
> }
> close OUTFILE;
>
> `mv sortedlist.out $list`;
> unlink "sortedlist.out";
> }
>
>All comments/suggested improvements are welcome.
>
>Bill Anderson
>MIS Network Administrator
>MO Dept of Economic Development
Follow-Ups:
References:
|
|