Log pop+imap bandwidth for dovecot

Version 1.4


Relating to: http://help.directadmin.com/item.php?id=253 dovecot recently logs bytes for imap usage, so bandwidth can now be counted. Example from maillog: Sep 11 19:43:26 abc dovecot: imap(user@domain.com): Disconnected: Logged out bytes=241/451 Nov 15 02:28:12 abc dovecot: pop3(user@domain.com): Disconnected: Logged out top=1/30, retr=1/2210, del=0/110, size=1638002 For imap, DA will add the bytes=241/451 (in/out) together for the total. For pop, DA will use retr=1/2210, where 2210 is the sent bytes with the retr command. If the pop3 line contains a bytes= entry, that will be used instead (even though it doesn't by default, it will be more accurate when we you add it to your dovecot.conf. (new systems will have the new log format for pop, see below) This will add 2 new columns to the bandwidth breakdown page. And will add pop and imap values to the bandwidth.tally.cache file. The file: /usr/local/directadmin/scripts/rotate_email_usage.sh has also been updated to rotate the dovecote.bytes files which will be created by the da-popb4smtp binary. The dovecot.bytes files will exist in 2 locations, depending on the login format. /etc/virtual/domain.com/dovecot.bytes for @domain email accounts. /usr/local/directadmin/data/users/username/dovecot.bytes for system email accounts. The contents of the dovecot.bytes files will be dumped into the bandwidth.tally, then deleted (via rotate_email_usage.sh) New addition to the dovecot.conf for dovecot 2.0, into the section for protocol pop3: pop3_logout_format = top=%t/%p, retr=%r/%b, del=%d/%m, size=%s, bytes=%i/%o adding this line will give a more accurate bandwidth logging. Not adding it will only rely on the sent bytes frm RETR commands, so will be somewhat short of the truth.

Interested to try DirectAdmin? Get a 30-day Free Trial!