Articles in this section

How to list all mailboxes, their size, or all mailboxes with forwarding enabled?

kb: how-to Plesk for Linux

Applicable to:

  • Plesk for Linux

Question

How to list all mailboxes, their size, or all the mailboxes with forwarding enabled?

Answer

  1. Connect to the server via SSH
  2. Use one or more of the below queries:
  • This query will list all mailboxes and their current size (in MB):

    # plesk db "SELECT CONCAT(mail_name,'@',name) as 'Email', (truncate(mn.val/(1024*1024), 1)) as 'Megabytes' FROM mail,domains join mn_param mn WHERE dom_id=domains.id and mail.id=mn.mn_id and mn.param='box_usage' AND postbox='true' order by 2 desc"

  • This query will show all mailboxes that have forwarding enabled:

    # plesk db "SELECT CONCAT(mail_name,'@',name) as 'E-mail', mr.address as 'Forwards to:' FROM mail m,domains d join mail_redir mr WHERE m.dom_id=d.id and mr.mn_id=m.id"

  • This query will show all mailboxes that have forwarding enabled along with their client IDs (the domain owner):

    # plesk db "select concat(m.mail_name, '@', d.name) as mailbox, d.cl_id as clientID from mail m join domains d on d.id=m.dom_id where m.id in (select mn_id from mail_redir) and m.mail_group='true'"

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.