• Halloween is coming! To celebrate the occasion, we dusted off a couple of old skins, and even created a brand new one (Pixel).
    To get into the festive spirit, install the Skins extension.
  • The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • The Plesk Mobile apps for iOS and Android and the Plesk Mobile Center extension have been deprecated, and are no longer available for new installations. In Plesk Obsidian 18.0.84, the Plesk Mobile Center extension will be removed from servers during the upgrade, and the Plesk Mobile apps will lose their server management features.
  • The Social Login extension has been deprecated and will be removed in Plesk Obsidian 18.0.84. After that, it will no longer be possible to log in to Plesk with a Google, Facebook, GitHub account, or with a passkey. Plesk usernames and passwords, as well as logging in with a WebPros Account, are not affected.

mail.sh partially not working when invoked from PHP

G

gregi

Guest
Hello all

I'm encountering a strange problem. When I call mail.sh from the Shell like below, the redirection works just well:

sudo /usr/local/psa/bin/mail -u [email protected] -redirect true -rediraddr [email protected]

And by invoking:

sudo /usr/local/psa/bin/mail -u [email protected] -redirect false

the redirection gets removed as well.

Now the strange thing is, when I invoke the very same commands from a PHP script using the exec() or system() function, the mail-script returns in both cases SUCCESS, the redirection is sucessfully created after the first command, but not removed after the second command - although mail -i [email protected] tells me that the redirection *is* removed, even the Plesk Interface tells me that. But it isn't, since I get the mails redirected furthermore ;)

There is no chance now to remove the redirection than by redoing the redirection command from the Shell and re-removing it form the shell (this does also work from the Plesk-Interface). Just doing the remove-command from the shell doesn't help, I have to do both in order to get the redirection removed.

By the way, my /etc/sudoers contains
apache ALL= NOPASSWD: /usr/local/psa/bin/mail *
The sudo-thing is working, since when doing the same procedure above not with the apache-user but with another unprivileged user (after changing the /etc/sudoers of course), everything works es expected.

Now does anyone have an idea about this strange behaviour?

Thanks in andvance and greetings from switzerland
Greg
 
[cancel] mail.sh partially not working when invoked from PHP

Okay, I've just found what my very mistake was... I was doing a

UPDATE psa.mail SET redir_addr = '' WHERE id = 100

before deactivating the redirection, and it seems the mail-script didn't like that. To get around this problem I've just swapped the order of my commands, i.e. I invoke the mail-script with the redirection-delete first and second I invoke my DB update to get rid of the redirect-address.

Well, perhaps this sometime helps someone :)

Greetings,
Greg
 
Back
Top