Plesk

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

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 unpack it:

    # wget https://support.plesk.com/hc/article_attachments/12377959298583/verify_pop3_imap_stats.tar.gz
    # tar -zxvf verify_pop3_imap_stats.tar.gz

  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://support.plesk.com/hc/article_attachments/12377959327383/courier_traffic.tar.gz
    # tar zxf courier_traffic.tar.gz

  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