Get e-mail account passwords

Get all e-mail account passwords:

SELECT CONCAT_WS('@',mail.mail_name,domains.name),accounts.password
FROM domains,mail,accounts 
WHERE domains.id=mail.dom_id AND accounts.id=mail.account_id 
ORDER BY domains.name ASC,mail.mail_name ASC;

Get e-mail account passwords that are made up of only letters:

SELECT CONCAT_WS('@',mail.mail_name,domains.name),accounts.password
FROM domains,mail,accounts
WHERE domains.id=mail.dom_id AND accounts.id=mail.account_id 
AND accounts.password RLIKE BINARY '^[a-z]+$'
ORDER BY domains.name ASC,mail.mail_name ASC;

Get e-mail account passwords that are made up of only letters

SELECT CONCAT_WS('@',mail.mail_name,domains.name),accounts.password
FROM domains,mail,accounts
WHERE domains.id=mail.dom_id AND accounts.id=mail.account_id 
AND accounts.password RLIKE  '^[0-9]+$'
ORDER BY domains.name ASC,mail.mail_name ASC;

Find domains that are using catch-all accounts:

SELECT d.name AS domains, p.value AS catchall_address
FROM Parameters p, DomainServices ds, domains d
WHERE d.id = ds.dom_id AND ds.parameters_id = p.id AND p.parameter = 'catch_addr'
ORDER BY d.name

Related documentation