• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion
  • Inviting everyone to the UX test of a new security feature in the WP Toolkit
    For WordPress site owners, threats posed by hackers are ever-present. Because of this, we are developing a new security feature for the WP Toolkit. If the topic of WordPress website security is relevant to you, we would be grateful if you could share your experience and help us test the usability of this feature. We invite you to join us for a 1-hour online session via Google Meet. Select a convenient meeting time with our friendly UX staff here.

Mass mailbox import

scool

Basic Pleskian
Hello everyone..
Installed plesk 10.3 on Centos successfully

We need to import 400 mailboxes on that server.
i have done several searches here on parallels forums and KB , but without finding a clear and easy procedure for completing that task.

The only answer closer to my problem is this one.
http://forum.parallels.com/showthread.php?t=95227

ok, i downloaded the perl script on the attached file, modified the sample template (http://download1.parallels.com/Plesk/PPP9/Doc/en-US/plesk-9.2-api-rpc/index.htm?fileName=34502.htm), and then i am trying to run the script.

but nothing happens, no error message or anything else. am i missing something here?
 
Could you please provide more details? How exactly you have run this script? What sort of output?
 
i just copy paste your command
cat req.xml | perl api.pl Plesk_server_IP Plesk_admin_password

and it ends like that
</create>
</mail>
</packet>
----- RESULT ------------------------


nothing more
 
Did you replaced "Plesk_server_IP" with real server IP address and "Plesk_admin_password" with real Plesk admin password?
 
Could you please post full output of this command here?
 
I have checked your request. You shouldn't write name of mailbox with @domain.com Only name of mailbox is enough because you have already specified domain in request by

<domain_id>1</domain_id>

Try it.
 
Ok, we have found a solution.
Import mass mailbox on plesk 10.3
My system is Centos 5.7 64bit with plesk 10.3.1.

I wanted to mass import on plesk about 500 mailbox.
This is the "how to" with the great assistance of IgorG who provided the php script.
dont use <crypt> string because on plesk10 encrypted passwords are not supported.
The script will run successfully but your users will not be able to login with pop3/imap neither on webmail.
http://kb.parallels.com/en/112508

You can find your domain id on the psa database.


<?php

$host="pleskip";
$login="pleskusername";
$passwd="pleskpassword";
$port=8443;

$data = <<<EOF
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<packet version="1.4.2.0">
<mail>
<create>
<filter>
<domain_id>1</domain_id>
<mailname>
<name>bgiatagana</name>
<mailbox>
<enabled>true</enabled>
</mailbox>
<password>00014</password>
<permissions>
<cp_access>true</cp_access>
</permissions>
</mailname>
</filter>
</create>
</mail>
</packet>
EOF;

function write_callback($ch, $data) {
echo $data;
return strlen($data);
}

function sendCommand($data, $login, $passwd, $host, $port=8443) {
$script = "enterprise/control/agent.php";
$url = "https://$host:$port/$script";
$headers = array(
"HTTP_AUTH_LOGIN: $login",
"HTTP_AUTH_PASSWD: $passwd",
"HTTP_PRETTY_PRINT: TRUE",
"Content-Type: text/xml",
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_HTTPHEADER, &$headers);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_WRITEFUNCTION, write_callback);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
$result = curl_exec($ch);
if (!$result) {
echo "\n\n-------------------------\ncURL error number:".curl_errno($ch);
echo "\n\ncURL error:".curl_error($ch);
}
curl_close($ch);
return;
}
sendCommand($data, $login, $passwd, $host, $port);

?>



Just run it with

# php api.php
 
Last edited:
Hello,
Question,
Plesk 11 needs a different type format?

i receive the following error
<errtext>Unable to find password_type node</errtext>
 
Back
Top