Net::OpenSRS::Email_APP -- Communicate using the OpenSRS Email Service Account Provisioning Protocol
Version 0.61
use strict; use Net::OpenSRS::Email_APP; my $app = new Net::OpenSRS::Email_APP(Environment=>'test', User=>'admin', Domain=>'example.com', Password=>'secret') || die "I encountered a problem: " . \ Net::OpenSRS::Email_APP::errstr(); $app->login(); my $rows = $app->get_company_domains(); foreach my $r (@$rows) { print "$r->{DOMAIN}\n"; } $app->quit();
"Net::OpenSRS::Email_APP" provides an object interface for communicating OpenSRS Email Service Account Provisioning Protocol (APP). For this module to be useful to you, you will need an OpenSRS reseller account, and MAC credentials. This module uses IO::Socket::SSL, thus depends upon its presence to function.
Creates a "Net::OpenSRS::Email_APP" object. "new" requires the User, Domain and Password arguments in key-value pairs. The following key-value pairs are accepted: Environment Either 'test' or 'production' - defaults to 'test' User User for login() to use Domain Domain for login() to use Password Password for login() to use
Attempt to login to OpenSRS APP
Close your APP connection
Set the debug level, debug output will optionally be returned using supplied callback If $debug_cb is not supplied, output will be emitted via STDERR
Returns an array containing the status code and status text from the last OpenSRS call Note: The status text may be undefined, you should test for this.
The privilege level of this mailbox Required: Domain Mailbox
Given a comma-seperated list of email addresses, provide a comma-seperated list of available alternatives Required: Mailbox_List
A list of all domains
Information about this domain Required: Domain
The allowed senders list for this domain Required: Domain
The blocked senders list for this domain Required: Domain
The name of the brand associated to this domain Required: Domain
The list of mailboxes for this domain Required: Domain
Counts of each mailbox type permitted to be configured for this domain Required: Domain
The list of workgroups for this domain Required: Domain
List the attributes and members of this mailing-list Required: Domain Group_Alias_Mailbox
Information about this mailbox (ONLY regular and filter-only mailboxes) Required: Domain Mailbox
The allowed senders list for this mailbox Required: Domain Mailbox
Information about this mailbox (INCLUDING forward-only and mailing-lists) Required: Domain Mailbox
The autoresponse state, text and attributes for this mailbox Required: Domain Mailbox
Supplying a comma-seperated list of users, indicate whether they already exist or not Required: Domain Mailbox_List
The blocked senders list for this mailbox Required: Domain Mailbox
Configured forwarding details for this regular mailbox Required: Domain Mailbox
Details for this forward-only mailbox Required: Domain Mailbox
List the suspension status of each service for this mailbox Required: Domain Mailbox
Counts of each mailbox type and whether a domain catch-all is configured Required: Domain
Add an alias pointing to another mailbox on this domain Required: Domain Alias_Mailbox Mailbox
Add a new domain Required: Domain Optional: Timezone Language FilterMX Spam_Tag Spam_Folder Spam_Level
Creates a domain aliased to this one Required: Domain Alias
The welcome message to send to each new user for this domain Required: Domain Welcome_Text Welcome_Subject From_Name From_Address Charset Mime_Type
Creates a mailing-list to the specified list of addresses Required: Domain Group_Alias_Mailbox Workgroup Alias_To_Email_CDL Optional: Spam_Level
Create a regular or filter-only mailbox Required: Domain Mailbox Workgroup Password Optional: FilterOnly First_Name Last_Name Phone Fax Title Timezone Lang Spam_Tag Spam_Folder Spam_Level
Creates an alias which forwards to any single address Required: Domain Mailbox Workgroup Forward_Email Optional: Spam_Level
Create a workgroup within this domain Required: Domain Workgroup
Delete this domain Required: Domain Optional: Cascade
Deletes this mailing-list Required: Domain Group_Alias_Mailbox
Delete this domain alias Required: Alias
Delete the welcome email for this domain Required: Domain
Deletes this regular or filter-only mailbox Required: Domain Mailbox
Deletes this mailbox (irrespective of type) Required: Domain Mailbox
Deletes this forward-only mailbox Required: Domain Mailbox
Delete a workgroup within this domain Required: Domain Workgroup Optional: Cascade
Change this domain's details Required: Domain (and at least one of the optionals) Optional: Timezone Language FilterMX Spam_Tag Spam_Folder Spam_Level
Alter this mailing-list Required: Domain Group_Alias_Mailbox (and one optional) Optional: Alias_To_Email_CDL Spam_Level
Alters this regular or filter-only mailbox Required: Domain Mailbox Optional: Workgroup Password FilterOnly First_Name Last_Name Phone Fax Title Timezone Language Spam_Tag Spam_Folder Spam_Level Note: When specifying FilterOnly, it may only be 'F' - you may change a filter-only mailbox to regular, but not the reverse.
Alters this forward-only mailbox Required: Domain Mailbox Forward_Email Optional: New_Mailbox_Name Spam_Level
Specify the domain administrator for this domain Required: Domain Mailbox Optional: State
Set the permitted sender list for this domain Required: Domain List
Set the blocked sender list for this domain Required: Domain List
Assign a brand for this domain Required: Domain Brand_Code
Set the mailbox to receive mail for any non-existent recipients Required: Domain (and one of the optionals) Optional: Mailbox State Note: OpenSRS will return Internal system error if you attempt to set State='T' on a domain which currently does not have a catch-all mailbox. OpenSRS have deprecated catch-all addresses.
Enable or disable this domain Required: Domain Disabled
Set the limit of each mailbox type which may be created on this domain Required: Domain Optional: Mailbox Filter_Only Alias Forward_Only Mailing_List
Grant or revoke administrative privileges for this mailbox Required: Domain Mailbox Optional: State
Set the permitted sender list for this mailbox Required: Domain Mailbox List
Set the blocked sender list for this mailbox Required: Domain Mailbox List
Configure autoresponse for this mailbox Required: Domain Mailbox (and at least one optional) Optional: State Text
Configure forwarding for this mailbox Required: Domain Mailbox (and at least one optional) Optional: Forward Keep_Copy State
Enable or disable services for this mailbox Required: Domain Mailbox Optional: SMTPIn SMTPRelay IMAP POP Webmail
Add or remove a workgroup administrator Required: Domain Mailbox Optional: State
Rename this regular mailbox and update all references to it Required: Domain Old_Mailbox New_Mailbox
Verify this mailbox's password Required: Domain Mailbox Password
Available offers for this mailbox Required: Domain Mailbox
The active offers for this mailbox Required: Domain Mailbox
Disables an active mailbox offer Required: Mailbox_Offering_ID
Activate the specified offer for this mailbox Required: Domain Mailbox Offering_ID Optional: Auto_Renew
The functions get_mailbox_status and set_mailbox_status are not implemented, OpenSRS have tagged these functions as being deprecated. Use get_mailbox_suspension and set_mailbox_suspension functions instead.
Mark Goldfinch, mark.goldfinch at modicagroup.com
mark.goldfinch at modicagroup.com
The internal functions _parse_single_row and _parse_multiple_rows currently make use some handwritten logic to correctly parse the rows as returned by APP. The OpenSRS supplied documentation includes an ABNF definition for the entire protocol. The handwritten logic could likely be replaced by Parser::RecDescent (or similar) logic. A hurdle to this is the left-resolving the supplied ABNF uses, Parser::RecDescent's design inhibits the use of left-resolving parsing. Patches are welcome to address this. My testing suggests the current handwritten logic is robust and functional however.
Other than presence of required arguments, no validation of supplied arguments is currently performed.
Otherwise please report any bugs or feature requests to bug-net-opensrs-email_app at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Net-OpenSRS-Email_APP.
bug-net-opensrs-email_app at rt.cpan.org
This implementation is based upon documentation from http://opensrs.com/docs/OpenSRS_APP_Dev_Guide.pdf dated December 14, 2010. Please read the pdf for greater detail about the protocol, required and returned values of each function.
You can find documentation for this module with the perldoc command.
perldoc Net::OpenSRS::Email_APP
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Net-OpenSRS-Email_APP
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Net-OpenSRS-Email_APP
CPAN Ratings
http://cpanratings.perl.org/d/Net-OpenSRS-Email_APP
Search CPAN
http://search.cpan.org/dist/Net-OpenSRS-Email_APP/
Github repository
https://github.com/goldie80/Net-OpenSRS-Email_APP
Thank you to Modica Group http://www.modicagroup.com/ for funding the development of this module.
Copyright 2011 Mark Goldfinch.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install Net::OpenSRS::Email_APP, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::OpenSRS::Email_APP
CPAN shell
perl -MCPAN -e shell install Net::OpenSRS::Email_APP
For more information on module installation, please visit the detailed CPAN module installation guide.