The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

PHP Script Live Count Email Account on cPanel

Discussion in 'E-mail Discussions' started by saelendra, Dec 8, 2013.

  1. saelendra

    saelendra Registered

    Joined:
    Nov 28, 2013
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Hello :)

    Anyone knows about how to making script live count for email on cPanel?
    So everytime user creating email, this script will be automatically update for amount email on cPanel.
    Previously I will tell you I have website and I want all visitor know how many user now on my website.
    Any help will be appreciated :) Sory for my english, so bad. Thanks.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  3. saelendra

    saelendra Registered

    Joined:
    Nov 28, 2013
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    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.
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
  5. Erik Knepfler

    Erik Knepfler Member

    Joined:
    Sep 2, 2014
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Long Beach, California, United States
    cPanel Access Level:
    Root Administrator
    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 :)
     
Loading...

Share This Page