[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cobalt-users] Get email addresses for all users
- Subject: Re: [cobalt-users] Get email addresses for all users
- From: Jeff Bilicki <jeff@xxxxxxxxxxx>
- Date: Thu Jun 26 08:05:01 2003
- List-id: Mailing list for users to share thoughts on Sun Cobalt products. <cobalt-users.list.cobalt.com>
>> Create a mailing list on the main site with the output from
>> "ls -m /home/spool/mail" as the user list.
>>
>> On a raq4 the mailboxes are stored at /home/spool/mail
>> Not sure on RaQ 550.
>>
>> - Bill
> Bill,
> Must be different on a 550. That directory is virtually empty, except for
> one name. This box was upgraded from an XTR using CMU, not sure if that is
> why it is not populated.
> It did lead to some ideas of how to get the names though, thanks!
On the RaQ550 mail spools are stored in the users home dir.
Here is a little script to do what you want, you can also grab it from:
ftp://ftp-eng.cobalt.com/pub/users/jeffb/scripts/getUsersRaQ550.pl
Jeff-
#!/usr/bin/perl
# list all the email addresses for users, it will give the fqdn of the user
# skip root level users
use lib "/usr/sausalito/perl";
use strict;
use CCE;
my $cce = new CCE;
$cce->connectuds();
my @oids = $cce->find('User');
my ($ok, $obj, $out);
foreach my $oid (@oids) {
($ok, $obj) = $cce->get($oid);
if(!$obj->{site}) { next; }
$out .= $obj->{name};
($oid) = $cce->find('Vsite', { 'name' => $obj->{site} });
($ok, $obj) = $cce->get($oid);
$out .= '@'.$obj->{fqdn}.',';
}
print $out, "\n";
$cce->bye("Ticking away the moments that make up a dull day");
exit 0;