# use %u as a placeholder for the username and %d as the domain (username@domain.com)
query=SELECT pgp_key FROM pgp LEFT JOIN account USING(account_id) LEFT JOIN domain ON account.domain_id = domain.domain_id WHERE username = '%u' AND domain = '%d' and enabled = true