• 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.

Issue [12.5.30] Event handler bug: mail account manipulation fails if username contains apostrophe

burnley

Regular Pleskian
Tested on 12.5.30 Update #69 on CentOS 7 with "mail account created" and "mail account deleted". We've just found that we can't use the Plesk event handler if the email username contains an apostrophe, e.g. o'[email protected]. When I create such an account in Plesk the handler registered in Plesk isn't executed. If the username is [email protected] there's no issue.
I know in the past Plesk couldn't manage email usernames containing apostrophe in the local part, but it's been fixed for quite some time. We need to be able to use the event handler for such usernames.
 
Attached a test python script, rename it as /usr/local/bin/emltest-arg.py, create /var/log/python directory and:
Test case 1:
- Add a "mail account created" handler with the command:
/usr/local/bin/emltest-arg.py add ${NEW_MAILNAME}
- Create o'[email protected] account in Plesk. Expected result: log entries /var/log/python/python-apps.log. Actual result: nothing in /var/log/python/python-apps.log
- Create [email protected] account in Plesk. Expected result: log entries /var/log/python/python-apps.log. Actual result: log entries /var/log/python/python-apps.log.
Test case 2:
- Add a "mail account created" handler with the command:
/usr/local/bin/emltest-arg.py add
- Create o'[email protected] account in Plesk. Expected result: log entries /var/log/python/python-apps.log. Actual result: log entries /var/log/python/python-apps.log.
It appears Plesk is tripping on the argument passed in the command line if it contains an apostrophe.
 

Attachments

  • emltest-arg.py.txt
    1.2 KB · Views: 1
I think that there is a problem in your python script.
I have created simple bash script /usr/local/bin/eventcheck.sh

# cat /usr/local/bin/eventcheck.sh
#!/bin/bash
echo "Customer account has been created. Name: ${NEW_MAILNAME}" >> /tmp/event_handler.log

and checked that mail creation event works fine for mailname with apostrophe with:

# tail -f /tmp/event_handler.log

Customer account has been created. Name: [email protected]
Customer account has been created. Name: o'[email protected]
 
Igor, what's the command you're using for the event handler? As per my test cases description:
1. If command is "/usr/local/bin/eventcheck.sh ${NEW_MAILNAME}" it won't work.
2. If command is "/usr/local/bin/eventcheck.sh" it will work.
 
I see, thanks.
I think that you could submit it to Reports as a question to developers. I will forward it and maybe they will help you to sort it out.
 
Igor, how do I submit it? In fact, how can I submit bugs to Plesk nowadays? I went to Plesk Help Center but I can't submit any issue, there's no button to click submit, perhaps I'm not entering the right information there.
 
To whom it may concern, I've changed the handler code to fetch NEW_MAILNAME from the environment and stripped ${NEW_MAILNAME} from the "mail account created" command. Instead of "mailbox add ${NEW_MAILNAME}" the command is now "mailbox add".
 
Back
Top