1
1
##########################################################################
2
# $Id: pop3,v 1.5 2005/04/20 17:55:17 bjorn Exp $
2
# $Id: pop3,v 1.8 2008/06/30 23:07:51 kirk Exp $
3
3
##########################################################################
5
5
########################################################
6
# Logwatch was written and is maintained by:
7
# Kirk Bauer <kirk@kaybee.org>
9
6
# The pop-3 script was written by:
10
7
# Pawe� Go�aszewski <blues@gda.pl>
12
8
########################################################
10
#######################################################
11
## Copyright (c) 2008 Pawe� Go�aszewski
12
## Covered under the included MIT/X-Consortium License:
13
## http://www.opensource.org/licenses/mit-license.php
14
## All modifications and contributions by other persons to
15
## this script are assumed to have been donated to the
16
## Logwatch project and thus assume the above copyright
17
## and licensing terms. If you want to make contributions
18
## under your own copyright or a different license this
19
## must be explicitly stated in the contribution an the
20
## Logwatch project reserves the right to not accept such
21
## contributions. If you have made significant
22
## contributions to this script and want to claim
23
## copyright please contact logwatch-devel@logwatch.org.
24
#########################################################
14
26
my $Debug = $ENV{'LOGWATCH_DEBUG'};
15
27
my $Detail = $ENV{'LOGWATCH_DETAIL_LEVEL'};
79
87
(($User, $Host) = ( $ThisLine =~ /^user (.*?) authenticated - (.*)$/ )) or
80
88
(($User, $Host) = ( $ThisLine =~ /^fork_child: \[\d\].*\((.*)\): began session for `(.*)' with .*; child PID is \d+$/ ))
81
or (($User, $Host) = ( $ThisLine =~ /^LOGIN, user=(.*?), ip=\[(.*)\]$/ ))
89
or (($User, $Host) = ( $ThisLine =~ /^LOGIN, user=([^ ,]+), ip=\[([^ ,]+)\](?:, port=\[\d+\])?$/ ))
83
91
$Login{$User}{$Host}++;
84
92
} elsif ( ($User,$Downloaded,$DownloadSize,$Left,$LeftSize) = ( $ThisLine =~ /^Stats: (.*?) (.*?) (.*?) (.*?) (.*?)$/) ) {
103
111
$Logout{$User}{$Host}++;
104
112
$Logout2{$User}++;
105
113
$Connection{$Host}++;
106
} elsif (($dummy, $User, $Host, $DownloadSize1, $DownloadSize2) = ( $ThisLine =~ /^(LOGOUT|TIMEOUT|DISCONNECTED), user=(.*?), ip=\[(.*)\], top=(\d+), retr=(\d+)/o)) {
114
} elsif (($dummy, $User, $Host, $DownloadSize1, $DownloadSize2) = ( $ThisLine =~ /^(LOGOUT|TIMEOUT|DISCONNECTED), user=(.*?), ip=\[([^ ,]+)\](?:, port=\[\d+\])?, top=(\d+), retr=(\d+)/o)) {
107
115
$DownloadedMessagesSize{$User} += $DownloadSize1 + $DownloadSize2;
108
116
$Logout{$User}{$Host}++;
109
117
$Logout2{$User}++;