Articles in this section

How to verify POP3/IMAP traffic statistics for subscription in Plesk?

kb: how-to Plesk for Linux ABT: Group B

Applicable to:

  • Plesk for Linux

Question

In the menu Subscriptions > example.com > Statistics (or just Statistics in Power User view), a big amount of POP3/IMAP traffic is shown.

Although, only one mail account is configured in the domains which belong to this subscription.

How to verify POP3/IMAP traffic statistics manually?

Answer

Note: the script takes mail statistics from /var/log/maillog* files. To make it showing statistics for the last month, adjust maillog rotation in /usr/local/psa/etc/logrotate.conf

When Dovecot is used as POP3/IMAP
  1. Connect to the server using SSH.
  2. Check if the utility bc is installed on the server:

    # command -V bc
    bc is /bin/bc

    If the following output is returned, bc should be installed as per the following steps:

    # command -V bc
    /bin/command: line 2: command: bc: not found

    • For RHEL-based operating systems (CentOS, RHEL, CloudLinux):

      # yum install bc

    • For Debian and Ubuntu:

      # apt install bc

  3. Download the script and make it executable:

    # wget https://raw.githubusercontent.com/plesk/kb-scripts/refs/heads/master/verify_pop3_imap_stats/verify_pop3_imap_stats.sh && chmod +x verify_pop3_imap_stats.sh

  4. Execute the script:

    # ./verify_pop3_imap_stats.sh

When Courier is used as POP3/IMAP server
  1. Connect to the server via SSH.
  2. Download the script and unpack it:

    # wget https://raw.githubusercontent.com/plesk/kb-scripts/refs/heads/master/verify-courier-imap-stats/courier-traffic.py && chmod +x courier-traffic.py

  3. Run the script with desired start and end dates and a domain name, if required

    # ./courier_traffic.py --start 15-08 --end 22-08 --domain example.com --unit MB /var/log/maillog

    Note: To see all available options run the script with -h option: ./courier_traffic.py -h

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.