Git Product home page Git Product logo

Comments (12)

myvesta avatar myvesta commented on September 27, 2024 1

Postfix is not supported in Vesta.
Yes, everything is possible if you modify vesta scripts... but on next myVesta update your modified scripts will be overwitten... so... not good idea... except if you make your own fork.
Why not call sudo /usr/local/vesta/bin/v-add-mail-account from your PHP code instead to add mysql row?
Yes, in that case you need to remove shell_exec from disabled_functions in php.ini

from vesta.

myvesta avatar myvesta commented on September 27, 2024 1

Fun fuct:

  • you can remove disable_functions from in php.ini
  • and move disable_functions one level down, in pool.d config files
  • in domain that you need shell_exec just remove shell_exec from disable_functions (it can be some subdomain dedicated only for work with Vesta commands)

Bonus pack:

  • php scripts in /usr/local/vesta/web/custom/ folder WILL NOT be overrided nor removed.
    So you can also put script under the myVesta, just you will have php 5.6 :)
    shell_exec is enabled there.

from vesta.

myvesta avatar myvesta commented on September 27, 2024 1

Third solution - you can send POST request (from your PHP) to https://yourhost:8083/api/index.php πŸ˜„
Just first enable it - https://wiki.myvestacp.com/index.php?title=Why_API_is_not_working%3F

from vesta.

myvesta avatar myvesta commented on September 27, 2024 1

exec ("VESTA=/usr/local/vesta && export VESTA && sudo /usr/local/vesta/bin/v-list-mail-accounts admin domain.com", $output, $return_var);

tested, works πŸ˜‰

from vesta.

darkworks avatar darkworks commented on September 27, 2024

ya you right , i was also thinking of enabling shell_exec and calling vesta cli

from vesta.

darkworks avatar darkworks commented on September 27, 2024

thanks for amazing tips :) vesta is big world we need to keep it exploring and building it .

from vesta.

darkworks avatar darkworks commented on September 27, 2024

great :)

from vesta.

darkworks avatar darkworks commented on September 27, 2024

i tried to call vesta command from web root like

exec ("sudo /usr/local/vesta/bin/v-list-mail-accounts "admin domain.com, $output, $return_var);

and getting blank response
Array ( [0] => ACCOUNT ALIAS FWD DISK DATE [1] => ------- ----- --- ---- ---- )

however the same script when i run from ssh bash shell as root like php myscript.php i get correct output of all mail accounts on terminal ,

so looks like when executed under apache php-fpm there is permission issue.

i have chroot enabled so do u think its issue ? i had created link of that vesta command to web root so that can be execute in webroot but no success same blank response.

updated : tested on another server with no chroot , same issue blank response

from vesta.

myvesta avatar myvesta commented on September 27, 2024

maybe issue with $VESTA env variablle.

try:
exec ("source /etc/profile && PATH=$PATH:/usr/local/vesta/bin && export PATH && sudo /usr/local/vesta/bin/v-list-mail-accounts admin domain.com", $output, $return_var);

from vesta.

darkworks avatar darkworks commented on September 27, 2024

maybe issue with $VESTA env variablle.

try:
exec ("source /etc/profile && PATH=$PATH:/usr/local/vesta/bin && export PATH && sudo /usr/local/vesta/bin/v-list-mail-accounts admin domain.com", $output, $return_var);

its returning blank array and 127 code in $output, $return_var

Array ( ) 127

from vesta.

myvesta avatar myvesta commented on September 27, 2024

is that domain/subdomain under admin account?

from vesta.

darkworks avatar darkworks commented on September 27, 2024

from vesta.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.