On 10:37 AM 10/21/2006 -0400, it would appear that Micheal Espinola Jr wrote:
Charles Marcus wrote:
> Ack! In the REGISTRY?! What MTA is that?? What a horrible, horrible
> implementation. My first suggestion would be to change MTA's asap... it
> would be my firstmost topmost priority...
I concur. If you can, change whatever settings are necessary to not
store that information in the system Registry. Your disaster recovery
is more complicated than it should be be, if you don't have to store
that in the Registry.
I'm going to guess that the MTA in question is Imail. Storing the
list in the Registry is just fine for a small server with low user
turn over. Exporting the Imail Registry structure to a .reg file
each night is trivial and just as trivial to restore as any other
backed-up data.
For a large user base with high turn over, the Registry is not
recommended and such applications invariably use the external database option.
In answer to the original poster's question: If you are using Imail,
Matti has provided a script which will pull the needed data from the
Registry. Guy Deslauriers modified and since I can't find his email
in the archive, I've quoted it below and attached the script.
Attached is the script to extract the users that Matti was talking
about. I modified it (quick and dirty) to include the Aliases
(dlist) as well. It worked perfectly for me, but with only 5
domains though. The last line of the script simply counts the
number of users added, you can remove it once you're comfortable
with the script as it will add a line in the output file if you don't.
Tyran Ormond
Programmer/LAN Administrator
Central Valley Water Reclamation Facility
[EMAIL PROTECTED]
use Win32::Registry;
my $debug = 0;
my $ImailDomainBase = 'SOFTWARE\Ipswitch\IMail\Domains';
$keydoo= "\\users\\_aliases";
$count = 0;
my %RegType = (
0 => 'REG_0',
1 => 'REG_SZ',
2 => 'REG_EXPAND_SZ',
3 => 'REG_BINARY',
4 => 'REG_DWORD',
5 => 'REG_DWORD_BIG_ENDIAN',
6 => 'REG_LINK',
7 => 'REG_MULTI_SZ',
8 => 'REG_RESOURCE_LIST',
9 => 'REG_FULL_RESOURCE_DESCRIPTION',
10 => 'REG_RESSOURCE_REQUIREMENT_MAP');
my (@aLocalUsers, @aDomainList, $domain, $value, $user,
$kDomainList,$kDomainUsers);
$HKEY_LOCAL_MACHINE->Open($ImailDomainBase,$kDomainList)|| die $!;
$kDomainList->GetKeys([EMAIL PROTECTED]);
foreach $domain (@aDomainList){
if ($debug){
print
"-----------------------------------------------------------------------------\n";
}
if ($HKEY_LOCAL_MACHINE->Open($ImailDomainBase.'\\'.$domain.'\Users',
$kDomainUsers)){
@aUsersList = ();
$kDomainUsers->GetKeys([EMAIL PROTECTED]);
foreach $value (@aUsersList){
if ($value eq '_aliases'){
%vals = ();
$ImailDomainBase = "SOFTWARE\\Ipswitch\\IMail\\Domains\\";
$main::HKEY_LOCAL_MACHINE->Open($ImailDomainBase."$domain"."$keydoo",
$Aliases) || die "Open: $!";
$Aliases->GetValues(\%vals);
foreach $k (keys %vals) {
$key = $vals{$k};
$aliases = $$key[0].'@'.$domain;
push(@aLocalUsers,$aliases);
}
}
elsif ($value ne '_aliases' && $value ne 'root'){
$user = $value.'@'.$domain;
if ($debug){
print "$user\n";
}
push(@aLocalUsers,$user);
}
}
$kDomainUsers->Close();
}
break;
}
$kDomainList->Close();
if ($debug){
print
"========================================================================================================\n";
}
foreach $user (@aLocalUsers){
print "$user\n";
$count++;
}
print "$count records imported\n";
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Assp-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/assp-user