Net::Axigen - Perl extension for Gecad Technologies Axigen Mail Server (www.axigen.com).


Net-Axigen documentation  | view source Contained in the Net-Axigen distribution.

Index


Net::Axigen - Perl extension for Gecad Technologies Axigen Mail Server (www.axigen.com). This module use Axigen CLI interface.

DESCRIPTION

Top

Module Net::Axigen is intended for creation and removal of domains, accounts, handle of quotas, and also execution of other necessary operations on handle of a Gecad Technologies Axigen Mail Server.

Operation with a mail server is carried out by means of Telnet protocol with Net::Telnet module usage.

Note: Gecad Technologies do not offer support and should not be contacted for support regarding the Perl module Net::Axigen. Gecad Technologies and the author of the Net::Axigen module do not take full responsibility in case of miss-usage of the Perl module or for any damage caused in this matter.

SYNOPSIS

Top

Connections

	use Net::Axigen;
	my $axi = Net::Axigen->new('127.0.0.1', 7000, 'admin', 'password', 10);
	$axi->connect();
	...
	my $rc=$axi->close();

Axigen Mail Server and OS version

	my ($version_major, $version_minor, $version_revision)=$axi->get_version();
	my ($os_version_full, $os_name, $os_version_platform)=$axi->get_os_version();

Domains

	$axi->createDomain($domain, $postmaster_password, $maxFiles);
	$axi->unregisterDomain('my-domain.com');
	$axi->registerDomain('my-domain.com');

	my $domain_list = $axi->listDomains();
	foreach my $ptr(@$domain_list) { print "$ptr\n"; }

	my $domain_info = $axi->listDomainsEx();
	print "Domain \t\tUsed\tTotal\n";
	foreach my $domain( sort keys %$domain_info) 
	{
	  print "$domain:\t".$domain_info->{ $domain }->{used}."\t".$domain_info->{ $domain }->{total}."\n"; 
	}

Accounts

	my $account_list = $axi->listAccounts('my-domain.com');
	foreach my $ptr(@$account_list) { print "$ptr\n"; }

  my $account_list = $axi->listAccountsEx($domain);
  print "Account \t\tFirst Name\tSecond Name\n";
  foreach my $acc( sort keys %$account_list) 
  {
     print "$acc\t".$account_list->{ $acc }->{firstName}."\t".$account_list->{ $acc }->{lastName}."\n"; 
  }

	$axi->addAccount($domain, $user, $password);
	$axi->removeAccount($domain, $user);

	$axi->setAccountContactData($domain, $user, $firstName, $lastName);
	$axi->setQuotaLimitNotification($domain, $user, $notificationSubject, $notificationMsg);
	$axi->setAccountPassword($domain, $user, $password);

Quotas

	my $quota = 
	{ 
	  maxAccounts => 10, # admin limits
	  maxAccountMessageSizeQuota => 200000, # admin limits
	  maxPublicFolderMessageSizeQuota => 300000, # admin limits
	  messageSize => 20000, # domain quota
	  totalMessageSize => 200000 # domain quota
	};
	$axi->setDomainQuotas($domain, $quota);

	# $domain - the domain in which the account will be removed;
	# $quota - quota hash ptr

Storage Files

	$axi->compactAll($domain);
	$axi->compactAllDomains();

SAMPLES

Top

Samples of usage of the Net::Axigem module are in folder Net-Axigen\samples

	samples/domain_create.pl
	samples/domain_unregister.pl
	samples/domain_register.pl
	samples/add_account.pl
	samples/remove_account.pl
	samples/compact_domains.pl
	samples/accounts_info.pl
	samples/io_exception_dbg.pl

METHODS

Top

new()

Instantiates a new instance of a Net::Axigen.

 my $axi = Net::Axigen->new($host, $port, $user, $password, $timeout);

 # $host - Mail Server host
 # $port - CLI connection port
 # $user - CLI admin user
 # $password - admin password
 # $timeout - Telnet timeout

connect()

Connect to Axigen Mail Server

 $axi->connect();

close()

Close Axigen Mail Server connection

 my $rc=$axi->close();

get_version()

Get Axigen mail Server Version

 my ($version_major, $version_minor, $version_revision)=$axi->get_version();

get_os_version()

Get OS Version

 my ($os_version_full, $os_name, $os_version_platform)=$axi->get_os_version();

listDomains()

List all domains, registered on Axigen Mail Server

 my $domain_list = $axi->listDomains();
 foreach my $ptr(@$domain_list) { print "$ptr\n"; }

listDomainsEx()

List all domains, registered on Axigen Mail Server, get the total and used size

 my $domain_info = $axi->listDomainsEx();
 print "Domain \t\tUsed\tTotal\n";
 foreach my $domain( sort keys %$domain_info)
 {
  print "$domain:\t".$domain_info->{ $domain }->{used}."\t".$domain_info->{ $domain }->{total}."\n"; 
 }

createDomain()

Create domain.

 $axi->createDomain($domain, $postmaster_password, $maxFiles);

 # $domain - created domain name;
 # $postmaster_password - password for postmaster@domain account;
 # $maxFiles - Max quantity of domain storage files (filesize 256 Mbyte)

registerDomain()

Register unregistered domain.

 $axi->registerDomain($domain);
 # $domain - registered domain name;

unregisterDomain()

Unregister domain.

 $axi->unregisterDomain($domain);
 # $domain - unregistered domain name;

setDomainQuotas()

Set domain quotas.

 my $quota = 
 { 
   # Maximum quantity of mail boxes (admin limit)
   maxAccounts => 10, 

   # The maximum size of mail boxes (admin limit)
   maxAccountMessageSizeQuota => 20000,

   # The maximum size of Public Folders (admin limit)
   maxPublicFolderMessageSizeQuota => 30000,

   # The maximum size mail messages (domain quota)
   messageSize => 20000,

   # The maximum size of mail boxes (domain quota)
   totalMessageSize => 200000
 };
 $axi->setDomainQuotas($domain, $quota);

 # $domain - the domain in which the account will be removed;
 # $quota - quota hash ptr

setQuotaLimitNotification()

Set account quota limit notification - subject and message.

 $axi->setQuotaLimitNotification($domain, $user, $firstName, $lastName);

 # $domain - the domain in which the account will be removed;
 # $user - account name;
 # $notificationSubject - subject; 
 # $notificationMsg - message




listAccounts()

List all domain accounts.

 my $account_list = $axi->listAccounts('my-domain.com');
 foreach my $ptr(@$account_list) { print "$ptr\n"; }

listAccountsEx()

List all domain accounts whith contact information.

 my $account_list = $axi->listAccountsEx($domain);
 print "Account \t\tFirst Name\tSecond Name\n";
 foreach my $acc( sort keys %$account_list) 
 {
   print "$acc\t".$account_list->{ $acc }->{firstName}."\t".$account_list->{ $acc }->{lastName}."\n"; 
 }

addAccount()

Add account.

 $axi->addAccount($domain, $user, $password);

 # $domain - the domain in which the account will be added;
 # $user - account name;
 # $password - account password

removeAccount()

Remove account.

 $axi->removeAccount($domain, $user);

 # $domain - the domain in which the account will be removed;
 # $user - account name

setAccountContactData()

Set account contact data - first name, last name.

 $axi->setAccountContactData($domain, $user, $firstName, $lastName);

 # $domain - the domain in which the account will be removed;
 # $user - account name;
 # $firstName - first name; 
 # $lastName - last name

setAccountPassword()

Set account password.

 $axi->setAccountPassword($domain, $user, $password);

 # $domain - the domain in which the account will be removed;
 # $user - account name;
 # $password - new password 

setAccountWebMailLanguage()

Set account WebMail Language.

 $axi->setAccountWebMailLanguage($domain, $user, $lang);

 # $domain - the domain in which the account will be removed;
 # $user - account name;
 # $lang - language 

saveConfig()

Save Axigen config file.

 $axi->saveConfig();

compactAll()

Compact domain storage files.

 $axi->compactAll($domain);

compactAllDomains()

Compact all domains storage files.

 $axi->compactAllDomains();

to_utf8()

Convert to utf-8.

 $axi->to_utf8($src);

SEE ALSO

Top

Gecad Technologies Axigen Mail Server Site: http://www.axigen.com

AUTHOR

Top

Alexandre Frolov, <alexandre@frolov.pp.ru>

COPYRIGHT AND LICENSE

Top


Net-Axigen documentation  | view source Contained in the Net-Axigen distribution.