},
;
+tie my %communigate_pro_singledomain_options, 'Tie::IxHash',
+ 'port' => { label=>'Port number', default=>'106', },
+ 'login' => { label=>'The administrator account name. The name can contain a domain part.', },
+ 'password' => { label=>'The administrator account password.', },
+ 'domain' => { label=>'Domain', },
+ 'accountType' => { label=>'Type for newly-created accounts',
+ type=>'select',
+ options=>[qw( MultiMailbox TextMailbox MailDirMailbox )],
+ default=>'MultiMailbox',
+ },
+ 'externalFlag' => { label=> 'Create accounts with an external (visible for legacy mailers) INBOX.',
+ type=>'checkbox',
+ },
+ 'AccessModes' => { label=>'Access modes',
+ default=>'Mail POP IMAP PWD WebMail WebSite',
+ },
+;
+
tie my %bind_options, 'Tie::IxHash',
#'machine' => { label=>'named machine' },
'named_conf' => { label => 'named.conf location',
'notes' => 'Real time export to a <a href="http://www.stalker.com/CommuniGatePro/"> mail server. The <a href="http://www.stalker.com/CGPerl/">CommuniGate Pro Perl Interface</a> must be installed as CGP::CLI.',
},
+ 'communigate_pro_singledomain' => {
+ 'desc' => 'Real-time export to a CommuniGate Pro mail server, one domain only',
+ 'options' => \%communigate_pro_singledomain_options,
+ 'nodomain' => 'Y',
+ 'notes' => 'Real time export to a <a href="http://www.stalker.com/CommuniGatePro/"> mail server. This is an unusual export to CommuniGate Pro that forces all accounts into a single domain. As CommuniGate Pro supports multiple domains, unless you have a specific reason for using this export, you probably want to use the communigate_pro export instead. The <a href="http://www.stalker.com/CGPerl/">CommuniGate Pro Perl Interface</a> must be installed as CGP::CLI.',
+ },
+
},
'svc_domain' => {
sub rebless { shift; }
+sub export_username {
+ my($self, $svc_acct) = (shift, shift);
+ $svc_acct->email;
+}
+
sub _export_insert {
my( $self, $svc_acct ) = (shift, shift);
my @options = ( $svc_acct->svcnum, 'CreateAccount',
- 'accountName' => $svc_acct->email,
+ 'accountName' => $self->export_username($svc_acct),
'accountType' => $self->option('accountType'),
'AccessModes' => $self->option('AccessModes'),
'RealName' => $svc_acct->finger,
#my $jobnum = $err_or_queue->jobnum;
$self->communigate_pro_queue( $new->svcnum, 'SetAccountPassword',
- $new->email, $new->_password )
+ $self->export_username($new), $new->_password )
if $new->_password ne $old->_password;
}
sub _export_delete {
my( $self, $svc_acct ) = (shift, shift);
$self->communigate_pro_queue( $svc_acct->svcnum, 'DeleteAccount',
- $svc_acct->email,
+ $self->export_username($svc_acct),
);
}
sub _export_suspend {
my( $self, $svc_acct ) = (shift, shift);
$self->communigate_pro_queue( $svc_acct->svcnum, 'UpdateAccountSettings',
- 'accountName' => $svc_acct->email,
+ 'accountName' => $self->export_username($svc_acct),
'AccessModes' => 'Mail',
);
}
sub _export_unsuspend {
my( $self, $svc_acct ) = (shift, shift);
$self->communigate_pro_queue( $svc_acct->svcnum, 'UpdateAccountSettings',
- 'accountName' => $svc_acct->email,
+ 'accountName' => $self->export_username($svc_acct),
'AccessModes' => $self->option('AccessModes'),
);
}
--- /dev/null
+package FS::part_export::communigate_pro_singledomain;
+
+use vars qw(@ISA);
+use FS::part_export::communigate_pro;
+
+@ISA = qw(FS::part_export::communigate_pro);
+
+sub export_username {
+ my($self, $svc_acct) = (shift, shift);
+ $svc_acct->username. '@'. $self->option('domain');
+}
FS/part_export/bind_slave.pm
FS/part_export/bsdshell.pm
FS/part_export/communigate_pro.pm
+FS/part_export/communigate_pro_singledomain.pm
FS/part_export/cp.pm
FS/part_export/cyrus.pm
FS/part_export/domain_shellcommands.pm