~ubuntu-branches/ubuntu/oneiric/squid3/oneiric-security

« back to all changes in this revision

Viewing changes to helpers/basic_auth/POP3/pop3.pl

  • Committer: Bazaar Package Importer
  • Author(s): Luigi Gangitano
  • Date: 2007-05-13 16:03:16 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20070513160316-2h6kn6h1z0q1fvyo
Tags: 3.0.PRE6-1
* New upstream release
  - Removed patches integrated upsteam:
    + 04-m68k-ftbfs

* debian/rules
  - Enable delay pools (Closes: #410785)
  - Enable cache digests (Closes: #416631)
  - Enable ICAP client
  - Raised Max Filedescriptor limit to 65536

* debian/control
  - Added real package dependency for httpd in squid3-cgi

* debian/patches/02-makefile-defaults
  - Fix default configuration file for cachemgr.cgi (Closes: #416630)

* debian/squid3.postinst
  - Fixed bashish in postinst (Closes: #411797)

* debian/patches/05-helpers-typo
  - Added upstream patch fixing compilation error in src/helpers.cc

* debian/patches/06-mem-obj-reference
  - Added upstream patch fixing a mem_obj reference in src/store.cc

* debian/patches/07-close-icap-connections
  - Added upstream patch fixing icap connection starvation

* debian/squid3.rc
  - Added LSB-compliant description to rc script

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/perl
 
2
#
 
3
# POP3 authenticator for Squid
 
4
# Copyright (C) 2006 Henrik Nordstrom <henrik@henriknordstrom.net>
 
5
#
 
6
# This program is free software; you can redistribute it and/or modify
 
7
# it under the terms of the GNU General Public License as published by
 
8
# the Free Software Foundation; either version 2 of the License, or
 
9
# (at your option) any later version.
 
10
 
11
# This program is distributed in the hope that it will be useful,
 
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
# GNU General Public License for more details.
 
15
 
16
# You should have received a copy of the GNU General Public License
 
17
# along with this program; if not, write to the Free Software
 
18
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
 
19
 
20
# Change log:
 
21
#   2006-12-10  henrik  Initial revision
 
22
#
 
23
 
 
24
 
 
25
use Net::POP3;
 
26
$|=1;
 
27
 
 
28
if ( @ARGV != 1 ) {
 
29
    print STDERR "Usage: $0 popserver\n";
 
30
    exit 1
 
31
}
 
32
 
 
33
$server = shift @ARGV;
 
34
 
 
35
while(<>) {
 
36
    my ($username, $password) = split(/\s+/);
 
37
    $username =~ s/%([0-9a-f][0-9a-f])/pack("H2",$1)/gie;
 
38
    $password =~ s/%([0-9a-f][0-9a-f])/pack("H2",$1)/gie;
 
39
 
 
40
    $pop = Net::POP3->new($server);
 
41
    if (!$pop) {
 
42
        print "ERR Server not responding\n";
 
43
        next;
 
44
    }
 
45
 
 
46
    # Here apop could be used instead for MD5 support
 
47
    if ($pop->login($username, $password)) {
 
48
        print "OK\n";
 
49
    } else {
 
50
        print "ERR\n";
 
51
    }
 
52
    $pop->quit;
 
53
    undef $pop;
 
54
}