I have an SMTP-proxy running on several Plesk-servers to protect them against spam (ASSP) This proxy behaves better if it knows the domains for which it should accept mail. For this purpose I wrote a script that checks the database each 15 minutes and generates a temporary file. If that temporary file is different than the one in use by assp it will update the file. This script works alright, but because I only know how I can extract all domains from the database it is also filled with domains that don't have mail enabled. It's not a big deal really as it just accepts some extra domains which get rejected by postfix/qmail anyhow. But still it looks better if only the mail enabled domains are shown. I would like to replace this command: mysql --skip-column-names -uadmin -p`cat /etc/psa/.psa.shadow` psa -e "SELECT domains.name FROM domains ORDER BY domains.name ASC; " | sort -u with a command that only gives me the domains that are "mail-enabled"