Skip to main content

PHP Script Live Count Email Account on cPanel

Comments

4 comments

  • cPanelMichael
    Hello :) This would involve developing a custom script that utilizes our API. The "Email::listpops" module would likely be helpful: cPanel API2 - Email Thank you.
    0
  • saelendra
    Dear Michael, Previously thanks for your answer :) Can you tell me more specific how using this API "Email::listpops"? If possible, please give example with script maybe. Thanks so much for your help. Sory I'm newbie.
    0
  • cPanelMichael
    Do you have root access to this server or do you only have cPanel access? The API2 function is documented here: Email::Listpops You may need to consult with a developer if you need assistance with the custom script you are planning to create. Thank you.
    0
  • Erik Knepfler
    I know this is an old thread but I too wanted to solve this, and I felt that there likely was a simpler answer. Here's mine: find /home -type f -name "maildirsize" > mailboxes.log I chose that filename after creating a brand new email account, never accessed, and looking inside for unique files I could search for. That seemed like a good one. I use Exim/Dovecot but not sure if that makes any difference. YMMV, do the same, make a fresh account and look inside. There will be one extraneous result per account under /home/accountname/mail/maildirsize but with a simple regex search/replace you should be able to quickly eliminate that, such as replacing .*?/mail/maildirsize.* with blank in your text editor, then collapsing the blank lines. Then just search/replace all of the / characters with commas, load into Excel as a CSV, make a PivotTable and you're done :)
    0

Please sign in to leave a comment.