How to calculate IMAP/POP3 dovecot bandwidth

How to calculate IMAP dovecot bandwidth:

less /var/log/maillog |grep Aug |grep DOMAIN.COM |grep -Po 'out\=.+?,' |cut -d '=' -f2 |tr -d ,|awk '{s+=$1} END {print "total: ", s, " bytes transferred over IMAP"}'

total:  83107245783  bytes transferred over IMAP

echo "83107245783/1024/1024" |bc
79257M
~80G


How to calculate POP3 dovecot bandwidth:

less /var/log/maillog |grep DOMAIN.COM
Read the rest