[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [cobalt-users] Neomail
- Subject: RE: [cobalt-users] Neomail
- From: Robert Fitzpatrick <webmaster@xxxxxxxxxxx>
- Date: Thu Aug 30 12:58:08 2001
- List-id: Mailing list for users to share thoughts on Cobalt products. <cobalt-users.list.cobalt.com>
>
>I hacked my neomail to only show the domains that the user is
>setup to receive mail on in the virtusertable file. First,
>look for the line '### Get a list of valid style files', mine
>is on line 176 in the neomail-prefs.pl file. Just above that
>line, insert the following:
>
I found a bug in my code when and posted the update fix below in case anyone
has tried it (just replace the old with the new):
# BEGIN HACK
####################################
$virtmaps = "/etc/virtusertable";
open (VIRTMAPS,$virtmaps);
@virtmaps = <VIRTMAPS>;
close (VIRTMAPS);
$founduser = 0;
foreach $line (@virtmaps) {
($email,$to) = $line =~ /(.+)\s(.+)/o;
if ($to eq $user) {
$founduser = 1;
$email =~ s/\s//g;
if ($email !~ /^\#.*/ && $email ne "") {
($domain) = $email =~ /.*\@(.*)$/o;
$domain =~ s/^www\.//o;
if (!$domain) { $domain = $email; }
if ($domain =~ /\n$/) { chop ($domain); }
$domain =~ s/\s//g;
$domainexists = 0;
foreach $name (@domainnames) {
if ($name eq $domain) { $domainexists = 1;
last; }
}
if (!$domainexists) { push(@domainnames,$domain); }
}
}
}
$noDomains = @domainnames;
if ($founduser && $noDomains > 1) { shift(@domainnames); }
####################################
# END HACK
Make sure to back up the existing file before trying it.....!!!!
--
Robert Fitzpatrick