• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Resolved 255 during post-install.php exec-call

lippoliv

Basic Pleskian
Hey there,
I would like to use exec in post-install.php to register and mailhandler (see https://talk.plesk.com/threads/extension-dev-handling-mails.338811/).

But I get:

Code:
root@v22016081573736335:~# plesk bin extension -i /root/PMSP-0.1-2.zip
exit status 255
exit status 255
The extension was successfully installed.

Also using "su" doesnt help (ask for password).

Heres the Script

PHP:
<?php
exec("plesk sbin mail_handlers_control --add --priority 50 --queue=before-queue --type global --executable /opt/psa/admin/htdocs/modules/PMSP/mail-handler.sh --enabled --name PMSP");
exec("plesk sbin mail_handlers_control --add --priority 50 --queue=before-sendmail --type global --executable /opt/psa/admin/htdocs/modules/PMSP/mail-handler.sh --enabled --name PMSP");

What can I do to make this work?
 
Last edited:
Another try would be this script

PHP:
<?php
pm_ApiCli::call('mail_handlers_control', array('--add', '--priority', '50', '--queue=before-queue', '--type', 'global', '--executable', '/opt/psa/admin/htdocs/modules/PMSP/mail-handler.sh', '--enabled', '--name', 'PMSP'));
pm_ApiCli::call('mail_handlers_control', array('--add', '--priority', '50', '--queue=before-sendmail', '--type', 'global', '--executable', '/opt/psa/admin/htdocs/modules/PMSP/mail-handler.sh', '--enabled', '--name', 'PMSP'));

but the output is

Code:
root@v22016081573736335:~# plesk bin extension -i /root/PMSP-0.1-2.zip
[2016-09-02 11:49:28] ERR [panel] Command mail_handlers_control not found.:
0: /opt/psa/admin/plib/pm/ApiCli.php:48
        pm_ApiCli::call(string 'mail_handlers_control', array)
1: /opt/psa/admin/plib/modules/PMSP/scripts/post-install.php:2
Executing /opt/psa/admin/plib/modules/PMSP/scripts/post-install.php failed: ERROR: pm_Exception: Command mail_handlers_control not found. (ApiCli.php:48)<br />
<br><a href='http://kb.plesk.com/plesk-error/search?metaId=014c82550048c73ab6e939c698d578d7&messageId=db667ae13bded9f6410a2ea7a084522e&file=ApiCli.php&line=48&type=pm_Exception&version=12.5.30&message=Command+mail_handlers_control+not+found.' target='_blank'>Search for related Knowledge Base articles</a>

exit status 1
 
OK got it, "callSbin" has to be used here :)

PHP:
<?php
pm_ApiCli::callSbin('mail_handlers_control', array('--add', '--priority', '50', '--queue=before-queue', '--type', 'global', '--executable', '/opt/psa/admin/htdocs/modules/PMSP/mail-handler.sh', '--enabled', '--name', 'PMSP'));
pm_ApiCli::callSbin('mail_handlers_control', array('--add', '--priority', '50', '--queue=before-sendmail', '--type', 'global', '--executable', '/opt/psa/admin/htdocs/modules/PMSP/mail-handler.sh', '--enabled', '--name', 'PMSP'));
 
Back
Top