Jump to content
Froxlor Forum
  • 0

[solved] Mail-Traffic Brechnung f?r dovecot


devil65

Question

Posted

Hallo,

 

ich glaube in der Traffic-Berechnung mit dovecot fehlt ein bischen was.

Bei und gab es n?mlich betr?chtliche Differenzen zu dem was in froxlor berechnet wurde und dem was der Hoster sagt (Hetzner), mehrere 100MB-1GB / Tag.

 

Beim durchschauen der Logs und der Script in der class.mailLogParser.php denke ich das etwas fehlt, hier mal ein paar Logzeilen:

Feb 23 13:38:21 ***** dovecot: imap-login: Login: user=<info@domain.de>, method=PLAIN, rip=XXX.XXX.XXX.XXX, lip=XXX.XXX.XXX.XXX
Feb 23 13:38:25 ***** dovecot: IMAP(info@domain.de): Disconnected: Logged out bytes=1616/41064
Feb 23 14:09:07 ***** dovecot: imap-login: Login: user=<info@domain.de>, method=PLAIN, rip=XXX.XXX.XXX.XXX, lip=XXX.XXX.XXX.XXX
Feb 23 14:09:12 ***** dovecot: IMAP(info@domain.de): Disconnected: Logged out bytes=201/2316
Feb 23 14:19:38 ***** dovecot: imap-login: Login: user=<info@domain.de>, method=PLAIN, rip=XXX.XXX.XXX.XXX, lip=XXX.XXX.XXX.XXX
Feb 23 14:19:41 ***** dovecot: IMAP(info@domain.de): Disconnected: Logged out bytes=1981/109583
Feb 24 11:24:28 ***** dovecot: imap-login: Login: user=<info@domain.de>, method=PLAIN, rip=XXX.XXX.XXX.XXX, lip=XXX.XXX.XXX.XXX
Feb 24 11:25:00 ***** dovecot: IMAP(info@domain.de): Disconnected: Logged out bytes=235937/1407

Dazwischen gibt es keine Logzeilen.

Dazu habe ich folgende Info gefunden:

# IMAP logout format string:
#  %i - total number of bytes read from client
#  %o - total number of bytes sent to client
# imap_logout_format = bytes=%i/%o

Das wird in der class.mailLogParser.php aber nicht mit erfasst, soweit ich das sehe.

 

Gr??e Devil65

9 answers to this question

Recommended Posts

Posted

Hallo,

 

das Problem mit dovecot ist doch noch nicht gel?st: f?r die Berechnung f?r POP3 wird der Wert bei "size=XXXX" verwendet. Das ist aber die Postfachgr?sse in der Standartkonfiguration von dovecot:

# POP3 logout format string:
# %i - total number of bytes read from client
# %o - total number of bytes sent to client
# %t - number of TOP commands
# %p - number of bytes sent to client as a result of TOP command
# %r - number of RETR commands
# %b - number of bytes sent to client as a result of RETR command
# %d - number of deleted messages
# %m - number of messages (before deletion)
# %s - mailbox size in bytes (before deletion)
# %u - old/new UIDL hash. may help finding out if UIDLs changed unexpectedly
#pop3_logout_format = top=%t/%p, retr=%r/%b, del=%d/%m, size=%s

Einige unserer Kunden haben einen Taffic >240GB in 18 Tagen, ist ein wehnig heftig  :)

 

Zeile 196 sollte sein:

} elseif (preg_match("/dovecot.*(?::|\]) pop3\(.*@([a-z0-9\.\-]+)\):.*retr=\dl\/(\d+)/i", $line, $matches)) {

Gr??e

devil65

Posted

Zeile 196 sollte sein:

} elseif (preg_match("/dovecot.*(?::|\]) pop3\(.*@([a-z0-9\.\-]+)\):.*retr=\dl\/(\d+)/i", $line, $matches)) {

 

Stimmt so auch nicht ganz, da %b nur die gesendeten Bytes angibt. Wir werden das Logformat in den Configs ab der kommenden Froxlor-Version vorgeben und %i/%o zur Berechnung heranziehen.

Posted

Hallo,

 

hast nat?rlich recht, hab ich ?bersehen da mich in erster Linie der ausgehende Traffic interessiert.

Mit %i/%o in den Configs ist es nat?rlich am besten. 

 

Danke

devil65

Posted

Also bei mir sieht eine entsprechende log-zeile so aus:

Feb 26 07:51:34 [dovecot] imap(user@domain.tld): Disconnected: Logged out in=200 out=756

Bei mir steht in der Config (auskommentiert, da default):

# IMAP logout format string:
#  %i - total number of bytes read from client
#  %o - total number of bytes sent to client
#imap_logout_format = in=%i out=%o

Ich nehme an du nutzt Debian? Ich sehe gerade, dass dort in den Configs das logout_format anders definiert ist (wie bei dir). Ich werde das mal pr?fen und ggfls f?r die n?chste Froxlor Version anpassen.

 

Brauchst du es sofort, passe einfach das "imap_logout_format" entsprechend meiner config (siehe oben) an.

Posted

I'm also using debian 7 (wheezy) and dovecot (needed to change from courier because of removing autoresponder features).

 

In delivered configs, IMAP log format is mentioned as "#imap_logout_format = bytes=%i/%o" but this is commented and it works out of the box like it where set to "imap_logout_format = in=%i out=%o". In other words I've never changed anything on IMAP log format settings an get such lines int my log:

 

"Mar  3 10:21:58 ns1 dovecot: imap(j**@d**.**): Disconnected: Logged out in=63 out=535"

 

So there seems no need to fix anything in froxlor for imap.

 

 

 

Another point is to cover POP3 traffic, here debian misses "in" and "out". Shipped config says "#pop3_logout_format = top=%t/%p, retr=%r/%b, del=%d/%m, size=%s". Yes ist's also commented but it's working axactly this way out of the box.

 

At the moment I'm running an own 'mailtrafficd' so I changed log format to "pop3_logout_format = in=%i out=%o top=%t/%p, retr=%r/%b, del=%d/%m, size=%s" to catch the whole in and out bytes. So I get:

 

"Mar  3 10:31:11 ns1 dovecot: pop3(n**@**.**): Disconnected: Logged out in=30 out=18992 top=0/0, retr=0/0, del=0/286, size=10994777

 
I think it's importand to cover this in FROXLORs config templates (and of cource traffic accounting).
 
 
 
regards
  Ronny

Archived

This topic is now archived and is closed to further replies.



×
×
  • Create New...