Hi,
Create a script name: list_all_protected_email_aliases.pl
to list all protected email aliases in CODB
usage: ./list_all_protected_email_aliases.pl | grep admin
#!/usr/bin/perl -w -I/usr/sausalito/perl -I/usr/sausalito/handlers/base/vsite
# list all admin alias
# by patricko, 2006 Sept 20th
use CCE;
use strict;
my $cce = new CCE;
$cce->connectuds();
my @ProtectedEmailAliaslist;
my $hostname=`hostname`;
chomp($hostname);
@ProtectedEmailAliaslist = $cce->findx('ProtectedEmailAlias');
foreach my $vobject (@ProtectedEmailAliaslist) {
my $action = "";
my $OID = "";
my $fqdn = "";
my ($ok, $object, $old, $new) = $cce->get($vobject);
$action="${%{$object}}{'action'}";
$OID="${%{$object}}{'OID'}";
$fqdn="${%{$object}}{'fqdn'}";
print "OID: $OID, name: $action, fqdn: $fqdn\n";
}
$cce->bye('SUCCESS');
exit(0);
Cheers
patrick
(for hire)
On Wed, 20 Sep 2006 20:18:12 +0800
patricko <patricko (at mark) staff.singnet.com.sg> wrote:
> Hi,
>
>
> Actually, entries in virtusertable will not have any ill-effect.
> You can ignore 'removing entries from virtusertable'
>
>
> Cheers
> patrick
> (for hire)
>
>
>
>
> On Wed, 20 Sep 2006 20:11:54 +0800
> patricko <patricko (at mark) staff.singnet.com.sg> wrote:
>
> > Hi,
> >
> >
> > *** For those who have production setup and cannot get admin alias to work. ***
> >
> >
> > There is one critical step missing.
> >
> > After editing Vsite.pm and remove admin alias in virtusertable,
> > (missing: ) you need to remove the admin alias entry in CODB!
> >
> >
> > ie:
> >
> > >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> >
> > /usr/sausalito/bin/cceclient
> > classes
> > 110 CLASS User
> > 110 CLASS Package
> > 110 CLASS Capabilities
> > 110 CLASS ActiveMonitor
> > 110 CLASS ServiceQuota
> > 110 CLASS Route
> > 110 CLASS Schedule
> > 110 CLASS FtpSite
> > 110 CLASS DnsSlaveZone
> > 110 CLASS DnsSOA
> > 110 CLASS UserServices
> > 110 CLASS JavaWar
> > 110 CLASS Bandwidth
> > 110 CLASS DnsRecord
> > 110 CLASS VirtualHost
> > 110 CLASS Disk
> > 110 CLASS ProtectedEmailAlias <<< --- LOOK HERE
> > 110 CLASS SWUpdateServer
> > 110 CLASS System
> > 110 CLASS VsiteServices
> > 110 CLASS MailList
> > 110 CLASS Vsite
> > 110 CLASS Network
> > 110 CLASS Workgroup
> > 110 CLASS CapabilityGroup
> > 110 CLASS EmailAlias
> > 110 CLASS IPPoolingRange
> > 201 OK
> >
> > ... < Find the entry through CODB query
> > ...
> > Find ProtectedEmailAlias fqdn = "domain.com"
> > ... blah blah
> > ...
> > ...
> >
> >
> > 102 DATA NAMESPACE = "" < eg: Found entry with OID 238
> > 102 DATA CLASSVER = "1.0"
> > 102 DATA build_maps = "1"
> > 102 DATA CLASS = "ProtectedEmailAlias"
> > 102 DATA action = "admin"
> > 102 DATA alias = "admin"
> > 102 DATA site = "site5"
> > 102 DATA OID = "238"
> > 102 DATA fqdn = "domain.com"
> > 102 DATA local_alias = "0"
> > 201 OK
> >
> >
> > DESTROY 238 < Remove Protected Email Alias with OID 238
> >
> > >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> >
> >
> > Done.
> > Working admin alias for your production server!
> >
> >
> >
> >
> > Cheers,
> > patrick
> > (for hire)
> >
> >
> >
> > On Sat, 1 Oct 2005 12:19:52 +0100
> > "Jason Humphrey" <jasonh (at mark) businessws.com> wrote:
> >
> > > Yes because the vsite was created before you changed the script you need to
> > > take out the line in /etc/mail/virtusertable that says:
> > > admin (at mark) domainyouwanttouseadminasaliasfor.com admin
> > > then run
> > > "makemap hash virtusertable.db <virtusertable"
> > > Jason
> > > -----Original Message-----
> > > From: William J.A. Brillinger [mailto:billy (at mark) pdcweb.net]
> > > Sent: 30 September 2005 21:04
> > > To: coba-e (at mark) bluequartz.org
> > > Subject: [coba-e:03091] Re: Admin alias for vsites in BQ
> > >
> > >
> > > Based on this info: http://www.depopo.net/idx/38/175/article/
> > >
> > > To undo the automatic creation of admin I did this...
> > >
> > > pico /usr/sausalito/handlers/base/vsite/Vsite.pm
> > > # Mail
> > > %DefaultAliases = (
> > > "MAILER-DAEMON", 1,
> > > "postmaster", 1,
> > > "sys", 1,
> > > "nobody", 1,
> > > "root", 1,
> > > # 'admin', 1 <--- commented out
> > > );
> > >
> > > cd /etc/mail
> > > cp virtusertable virtusertable.bak
> > > pico virtusertable
> > > [remove all the ailiases for 'admin']
> > > makemap hash virtusertable.db <virtusertable
> > >
> > >
> > > And then I went into the GUI and tried adding the alias 'admin' for a user
> > > and still got the error "Sorry, the email alias, admin, is already in use on
> > > this system..."
> > >
> > > Still missing something. :(
> > > - Bill
> > >
> > > At 01:28 PM 30/09/2005, you wrote:
> > >
> > > You can change the automatic creation by editing this file
> > > /usr/sausalito/handlers/base/vsite/Visite.pm
> > >
> > > See http://www.depopo.net/idx/38/175/article/ for the raq550 abuse fix
> > > and it shows where the script for automatic alias creation is.
> > > Hope this helps
> > > Jason
> > >
> > > -----Original Message-----
> > >
> > > From: William J.A. Brillinger [ mailto:billy (at mark) pdcweb.net]
> > >
> > > Sent: 30 September 2005 02:26
> > >
> > > To: coba-e (at mark) bluequartz.org
> > >
> > > Subject: [coba-e:03081] Admin alias for vsites in BQ
> > >
> > >
> > > Hi,
> > >
> > >
> > > On my raq4 I have several sites that have aliases for users "admin"
> > >
> > >
> > > Username: jthomas,
> > >
> > > Alias: webmaster, admin, john.thomas
> > >
> > >
> > > I notice on my NU-BQ+CentOS box, I cannot assign 'admin' as an alias.
> > >
> > >
> > > "Sorry, the email alias, admin, is already in use on this system.
> > > Please choose another. Email aliases were not created for this user. "
> > >
> > >
> > > Is this the correct behavior?
> > >
> > >
> > > ( ...time passes before sending this message... )
> > >
> > >
> > > I see in /etc/mail/virtusertable:
> > >
> > >
> > > # grep admin /etc/mail/virtusertable
> > >
> > > apache (at mark) localhost.localdomain adminadmin (at mark) localhost.localdomain
> > > admin
> > >
> > > root-admin (at mark) localhost.localdomain admin
> > >
> > > admin (at mark) www.thissite.ca admin
> > >
> > > admin (at mark) www.thatothersite.ca admin
> > >
> > >
> > > I see the server creates admin alias's all by itself :(
> > >
> > >
> > > Why is it this way?
> > >
> > > It certainly takes away some flexibility.
> > >
> > >
> > > - Bill
> > >
> > >
> > > ---------------------------------
> > >
> > > William J.A. Brillinger
> > >
> > > Precision Design Co.
> > >
> > >
> > > E-Mail: mailto:billy (at mark) pdcweb.net
> > >
> > > Web site: http://www.pdcweb.net
> > >
> > >
> > >
> > > ---------------------------------
> > > William J.A. Brillinger
> > > Precision Design Co.
> > >
> > > E-Mail: mailto:billy (at mark) pdcweb.net
> > > Web site: http://www.pdcweb.net
> > >
> > > --
> > > No virus found in this outgoing message.
> > > Checked by AVG Anti-Virus.
> > > Version: 7.0.344 / Virus Database: 267.11.9/116 - Release Date: 30/09/2005