• 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

Issue mail account created event not working

danami

Silver Pleskian
PRODUCT, VERSION, OPERATING SYSTEM, ARCHITECTURE
Product version: Plesk Onyx 17.0.17 Update #13
Update date: 2017/01/24 03:46
Build date: 2016/11/17 16:00
OS version: CentOS 7.3.1611
Revision: ab6766191d3ba26e7b21255ab007fc7fc56d84c6
Architecture: 64-bit
Wrapper version: 1.2

PROBLEM DESCRIPTION

Normally I add a Plesk event to automatically enable spam filtering and set the default action to "move". Now after updating to Onyx the spam filtering is still disabled on the account after the email is created.

STEPS TO REPRODUCE
Add an event:
Event : Mail account created
User: root
Command: /usr/local/psa/bin/spamassassin -u <new_mailname> -status true -action move
Create a new email account.

ACTUAL RESULT
The email account is created and spam filtering is still not enabled.

EXPECTED RESULT

The email account should be created with spam filtering enabled and the default action set to move.
 
Last edited:
Command

/usr/local/psa/bin/spamassassin -u ${NEW_MAILNAME} -status true -action move

works fine for me.
 
I've doubled checked and this still isn't working in production or my test VMs. I've included a screen capture. Even after your event is added. Spam filtering is still not enabled on the email after creation.
 

Attachments

  • event_manager.gif
    event_manager.gif
    509 KB · Views: 4
In my test VM's it is using the unlimited service plan under a test "John Doe" subscriber. I double checked the production and it is not working in any of the service plans we have created either. (These are getting auto deployed using WHMCS).
 
I've verified that the mail event is getting executed :

Code:
#!/bin/bash
echo "mail account has been created. Name: ${NEW_MAILNAME}" >> /tmp/event_handler.log

The log file gets written to. Looking at the debug log you can see there is denitately something funky going on .

This is the log when added a [email protected] email account with the event added (It won't let me post the full event log because it is too long :(

Notice the lines:

Good. Our event is getting run to enable spamasssassin
Code:
[2017-01-25 20:45:28] DEBUG [util_exec] [f2d8d8f6ff105b5a06be17fa69ee8fd0-0] Starting: spammng --enable-mailname --action move --mailname [email protected] --not-modify-header
[2017-01-25 20:45:29] DEBUG [util_exec] [f2d8d8f6ff105b5a06be17fa69ee8fd0-0] Finished in 0.22833s, Error code: 0

Bad. Why is this getting run again after our event without any options?
Code:
[2017-01-25 20:45:30] DEBUG [util_exec] [810a1752b0aa8a9b56ffa1007eb2e4d5-0] Starting: spammng --mailname [email protected]
[2017-01-25 20:45:30] DEBUG [util_exec] [588970d9664dd] Finished in 0.71315s, Error code: TRUE

Then this is run after ?
Code:
[2017-01-25 20:45:30] DEBUG [util_exec] [4ec65c0629a85f8643e1b10a1cad20bb-0] Starting: spammng --disable-mailname --mailname [email protected]
 
I can't reproduce it. Event works fine for subscriptions.
Anybody else can confirm it?
 
It's not working for me in Centos 7 or Ubuntu 16.04 test VMs or on any boxes in production (Centos 6 or Centos 7 Onyx).
 
Its not Working for me:

upload_2017-1-27_12-47-22.png

The $var are only available on this input:

#!/bin/bash
/usr/local/psa/bin/spamassassin -u ${NEW_MAILNAME} -status true -action move

When I create a mailbox, plesk hangs up. Also, the console does not go any further.
 
Further testing for me shows that this bug is intermittent. IgorG can you please create 20 random email accounts in your testing with the event (/usr/local/psa/bin/spamassassin -u ${NEW_MAILNAME} -status true -action move) added and see if all 20 come up with spam filtering enabled?

In my testing about 1 in 10 is showing up with their spam filtering still disabled even with the event added.
 
Further testing for me shows that this bug is intermittent. IgorG can you please create 20 random email accounts in your testing with the event (/usr/local/psa/bin/spamassassin -u ${NEW_MAILNAME} -status true -action move) added and see if all 20 come up with spam filtering enabled?
I have tried this test case and still can't reproduce it. I think it would be better if you create a ticket to Plesk support. They will test it directly on your server and found a reason of this behaviour.
 
I just had the same problem, and I solved it by unchecking "Apply individual settings to spam filtering" in the Spam Filter settings. I assume that when it is checked, plesk runs our handler, then applies a default spam setting to the account.
 
PRODUCT, VERSION, OPERATING SYSTEM, ARCHITECTURE
Product version: Plesk Onyx 17.0.17 Update #13
Update date: 2017/01/24 03:46
Build date: 2016/11/17 16:00
OS version: CentOS 7.3.1611
Revision: ab6766191d3ba26e7b21255ab007fc7fc56d84c6
Architecture: 64-bit
Wrapper version: 1.2

PROBLEM DESCRIPTION

Normally I add a Plesk event to automatically enable spam filtering and set the default action to "move". Now after updating to Onyx the spam filtering is still disabled on the account after the email is created.

STEPS TO REPRODUCE
Add an event:
Event : Mail account created
User: root
Command: /usr/local/psa/bin/spamassassin -u <new_mailname> -status true -action move
Create a new email account.

ACTUAL RESULT
The email account is created and spam filtering is still not enabled.

EXPECTED RESULT

The email account should be created with spam filtering enabled and the default action set to move.
I used this program for the same architecture and I had no problems. My brother says that perhaps the problem is that the program does not support your email domain and therefore cannot function normally and filter spam. Try using a temporary email that will self-destruct after a certain time. Visit site and you will be able to create a temporary email with a completely different domain. So you can check whether the program works at all or if there is no result again, it is better to reinstall the program, but before you do this, it is better to clear all data and the cache. I hope I could help you.
 
Back
Top