How to disable Greylisting automatically for new domains?

Created:

2017-01-05 13:57:49 UTC

Modified:

2017-08-08 13:41:00 UTC

0

Was this article helpful?


Have more questions?

Submit a request

How to disable Greylisting automatically for new domains?

Applicable to:

  • Plesk Onyx for Linux

Question

How to disable Greylisting automatically for new domains?

Answer

  1. Create a bash script with the following content (It can be changed for your convenience):

    # cat /root/greylist.sh
    #!/bin/bash
    /usr/local/psa/bin/grey_listing --update-domain $NEW_DOMAIN_NAME -status off
    echo "Customer account has been created. Greyl isting is desabled. Name: ${NEW_DOMAIN_NAME}" >> /tmp/event_handler.log

    Make it executable:

    # chmod +x /root/greylist.sh
    

    Here is an example of the /tmp/event_handler.log content after script execution:

    # tail -fn0 /tmp/event_handler.log
    Customer account has been created. Greyl isting is desabled. Name: example1.tld
    Customer account has been created. Greyl isting is desabled. Name: example2.tld
  2. Create two events:

    # plesk bin event_handler --create -command greylist.sh -priority 50 -user root -event 16
    # plesk bin event_handler --create -command greylist.sh -priority 50 -user root -event 112

    List of events could be found via the following command:

    # plesk bin event_handler --list-events
    

After that, new domains will be created with the Greylisting turned off.

Have more questions? Submit a request
Please sign in to leave a comment.