WWW::Yandex::PDD - Perl extension for Yandex mailhosting
Obtain token at https://pddimp.yandex.ru/get_token.xml?domain_name=yourdomain.ru
use WWW::Yandex::PDD; my $pdd = WWW::Yandex::PDD->new( token => 'abcdefghijklmnopqrstuvwxyz01234567890abcdefghijklmnopqrs' ); $pdd->create_user( 'mynewuser', 'mysecretpassword' );
WWW::Yandex::PDD allows to manage user mail accounts on Yandex mailhosting
Construct a new WWW::Yandex::PDD object
$token A string obtained at L<http://api.yandex.ru/pdd/doc/api-pdd/reference/get-token.xml#get-token> $cert_file New $ENV{HTTPS_CA_FILE} value
Returns undef if there was no error; otherwise
$return = { code => $error -> {code}, info => $error -> {info}, };
Sign up $domain for Yandex Mail API
Returns undef if error, otherwise
$return = { name => $domain_name, secret_name => $secret_name, secret_value => $secret_value, }
Disconnect this $domain
Returns 1 if success, undef if error
Adds logo from $file_name (jpg, gif, png; < 2 Mb) to $domain.
$return = { name => $domain_name, logo_url => $logo_url, };
Removes logo from $domain
$return = { name => $domain_name, }
Adds new administrator $login for domain $domain.
Note: $login should be a separate mail box hosted on yandex.ru outside of $domain. For example, if you are adding foobar@yandex.ru, $login is 'foobar'
$return = { name => 'somedomain.org', new_admin => 'foobar', }
Removes $login from domain $domain administrators.
$return = { name => 'somedomain.org', deleted => 'foobar', }
Returns a list of secondary $domain administrators.
$return = { name => 'somedomain.org', other_admins => [ 'admin', 'anotheradmin' ], }
Sets address $login@$domain as a default address. All mail to non-existing addresses will route to this poor guy.
$login
$domain
$return = { name => 'somedomain.org', email => 'johndoe', }
$encrypted_password is MD5-CRYPT password hash: "$1$" + 8 character salt [a-zA-Z0-9./] + "$" + 22 character checksum [a-zA-Z0-9./]
See $pdd-get_user> for parameters meaning
Returns UID if success, undef otherwise
Optional $domain if $login is in another domain
Returns 1 if success
Returns number of unread messages, undef if error
Returns undef if fail, or the following structure if success:
$result = { domain => 'mydomain.org', login => 'username', birth_date => '1900-01-01', iname => 'John', fname => 'Doe', hintq => 'Your mother\'s maiden name?', # utf-8 hinta => '*****', mail_format => '', # preferred mail format charset => '', # preferred charset nickname => 'johnny', sex => 1, # 0 - N/A, 1 - male, 2 - female enabled => 1, # 1 - normal, mail accepted; 0 - locked, mail rejected signed_eula => 1, # user accepted EULA: 1 - yes, 0 - no };
Returns domain information and user list, undef if error
$page Page number. $per_page Number of mailbox records on a single page; cannot be more than 100; 100 records by default. $result = { 'action-status' => '', # error message 'found' => 18, # number of users returned 'total' => 18, # total number of users in this domain 'domain' => 'mydomain.org', 'status' => 'added', # added, mx-activate, domain-activate 'emails-max-count' => 1000, # maximum users for this domain 'emails' => [ 'jdoe', 'mkay' ], # user list }
Returns 1 if exists, 0 if doesn't exist, undef if error
Sets forwarding to $forward_to
$save_copy: "yes", "no"
Returns 1 if OK, undef if error
Returns undef if error
Returns full description of forward rules for $login:
$result = { filter_id => 12342343, enabled => 'yes', # 'yes' / 'no' forward => 'yes', # 'yes' / 'no' copy => 'no', # 'yes' / 'no' to_address => 'sameuser@otherdomain.org', }
Removes forward for user $login, forward rule $filter_id. Returns undef if error.
Set import options for the domain
$method: 'pop3', 'imap', default 'pop3' $port: 100 POP3 w/o SSL, 995 POP3 with SSL; optional $use_ssl: 'yes'/'no'; default 'no' $callback: URL. If not empty, an HTTP request will be made to this address with login="imported user's login" parameter after finishing import
Register a new user and import all the mail from another server
$ext_login login on the source server, defaults to $login $ext_password user's password on the source server, defaults to $password $forward_to optional, set forwarding for this new mailbox $save_copy works only if forwarding is on; 0 - do not save copies in the local mailbox, 1 - save copies and forward
Returns: { last_check => $last_check, imported => $imported, state => $state };
$ext_login login on the source, defaults to $login $password on the source
$ext_login login on the source, defaults to $login $ext_password password on the source $password in the domain, mandatory if $login is a new user $copy_one_folder folder on the source; UTF-8, optional
Creates a new mailbox $login. Messages to this mailbox will be sent to all $domain users
$return = { name => 'somedomain.org', }
Deletes previously created list and mailbox $login
http://pdd.yandex.ru/ http://api.yandex.ru/pdd/doc/api-pdd/api-pdd.pdf http://api.yandex.ru/pdd/doc/api-pdd/concepts/general.xml
Setting ALUCK_TRACE environment variable to some debug file name causes WWW::Yandex:PDD to turn on internal debugging, and put in this file server XML responses.
ALUCK_TRACE
dctabuyz, <dctabuyz at ya.ru> Andrei Lukovenko, <aluck at cpan.org>
Please report any bugs or feature requests to bug-www-yandex-pdd at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=WWW-Yandex-PDD. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-www-yandex-pdd at rt.cpan.org
Original version by dctabuyz: https://github.com/dctabuyz/Yandex-API-PDD.perl
You can find documentation for this module with the perldoc command.
perldoc WWW::Yandex::PDD
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
http://rt.cpan.org/NoAuth/Bugs.html?Dist=WWW-Yandex-PDD
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/WWW-Yandex-PDD
CPAN Ratings
http://cpanratings.perl.org/d/WWW-Yandex-PDD
Search CPAN
http://search.cpan.org/dist/WWW-Yandex-PDD/
Copyright (c) 2010 <dctabuyz at ya.ru> Copyright (c) 2013 <aluck at cpan.org> This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.7 or, at your option, any later version of Perl 5 you may have available.
To install WWW::Yandex::PDD, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WWW::Yandex::PDD
CPAN shell
perl -MCPAN -e shell install WWW::Yandex::PDD
For more information on module installation, please visit the detailed CPAN module installation guide.