Here’s a little command line hack that will calculate the bandwidth for all maillogs on your Plesk server, for SMTP, and POP/IMAP send and receive:

(echo “smtp:  `(cat maillog maillog.processed && zcat maillog.processed.*) | grep bytes | grep qmail: | awk ‘{sum=sum+$11} END { print sum}’`” && (cat maillog maillog.processed && zcat maillog.processed.*) | grep pop3 | grep LOGOUT | awk ‘{print $13,$14}’ | sed ‘s/,//g;s/….=//g’ | awk ‘{sumrcvd=sumrcvd+$1; sumsent=sumsent+$2} END {print “rcvd: “,sumrcvd,”\n” “sent: “,sumsent}’) | awk ‘{total=total+$2; print} END {print “total: “,total/1024/1024 “MB”}’

Run it from /usr/local/psa/var/log. It outputs something along these lines:

smtp: 397852373
rcvd: 228219
sent: 211813204
total: 581.64MB

Enjoy!
/cs