• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Issue Display Through Command Line Mailbox Forwarding Addresses.

ArshadM

New Pleskian
I have several mailbox with mail forwarding addresses. With the passage of time it's becomes difficult to login to Plesk & go to each mailbox & review the email addresses to which the emails are being forwarded. We have several departments & each dept email is forwarded to the relevant staff for action & many times need review which email is being forwarded to which staff.

Is it possible to have summary of all mail forwarding addresses through command in the following way.

mailbox
finance@domain.com

Mail Forwarding To
a@domain.com
b@domain.com
c@domain.com

mailbox
marketing@domain.com

Mail Forwarding To
d@domain.com
e@domain.com
f@domain.com

I think there must be some way similar to the way we can get the list of all email id with passwords of all the domains through the command /usr/local/psa/admin/sbin/mail_auth_view

Please help. How to achieve this task.
 
Last edited:
AFAIK there's no easy way to list all mails with forwarders from the CLI tools (see: mail: Mail Accounts)
But you could pull this info directly from the database, like this:
Code:
plesk db "SELECT concat(mail.mail_name,'@',domains.name) AS 'Email address',mail_redir.address AS 'Forward' FROM mail LEFT JOIN mail_redir ON mail.id=mail_redir.mn_id LEFT JOIN domains ON mail.dom_id=domains.id WHERE mail_redir.address <> ''"

I'm pretty sure there's a much more elegant way to do it but Works For Me (tm)
 
Simply add some WHERE clauses to the SQL statement, so for your example it would be:
Code:
plesk db "SELECT concat(mail.mail_name,'@',domains.name) AS 'Email address',mail_redir.address AS 'Forward' FROM mail LEFT JOIN mail_redir ON mail.id=mail_redir.mn_id LEFT JOIN domains ON mail.dom_id=domains.id WHERE mail_redir.address <> '' AND mail.mail_name = 'finance' AND domains.name = 'domain.com'"
 
Back
Top