How to find all domains that have Mail Service enabled?

Created:

2017-06-22 14:23:51 UTC

Modified:

2017-08-16 17:06:22 UTC

0

Was this article helpful?


Have more questions?

Submit a request

How to find all domains that have Mail Service enabled?

Applicable to:

  • Plesk for Linux

Question

How to find all domains with not forwarding hosting type that use Mail Service?

Answer

Connect to the server using SSH.

Use the command below:

# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -uadmin psa -sN -e"SELECT name FROM domains WHERE id IN (SELECT dom_id FROM DomainServices WHERE type='mail' AND DomainServices.status='0') AND htype='vrt_hst'"


This request will show the domains with enabled mail service and also with mailboxes:

# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -uadmin psa -sN -e"SELECT name FROM domains inner join mail on domains.id=mail.dom_id WHERE domains.id IN (SELECT dom_id FROM DomainServices WHERE type='mail' AND DomainServices.status='0') AND htype='vrt_hst'"
Have more questions? Submit a request
Please sign in to leave a comment.