Article ID: 114090, created on Jun 9, 2012, last review on Jun 17, 2016

  • Applies to:
  • Plesk 10.4 for Linux/Unix


How to turn Mail Service off for new subscriptions by default? Even if I set Mailboxes to in the Service Plan, Mail Service is still turned on.


It is possible to work around the problem using Event Manager:

  1. Create a Service Plan which you want to use as a plan without mail service. Let us assume it is called Mail off.

  2. Go to Tools & Setting > Event Manager > Add New Event Handler.

  3. Select Event - Default domain (the first domain added to a subscription/webspace) created.

  4. Set needed Priority.

  5. Set User: root.

  6. Specify the Command, e.g, /tmp/

  7. Create a script named /tmp/ in a shell, and set the necessary permissions for it. The script should contain this code:

    MYSQL_PWD=`cat /etc/psa/.psa.shadow`
    mkdir -p $logdir
    sleep 2
    i=`echo "select name from Templates where id =(select plan_id from PlansSubscriptions where subscription_id =(select id from Subscriptions where object_id =(select id from domains where name='${NEW_DOMAIN_NAME}')))" | mysql -uadmin psa | awk '{if (NR!=1) {print}}'`
    echo "`date` - Plan Template name is: $i" >>$logfile
    echo "`date` - Called for ${NEW_DOMAIN_NAME}" >>$logfile
    `if [ $i=='Mail off' ];`
             #sleep 5 && /usr/local/psa/bin/subscription -u ${NEW_DOMAIN_NAME} -mail_service false 1>>$logfile 2>>$logfile
             /usr/local/psa/bin/subscription -u ${NEW_DOMAIN_NAME} -mail_service false 1>>$logfile 2>>$logfile
             echo "`date` - Executed for subscription ${NEW_DOMAIN_NAME}" >>$logfile

where Mail off is the name of the Service Plan.

After taking these steps, Mail Service will be turned off for all subscriptions created using this Service Plan.

Search Words

How to turn Mail Service off

e8756e9388aeca36710ac39e739b2b37 56797cefb1efc9130f7c48a7d1db0f0c a914db3fdc7a53ddcfd1b2db8f5a1b9c 29d1e90fd304f01e6420fbe60f66f838 dd0611b6086474193d9bf78e2b293040

Email subscription for changes to this article
Save as PDF