You can subscribe to this list here.
2003 |
Jan
|
Feb
(160) |
Mar
(119) |
Apr
(111) |
May
(118) |
Jun
(101) |
Jul
(304) |
Aug
(113) |
Sep
(140) |
Oct
(137) |
Nov
(87) |
Dec
(122) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(78) |
Feb
(125) |
Mar
(131) |
Apr
(59) |
May
(121) |
Jun
(166) |
Jul
(150) |
Aug
(137) |
Sep
(73) |
Oct
(58) |
Nov
(27) |
Dec
(60) |
2005 |
Jan
(131) |
Feb
(84) |
Mar
(36) |
Apr
(8) |
May
(28) |
Jun
(20) |
Jul
(10) |
Aug
(72) |
Sep
(76) |
Oct
(34) |
Nov
(3) |
Dec
(29) |
2006 |
Jan
(13) |
Feb
(92) |
Mar
(7) |
Apr
(1) |
May
(1) |
Jun
(2) |
Jul
(4) |
Aug
(17) |
Sep
(5) |
Oct
(2) |
Nov
(8) |
Dec
(12) |
2007 |
Jan
(28) |
Feb
(15) |
Mar
|
Apr
|
May
(8) |
Jun
(4) |
Jul
(5) |
Aug
(8) |
Sep
(20) |
Oct
(38) |
Nov
(65) |
Dec
(92) |
2008 |
Jan
(21) |
Feb
(56) |
Mar
(27) |
Apr
(174) |
May
(25) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <jgr...@us...> - 2003-03-03 22:01:41
|
Update of /cvsroot/popfile/engine/UI In directory sc8-pr-cvs1:/tmp/cvs-serv19388/UI Modified Files: HTML.pm Log Message: Fix up the constructors so that they call the parent classes, add new parameter method to POPFile::Configuration, fix up calls to child and flush_child_data for proxies; various other minor tweaks. With this commit POPFile OO is limping along... my guess is the next commit and you'll be able to try it out Index: HTML.pm =================================================================== RCS file: /cvsroot/popfile/engine/UI/HTML.pm,v retrieving revision 1.99 retrieving revision 1.100 diff -C2 -d -r1.99 -r1.100 *** HTML.pm 3 Mar 2003 15:21:49 -0000 1.99 --- HTML.pm 3 Mar 2003 22:01:36 -0000 1.100 *************** *** 37,41 **** { my $type = shift; ! my $self; # The classifier (Classifier::Bayes) --- 37,41 ---- { my $type = shift; ! my $self = POPFile::Module->new(); # The classifier (Classifier::Bayes) *************** *** 119,161 **** my ( $self ) = @_; ! # $self->config_( $1, $2, 1 ); # Checking for updates if off by default ! $self->config_( 'update_check', 0, 1 ); # Sending of statistics is off ! $self->config_( 'send_stats', 0, 1 ); # The size of a history page ! $self->config_( 'page_size', 20, 1 ); # Only accept connections from the local machine for the UI ! $self->config_( 'localui', 1, 1 ); # The default location for the message files ! $self->config_( 'msgdir', 'messages/', 1 ); # Use the default skin ! $self->config_( 'skin', 'SimplyBlue', 1 ); # Keep the history for two days ! $self->config_( 'history_days', 2, 1 ); # The last time we checked for an update using the local epoch ! $self->config_( 'last_update_check', 0, 1 ); # The user interface password ! $self->config_( 'password', '', 1 ); # The last time (textual) that the statistics were reset ! $self->config_( 'last_reset', localtime, 1 ); # We start by assuming that the user speaks English like the # perfidious Anglo-Saxons that we are... :-) ! $self->config_( 'language', 'English', 1 ); # If this is 1 then when the language is loaded we will use the language string identifier as the # string shown in the UI. This is used to test whether which identifiers are used where. ! $self->config_( 'test_language', 0, 1 ); # If 1, Messages are saved to an archive when they are removed or expired from the history cache --- 119,161 ---- my ( $self ) = @_; ! $self->config_( 'port', 8080 ); # Checking for updates if off by default ! $self->config_( 'update_check', 0 ); # Sending of statistics is off ! $self->config_( 'send_stats', 0 ); # The size of a history page ! $self->config_( 'page_size', 20 ); # Only accept connections from the local machine for the UI ! $self->config_( 'local', 1 ); # The default location for the message files ! $self->config_( 'msgdir', 'messages/' ); # Use the default skin ! $self->config_( 'skin', 'SimplyBlue' ); # Keep the history for two days ! $self->config_( 'history_days', 2 ); # The last time we checked for an update using the local epoch ! $self->config_( 'last_update_check', 0 ); # The user interface password ! $self->config_( 'password', '' ); # The last time (textual) that the statistics were reset ! $self->config_( 'last_reset', localtime ); # We start by assuming that the user speaks English like the # perfidious Anglo-Saxons that we are... :-) ! $self->config_( 'language', 'English' ); # If this is 1 then when the language is loaded we will use the language string identifier as the # string shown in the UI. This is used to test whether which identifiers are used where. ! $self->config_( 'test_language', 0 ); # If 1, Messages are saved to an archive when they are removed or expired from the history cache *************** *** 163,167 **** # The directory where messages will be archived to, in sub-directories for each bucket ! $self->config_( 'archive_dir', "archive", 1 ); # This is an advanced setting which will save archived files to a randomly numbered --- 163,167 ---- # The directory where messages will be archived to, in sub-directories for each bucket ! $self->config_( 'archive_dir', 'archive' ); # This is an advanced setting which will save archived files to a randomly numbered *************** *** 169,173 **** # bucket directory # 0 <= directory name < archive_classes ! $self->config_( 'archive_classes', 0, 1 ); # Load skins --- 169,173 ---- # bucket directory # 0 <= directory name < archive_classes ! $self->config_( 'archive_classes', 0 ); # Load skins *************** *** 218,222 **** $self->{server} = IO::Socket::INET->new( Proto => 'tcp', ! $self->config_( 'localui' ) == 1 ? (LocalAddr => 'localhost') : (), LocalPort => $self->config_( 'port' ), Listen => SOMAXCONN, --- 218,222 ---- $self->{server} = IO::Socket::INET->new( Proto => 'tcp', ! $self->config_( 'local' ) == 1 ? (LocalAddr => 'localhost') : (), LocalPort => $self->config_( 'port' ), Listen => SOMAXCONN, *************** *** 280,284 **** my ( $remote_port, $remote_host ) = sockaddr_in( $client->peername() ); ! if ( ( $self->config_( 'localui' ) == 0 ) || ( $remote_host eq inet_aton( "127.0.0.1" ) ) ) { --- 280,284 ---- my ( $remote_port, $remote_host ) = sockaddr_in( $client->peername() ); ! if ( ( $self->config_( 'local' ) == 0 ) || ( $remote_host eq inet_aton( "127.0.0.1" ) ) ) { *************** *** 994,999 **** $self->config_( 'password', $self->{form__}{password} ) if ( defined($self->{form__}{password}) ); $self->config_( 'server', $self->{form__}{server} ) if ( defined($self->{form__}{server}) ); ! $self->config_( 'localpop', $self->{form__}{localpop}-1 ) if ( defined($self->{form__}{localpop}) ); ! $self->config_( 'localui', $self->{form__}{localui}-1 ) if ( defined($self->{form__}{localui}) ); $self->config_( 'update_check', $self->{form__}{update_check}-1 ) if ( defined($self->{form__}{update_check}) ); $self->config_( 'send_stats', $self->{form__}{send_stats}-1 ) if ( defined($self->{form__}{send_stats}) ); --- 994,999 ---- $self->config_( 'password', $self->{form__}{password} ) if ( defined($self->{form__}{password}) ); $self->config_( 'server', $self->{form__}{server} ) if ( defined($self->{form__}{server}) ); ! $self->config_( 'local', $self->{form__}{localpop}-1 ) if ( defined($self->{form__}{localpop}) ); ! $self->config_( 'local', $self->{form__}{localui}-1 ) if ( defined($self->{form__}{localui}) ); $self->config_( 'update_check', $self->{form__}{update_check}-1 ) if ( defined($self->{form__}{update_check}) ); $self->config_( 'send_stats', $self->{form__}{send_stats}-1 ) if ( defined($self->{form__}{send_stats}) ); *************** *** 1037,1041 **** $body .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" summary=\"\"><tr><td>\n"; ! if ( $self->config_( 'localui' ) == 1 ) { $body .= "<form class=\"securitySwitch\" action=\"/security\">\n"; $body .= "<span class=\"securityWidgetStateOff\">$self->{language__}{Security_NoStealthMode}</span>\n"; --- 1037,1041 ---- $body .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" summary=\"\"><tr><td>\n"; ! if ( $self->config_( 'local' ) == 1 ) { $body .= "<form class=\"securitySwitch\" action=\"/security\">\n"; $body .= "<span class=\"securityWidgetStateOff\">$self->{language__}{Security_NoStealthMode}</span>\n"; *************** *** 1584,1588 **** $self->config_( 'ecount', 0 ); for my $bucket ($self->{classifier__}->get_buckets()) { ! $self->{classifier__}->{parameters}{$bucket}{count} = 0; } $self->{classifier__}->write_parameters(); --- 1584,1588 ---- $self->config_( 'ecount', 0 ); for my $bucket ($self->{classifier__}->get_buckets()) { ! $self->{classifier__}->set_bucket_parameter( $bucket, 'count', 0 ); } $self->{classifier__}->write_parameters(); *************** *** 1609,1619 **** if ( ( defined($self->{form__}{bucket}) ) && ( defined($self->{form__}{subject}) ) && ( $self->{form__}{subject} > 0 ) ) { ! $self->{classifier__}->{parameters}{$self->{form__}{bucket}}{subject} = $self->{form__}{subject} - 1; ! $self->{classifier__}->write_parameters(); } if ( ( defined($self->{form__}{bucket}) ) && ( defined($self->{form__}{quarantine}) ) && ( $self->{form__}{quarantine} > 0 ) ) { ! $self->{classifier__}->{parameters}{$self->{form__}{bucket}}{quarantine} = $self->{form__}{quarantine} - 1; ! $self->{classifier__}->write_parameters(); } --- 1609,1617 ---- if ( ( defined($self->{form__}{bucket}) ) && ( defined($self->{form__}{subject}) ) && ( $self->{form__}{subject} > 0 ) ) { ! $self->{classifier__}->set_bucket_parameter( $self->{form__}{bucket}, 'subject', $self->{form__}{subject} - 1 ); } if ( ( defined($self->{form__}{bucket}) ) && ( defined($self->{form__}{quarantine}) ) && ( $self->{form__}{quarantine} > 0 ) ) { ! $self->{classifier__}->set_bucket_parameter( $self->{form__}{bucket}, 'quarantine', $self->{form__}{quarantine} - 1 ); } *************** *** 1678,1682 **** my $total_count = 0; foreach my $bucket (@buckets) { ! $total_count += $self->{classifier__}->{parameters}{$bucket}{count}; } --- 1676,1680 ---- my $total_count = 0; foreach my $bucket (@buckets) { ! $total_count += $self->{classifier__}->get_bucket_parameter( $bucket, 'count' ); } *************** *** 1702,1706 **** $body .= "<td align=\"center\">\n"; ! if ( $self->{classifier__}->{parameters}{$bucket}{subject} == 0 ) { $body .= "<form class=\"bucketsSwitch\" style=\"margin: 0\" action=\"/buckets\">\n"; $body .= "<span class=\"bucketsWidgetStateOff\">$self->{language__}{Off} </span>\n"; --- 1700,1704 ---- $body .= "<td align=\"center\">\n"; ! if ( $self->{classifier__}->get_bucket_parameter( $bucket, 'subject' ) == 0 ) { $body .= "<form class=\"bucketsSwitch\" style=\"margin: 0\" action=\"/buckets\">\n"; $body .= "<span class=\"bucketsWidgetStateOff\">$self->{language__}{Off} </span>\n"; *************** *** 1724,1728 **** $body .= "<td width=\"1%\"> </td><td align=\"center\">\n"; ! if ( $self->{classifier__}->{parameters}{$bucket}{quarantine} == 0 ) { $body .= "<form class=\"bucketsSwitch\" style=\"margin: 0\" action=\"/buckets\">\n"; $body .= "<span class=\"bucketsWidgetStateOff\">$self->{language__}{Off} </span>\n"; --- 1722,1726 ---- $body .= "<td width=\"1%\"> </td><td align=\"center\">\n"; ! if ( $self->{classifier__}->get_bucket_parameter( $bucket, 'quarantine' ) == 0 ) { $body .= "<form class=\"bucketsSwitch\" style=\"margin: 0\" action=\"/buckets\">\n"; $body .= "<span class=\"bucketsWidgetStateOff\">$self->{language__}{Off} </span>\n"; *************** *** 1846,1850 **** my %bar_values; for my $bucket (@buckets) { ! $bar_values{$bucket} = $self->{classifier__}->{parameters}{$bucket}{count}; } --- 1844,1848 ---- my %bar_values; for my $bucket (@buckets) { ! $bar_values{$bucket} = $self->{classifier__}->get_bucket_parameter( $bucket, 'count' ); } *************** *** 2490,2495 **** $self->{logger}->debug( "Reclassifying $mail_file from $bucket to $newbucket" ); ! $self->{classifier__}->{parameters}{$newbucket}{count} += 1; ! $self->{classifier__}->{parameters}{$bucket}{count} -= 1; # Update the class file --- 2488,2493 ---- $self->{logger}->debug( "Reclassifying $mail_file from $bucket to $newbucket" ); ! # TODO $self->{classifier__}->set_parameters( $newbucket, count} += 1; ! # TODO $self->{classifier__}->{parameters}{$bucket}{count} -= 1; # Update the class file *************** *** 2587,2592 **** if ( $bucket ne $usedtobe ) { $self->config_( 'ecount', $self->config_( 'ecount' ) - 1 ) if ( $self->config_( 'ecount' ) > 0 ); ! $self->{classifier__}->{parameters}{$bucket}{count} -= 1; ! $self->{classifier__}->{parameters}{$usedtobe}{count} += 1; } --- 2585,2590 ---- if ( $bucket ne $usedtobe ) { $self->config_( 'ecount', $self->config_( 'ecount' ) - 1 ) if ( $self->config_( 'ecount' ) > 0 ); ! # TODO $self->{classifier__}->{parameters}{$bucket}{count} -= 1; ! # TODO $self->{classifier__}->{parameters}{$usedtobe}{count} += 1; } |
From: <jgr...@us...> - 2003-03-03 15:22:30
|
Update of /cvsroot/popfile/engine/UI In directory sc8-pr-cvs1:/tmp/cvs-serv12042/UI Modified Files: HTML.pm Log Message: Partial and broken work on POPFile refactoring; READ ONLY at this point; do not bother running unless you are very brave Index: HTML.pm =================================================================== RCS file: /cvsroot/popfile/engine/UI/HTML.pm,v retrieving revision 1.98 retrieving revision 1.99 diff -C2 -d -r1.98 -r1.99 *** HTML.pm 28 Feb 2003 00:21:03 -0000 1.98 --- HTML.pm 3 Mar 2003 15:21:49 -0000 1.99 *************** *** 2,5 **** --- 2,8 ---- package UI::HTML; + use POPFile::Module; + @ISA = ("POPFile::Module"); + #---------------------------------------------------------------------------- # *************** *** 19,25 **** [...4568 lines suppressed...] } *************** *** 3490,3493 **** --- 3476,3490 ---- close FROM; } + } + + sub classifier + { + my ( $self, $value ) = @_; + + if ( defined( $value ) ) { + $self->{classifier__} = $value; + } + + return $self->{classifier__}; } |
From: <jgr...@us...> - 2003-03-03 15:22:24
|
Update of /cvsroot/popfile/engine/Proxy In directory sc8-pr-cvs1:/tmp/cvs-serv12042/Proxy Modified Files: POP3.pm SMTP.pm Log Message: Partial and broken work on POPFile refactoring; READ ONLY at this point; do not bother running unless you are very brave Index: POP3.pm =================================================================== RCS file: /cvsroot/popfile/engine/Proxy/POP3.pm,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** POP3.pm 26 Feb 2003 04:35:12 -0000 1.40 --- POP3.pm 3 Mar 2003 15:21:46 -0000 1.41 *************** *** 2,8 **** package Proxy::POP3; # --------------------------------------------------------------------------------------------- # ! # This module handles proxying the POP3 protocol for POPFile. # # Copyright (c) 2001-2003 John Graham-Cumming --- 2,11 ---- package Proxy::POP3; [...1052 lines suppressed...] ! while( 1 ) { ! last unless () = $selector->can_read(0.01); ! last unless ( my $n = sysread( $mail, $buf, $max_length, length $buf ) ); ! ! tee( $self, $client, $buf ) if ( $discard != 1 ); ! return $buf; ! } ! } ! } ! return ''; ! } --- 411,418 ---- close $client; close $pipe; ! $self->log_( "POP3 forked child done" ); } ! # TODO echo_response_ that calls echo_response_ with the extra parameters ! # required et al. Index: SMTP.pm =================================================================== RCS file: /cvsroot/popfile/engine/Proxy/SMTP.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SMTP.pm 13 Feb 2003 21:24:17 -0000 1.3 --- SMTP.pm 3 Mar 2003 15:21:48 -0000 1.4 *************** *** 1,8 **** ! # POPFILE LOADABLE MODULE package Proxy::SMTP; # --------------------------------------------------------------------------------------------- # ! # This module handles proxying the SMTP protocol for POPFile. # # Copyright (c) 2001-2003 John Graham-Cumming --- 1,11 ---- ! # DISABLED POPFILE LOADABLE MODULE package Proxy::SMTP; + use Proxy::Proxy; + @ISA = ("Proxy::Proxy"); + # --------------------------------------------------------------------------------------------- # ! # This module handles proxying the SMTP protocol for POPFile. # # Copyright (c) 2001-2003 John Graham-Cumming *************** *** 10,30 **** # --------------------------------------------------------------------------------------------- - use IO::Socket; - use IO::Select; - use strict; use warnings; use locale; ! # This is used to get the hostname of the current machine ! # in a cross platform way ! use Sys::Hostname; ! ! # A handy variable containing the value of an EOL for Unix systems my $eol = "\015\012"; - # Constant used by the log rotation code - my $seconds_per_day = 60 * 60 * 24; - #---------------------------------------------------------------------------- # new --- 13,23 ---- # --------------------------------------------------------------------------------------------- use strict; use warnings; use locale; ! # A handy variable containing the value of an EOL for networks my $eol = "\015\012"; #---------------------------------------------------------------------------- # new *************** *** 32,59 **** # Class new() function #---------------------------------------------------------------------------- ! sub new { my $type = shift; my $self; - - # A reference to the POPFile::Configuration module - $self->{configuration} = 0; ! # A reference to the classifier ! $self->{classifier} = 0; ! ! # The name of the debug file ! $self->{debug_filename} = ''; ! ! # The name of the last user to pass through POPFile ! $self->{lastuser} = 'none'; ! # Used to tell any loops to terminate ! $self->{alive} = 1; ! ! # Just our hostname ! $self->{hostname} = ''; ! ! return bless $self, $type; } --- 25,40 ---- # Class new() function #---------------------------------------------------------------------------- ! sub new { my $type = shift; my $self; ! # Must call bless before attempting to call any methods ! bless $self, $type; ! ! $self->name( 'smtp' ); ! ! return $self; } *************** *** 69,78 **** my ( $self ) = @_; - # Start with debugging to file - $self->{configuration}->{configuration}{debug} = 1; - # Default ports for SMTP $self->{configuration}->{configuration}{smtp_port} = 25; ! # Where to forward on to $self->{configuration}->{configuration}{smtp_chain_server} = ''; --- 50,56 ---- my ( $self ) = @_; # Default ports for SMTP $self->{configuration}->{configuration}{smtp_port} = 25; ! # Where to forward on to $self->{configuration}->{configuration}{smtp_chain_server} = ''; *************** *** 80,187 **** # Only accept connections from the local machine for smtp ! $self->{configuration}->{configuration}{localsmtp} = 1; ! ! return 1; ! } ! ! # --------------------------------------------------------------------------------------------- ! # ! # start ! # ! # Called when the SMTP interface is allowed to start up ! # ! # --------------------------------------------------------------------------------------------- ! sub start ! { ! my ( $self ) = @_; ! ! # Ensure that the messages subdirectory exists ! mkdir( 'messages' ); ! ! # Get the hostname for use in the X-POPFile-Link header ! $self->{hostname} = hostname; ! ! # Open the socket used to receive request for SMTP service ! $self->{server} = IO::Socket::INET->new( Proto => 'tcp', ! $self->{configuration}->{configuration}{localsmtp} == 1 ? (LocalAddr => 'localhost') : (), ! LocalPort => $self->{configuration}->{configuration}{smtp_port}, ! Listen => SOMAXCONN, ! Reuse => 1 ) or return 0; ! ! # This is used to perform select calls on the $server socket so that we can decide when there is ! # a call waiting an accept it without having to block ! $self->{selector} = new IO::Select( $self->{server} ); ! ! return 1; ! } ! ! # --------------------------------------------------------------------------------------------- ! # ! # stop ! # ! # Called when the SMTP interface must terminate ! # ! # --------------------------------------------------------------------------------------------- ! sub stop ! { ! my ( $self ) = @_; ! ! close $self->{server} if ( defined( $self->{server} ) ); ! } ! ! # --------------------------------------------------------------------------------------------- ! # ! # name ! # ! # Called to get the simple name for this module ! # ! # --------------------------------------------------------------------------------------------- ! sub name ! { ! my ( $self ) = @_; ! ! return 'smtp'; ! } ! ! # --------------------------------------------------------------------------------------------- ! # ! # service ! # ! # Called to handle SMTP requests ! # ! # --------------------------------------------------------------------------------------------- ! sub service ! { ! my ( $self ) = @_; ! ! # Accept a connection from a client trying to use us as the mail server. We service one client at a time ! # and all others get queued up to be dealt with later. We check the alive boolean here to make sure we ! # are still allowed to operate. See if there's a connection waiting on the $server by getting the list of ! # handles with data to read, if the handle is the server then we're off. ! my ($ready) = $self->{selector}->can_read(0); ! ! # If the $server is ready then we can go ahead and accept the connection ! if ( ( defined($ready) ) && ( $ready == $self->{server} ) ) { ! if ( my $client = $self->{server}->accept() ) { ! # Check that this is a connection from the local machine, if it's not then we drop it immediately ! # without any further processing. We don't want to act as a proxy for just anyone's email ! my ( $remote_port, $remote_host ) = sockaddr_in( $client->peername() ); ! ! if ( ( $self->{configuration}->{configuration}{localpop} == 0 ) || ( $remote_host eq inet_aton( "127.0.0.1" ) ) ) { ! # Now that we have a good connection to the client fork a subprocess to handle the communication ! $self->{configuration}->{configuration}{download_count} += 1; ! my $pid = &{$self->{forker}}; ! ! # If we fail to fork, or are in the child process then process this request ! if ( !defined( $pid ) || ( $pid == 0 ) ) { ! child( $self, $client, $self->{configuration}->{configuration}{download_count} ); ! exit(0) if ( defined( $pid ) ); ! } ! } - close $client; - } - } - return 1; } --- 58,63 ---- # Only accept connections from the local machine for smtp ! $self->{configuration}->{configuration}{smtp} = 1; return 1; } *************** *** 189,218 **** # --------------------------------------------------------------------------------------------- # - # forked - # - # Called when someone forks POPFile - # - # --------------------------------------------------------------------------------------------- - sub forked - { - my ( $self ) = @_; - - close $self->{server}; - } - - # --------------------------------------------------------------------------------------------- - # - # reaper - # - # Called to reap our dead children - # - # --------------------------------------------------------------------------------------------- - sub reaper - { - my ( $self ) = @_; - } - - # --------------------------------------------------------------------------------------------- - # # child # --- 65,68 ---- *************** *** 232,236 **** # The handle to the real mail server gets stored here my $mail; ! # Tell the client that we are ready for commands and identify our version number tee( $self, $client, "220 SMTP POPFile (v$self->{configuration}->{major_version}.$self->{configuration}->{minor_version}.$self->{configuration}->{build_version}) server ready$eol" ); --- 82,86 ---- # The handle to the real mail server gets stored here my $mail; ! # Tell the client that we are ready for commands and identify our version number tee( $self, $client, "220 SMTP POPFile (v$self->{configuration}->{major_version}.$self->{configuration}->{minor_version}.$self->{configuration}->{build_version}) server ready$eol" ); *************** *** 267,271 **** } ! if ( ( $command =~ /MAIL FROM:/i ) || ( $command =~ /RCPT TO:/i ) || ( $command =~ /VRFY/i ) || --- 117,121 ---- } ! if ( ( $command =~ /MAIL FROM:/i ) || ( $command =~ /RCPT TO:/i ) || ( $command =~ /VRFY/i ) || *************** *** 320,376 **** # --------------------------------------------------------------------------------------------- # - # debug - # - # $message A string containing a debug message that may or may not be printed - # - # Prints the passed string if the global $debug is true - # - # --------------------------------------------------------------------------------------------- - sub debug - { - my ( $self, $message ) = @_; - - if ( $self->{configuration}->{configuration}{debug} > 0 ) { - # Check to see if we are handling the USER/PASS command and if we are then obscure the - # account information - $message = "$`$1$3 XXXXXX$4" if ( $message =~ /((--)?)(USER|PASS)\s+\S*(\1)/ ); - chomp $message; - $message .= "\n"; - - my $now = localtime; - my $msg = "$now ($$): $message"; - - if ( $self->{configuration}->{configuration}{debug} & 1 ) { - open DEBUG, ">>$self->{debug_filename}"; - binmode DEBUG; - print DEBUG $msg; - close DEBUG; - } - - print $msg if ( $self->{configuration}->{configuration}{debug} & 2 ); - } - } - - # --------------------------------------------------------------------------------------------- - # - # tee - # - # $socket The stream (created with IO::) to send the string to - # $text The text to output - # - # Sends $text to $socket and sends $text to debug output - # - # --------------------------------------------------------------------------------------------- - sub tee - { - my ( $self, $socket, $text ) = @_; - - # Send the message to the debug output and then send it to the appropriate socket - debug( $self, $text ); - print $socket $text if $socket->connected; - } - - # --------------------------------------------------------------------------------------------- - # # get_response # --- 170,173 ---- *************** *** 379,390 **** # $command The text of the command to send (we add an EOL) # ! # Send $command to $mail, receives the response and echoes it to the $client and the debug # output. Returns the response # # --------------------------------------------------------------------------------------------- ! sub get_response { my ( $self, $mail, $client, $command ) = @_; ! unless ( $mail ) { # $mail is undefined - return an error intead of crashing --- 176,187 ---- # $command The text of the command to send (we add an EOL) # ! # Send $command to $mail, receives the response and echoes it to the $client and the debug # output. Returns the response # # --------------------------------------------------------------------------------------------- ! sub get_response { my ( $self, $mail, $client, $command ) = @_; ! unless ( $mail ) { # $mail is undefined - return an error intead of crashing *************** *** 395,405 **** # Send the command (followed by the appropriate EOL) to the mail server tee( $self, $mail, $command. $eol ); ! my $response; ! # Retrieve a single string containing the response if ( $mail->connected ) { $response = <$mail>; ! if ( $response ) { # Echo the response up to the mail client --- 192,202 ---- # Send the command (followed by the appropriate EOL) to the mail server tee( $self, $mail, $command. $eol ); ! my $response; ! # Retrieve a single string containing the response if ( $mail->connected ) { $response = <$mail>; ! if ( $response ) { # Echo the response up to the mail client *************** *** 411,415 **** } } ! return $response; } --- 208,212 ---- } } ! return $response; } *************** *** 423,434 **** # $command The text of the command to send (we add an EOL) # ! # Send $command to $mail, receives the response and echoes it to the $client and the debug # output. Returns true if the response was +OK and false if not # # --------------------------------------------------------------------------------------------- ! sub echo_response { my ( $self, $mail, $client, $command ) = @_; ! # Determine whether the response began with the string +OK. If it did then return 1 # else return 0 --- 220,231 ---- # $command The text of the command to send (we add an EOL) # ! # Send $command to $mail, receives the response and echoes it to the $client and the debug # output. Returns true if the response was +OK and false if not # # --------------------------------------------------------------------------------------------- ! sub echo_response { my ( $self, $mail, $client, $command ) = @_; ! # Determine whether the response began with the string +OK. If it did then return 1 # else return 0 *************** *** 438,468 **** # --------------------------------------------------------------------------------------------- # - # echo_to_dot - # - # $mail The stream (created with IO::) to send the message to (the remote mail server) - # $client The local mail client (created with IO::) that needs the response - # - # echo all information from the $mail server until a single line with a . is seen - # - # --------------------------------------------------------------------------------------------- - sub echo_to_dot - { - my ( $self, $mail, $client ) = @_; - - while ( <$mail> ) { - # Check for an abort - last if ( $self->{alive} == 0 ); - - print $client $_; - - # The termination has to be a single line with exactly a dot on it and nothing - # else other than line termination characters. This is vital so that we do - # not mistake a line beginning with . as the end of the block - last if ( /^\.(\r\n|\r|\n)$/ ); - } - } - - # --------------------------------------------------------------------------------------------- - # # verify_connected # --- 235,238 ---- *************** *** 476,486 **** # # --------------------------------------------------------------------------------------------- ! sub verify_connected { my ( $self, $mail, $client, $hostname, $port ) = @_; ! # Check to see if we are already connected return $mail if ( $mail && $mail->connected ); ! # Connect to the real mail server on the standard port $mail = IO::Socket::INET->new( --- 246,256 ---- # # --------------------------------------------------------------------------------------------- ! sub verify_connected { my ( $self, $mail, $client, $hostname, $port ) = @_; ! # Check to see if we are already connected return $mail if ( $mail && $mail->connected ); ! # Connect to the real mail server on the standard port $mail = IO::Socket::INET->new( *************** *** 490,505 **** # Check that the connect succeeded for the remote server ! if ( $mail ) { if ( $mail->connected ) { ! # Wait 10 seconds for a response from the remote server and if # there isn't one then give up trying to connect my $selector = new IO::Select( $mail ); last unless () = $selector->can_read($self->{configuration}->{configuration}{timeout}); ! # Read the response from the real server and say OK my $buf = ''; my $max_length = 8192; my $n = sysread( $mail, $buf, $max_length, length $buf ); ! debug( $self, "Connection returned: $buf" ); if ( !( $buf =~ /[\r\n]/ ) ) { --- 260,275 ---- # Check that the connect succeeded for the remote server ! if ( $mail ) { if ( $mail->connected ) { ! # Wait 10 seconds for a response from the remote server and if # there isn't one then give up trying to connect my $selector = new IO::Select( $mail ); last unless () = $selector->can_read($self->{configuration}->{configuration}{timeout}); ! # Read the response from the real server and say OK my $buf = ''; my $max_length = 8192; my $n = sysread( $mail, $buf, $max_length, length $buf ); ! debug( $self, "Connection returned: $buf" ); if ( !( $buf =~ /[\r\n]/ ) ) { *************** *** 514,518 **** # Tell the client we failed tee( $self, $client, "554 Transaction failed failed to connect to $hostname:$port$eol" ); ! return undef; } --- 284,288 ---- # Tell the client we failed tee( $self, $client, "554 Transaction failed failed to connect to $hostname:$port$eol" ); ! return undef; } *************** *** 529,536 **** # # --------------------------------------------------------------------------------------------- ! sub flush_extra { my ( $self, $mail, $client, $discard ) = @_; ! if ( $mail ) { if ( $mail->connected ) { --- 299,306 ---- # # --------------------------------------------------------------------------------------------- ! sub flush_extra { my ( $self, $mail, $client, $discard ) = @_; ! if ( $mail ) { if ( $mail->connected ) { |
From: <jgr...@us...> - 2003-03-03 15:22:23
|
Update of /cvsroot/popfile/engine/POPFile In directory sc8-pr-cvs1:/tmp/cvs-serv12042/POPFile Modified Files: Configuration.pm Logger.pm Module.pm Log Message: Partial and broken work on POPFile refactoring; READ ONLY at this point; do not bother running unless you are very brave Index: Configuration.pm =================================================================== RCS file: /cvsroot/popfile/engine/POPFile/Configuration.pm,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Configuration.pm 28 Feb 2003 01:45:20 -0000 1.7 --- Configuration.pm 3 Mar 2003 15:21:44 -0000 1.8 *************** *** 1,4 **** # POPFILE LOADABLE MODULE ! package POPFile::Configuration; #---------------------------------------------------------------------------- --- 1,7 ---- # POPFILE LOADABLE MODULE ! package POPFile::Configuration; ! ! use POPFile::Module; ! @ISA = ( "POPFile::Module" ); #---------------------------------------------------------------------------- Index: Logger.pm =================================================================== RCS file: /cvsroot/popfile/engine/POPFile/Logger.pm,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Logger.pm 13 Feb 2003 21:24:17 -0000 1.8 --- Logger.pm 3 Mar 2003 15:21:45 -0000 1.9 *************** *** 2,5 **** --- 2,8 ---- package POPFile::Logger; + use POPFile::Module; + @ISA = ("POPFile::Module"); + #---------------------------------------------------------------------------- # Index: Module.pm =================================================================== RCS file: /cvsroot/popfile/engine/POPFile/Module.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Module.pm 26 Feb 2003 05:05:29 -0000 1.1 --- Module.pm 3 Mar 2003 15:21:46 -0000 1.2 *************** *** 8,12 **** # # POPFile is constructed from a collection of classes which all have special ! # interface functions: # # initialize() - called after the class is created to set default values for internal --- 8,12 ---- # # POPFile is constructed from a collection of classes which all have special ! # PUBLIC interface functions: # # initialize() - called after the class is created to set default values for internal *************** *** 31,44 **** # used as the key for this module in %components # # A note on the naming # ! # A method or variable that ends with an underscore is PRIVATE and should not be accessed ! # from outside the class (or subclass; in C++ its protected), to access a PRIVATE variable # you will find an equivalent getter/setter method with no underscore. # # For example # ! # $c->foo_() is a private method ! # $c->{foo_} is a private variable # $c->foo() is a public method that modifies $c->{foo_} it always returns the current # value of the variable it is referencing and if passed a value sets that corresponding --- 31,56 ---- # used as the key for this module in %components # + # The following methods are PROTECTED and should be accessed by sub classes: + # + # log_() - sends a string to the logger + # + # config_() - gets or sets a configuration parameter for this module + # # A note on the naming # ! # A method or variable that ends with an underscore is PROTECTED and should not be accessed ! # from outside the class (or subclass; in C++ its protected), to access a PROTECTED variable # you will find an equivalent getter/setter method with no underscore. # + # Truly PRIVATE variables are indicated by a double underscore at the end of the name and + # should not be accessed outside the class without going through a getter/setter and may + # not be directly accessed by a subclass. + # # For example # ! # $c->foo__() is a private method ! # $c->{foo__} is a private variable ! # $c->foo_() is a protected method ! # $c->{foo_} is a protected variable # $c->foo() is a public method that modifies $c->{foo_} it always returns the current # value of the variable it is referencing and if passed a value sets that corresponding *************** *** 57,78 **** # #---------------------------------------------------------------------------- ! sub new { my $type = shift; my $self; ! # A reference to the POPFile::Configuration module, every module is # able to get configuration information through this, note that it # is valid when initialize is called, however, the configuration is not # read from disk until after initialize has been called ! ! $self->{configuration_} = 0; # A reference to the POPFile::Logger module ! ! $self->{logger_} = 0; # Used to tell any loops to terminate ! $self->{alive_} = 1; --- 69,94 ---- # #---------------------------------------------------------------------------- ! sub new { my $type = shift; my $self; ! # A reference to the POPFile::Configuration module, every module is # able to get configuration information through this, note that it # is valid when initialize is called, however, the configuration is not # read from disk until after initialize has been called ! ! $self->{configuration__} = 0; # PRIVATE # A reference to the POPFile::Logger module ! ! $self->{logger__} = 0; # PRIVATE ! ! # The name of this module ! ! $self->{name__} = ''; # PRIVATE # Used to tell any loops to terminate ! $self->{alive_} = 1; *************** *** 84,90 **** # This is a reference to a function (forker) in popfile.pl that performs a fork # and informs modules that a fork has occurred ! $self->{forker_} = 0; ! return bless $self, $type; } --- 100,106 ---- # This is a reference to a function (forker) in popfile.pl that performs a fork # and informs modules that a fork has occurred ! $self->{forker_} = 0; ! return bless $self, $type; } *************** *** 126,130 **** { my ( $self ) = @_; ! return 1; } --- 142,146 ---- { my ( $self ) = @_; ! return 1; } *************** *** 145,170 **** # --------------------------------------------------------------------------------------------- # - # name - # - # Called to get the simple name for this module, this is the name use to hook various - # module's together in popfile.pl and should be a simple lower case name. This is the only - # pure abstract function in POPFile::Module and will abort POPFile immediately if ever - # called. - # - # It should return a string containing the proposed name - # - # --------------------------------------------------------------------------------------------- - sub name - { - my ( $self ) = @_; - - # Pure virtual - - print "\nPOPFile::Module::name called; this function is pure virtual"; - exit(1); - } - - # --------------------------------------------------------------------------------------------- - # # reaper # --- 161,164 ---- *************** *** 214,217 **** --- 208,274 ---- } + # --------------------------------------------------------------------------------------------- + # + # log_ + # + # Called by a subclass to send a message to the logger, the logged message will be prefixed + # by the name of the module in use + # + # $message The message to log + # + # There is no return value from this method + # + # --------------------------------------------------------------------------------------------- + sub log_ + { + my ( $self, $message ) = @_; + + $self->{logger__}->debug( $self->{name__} . ':' . $message ); + } + + # --------------------------------------------------------------------------------------------- + # + # config_ + # + # Called by a subclass to get or set a configuration parameter + # + # $name The name of the parameter (e.g. 'port') + # $value (optional) The value to set + # $short_name 1 if the $name should be registered in short form as well + # + # If called with just a $name then config_() will return the current value + # of the configuration parameter. + # + # Short vs Long Names. All configuration parameters are identified by their + # long name which consists of the individual parameter name preceded by the + # module name (underscore is used as the separator). For compatbility with + # older versions of POPFile the configuration module will also recognize some + # short names (i.e. without the preceding name and underscore) and map automaticall + # to the long name + # + # Example: POP3 registers a parameter for its listen port call port, this is stored + # in the configuration as pop3_port. POP3 also registers for the short name version + # which is simply port. When loading the configuration either will be accepted. + # + # Note NO NEW PARAMETERS should use short form + # + # --------------------------------------------------------------------------------------------- + sub config_ + { + my ( $self, $name, $value, $short_name ) = @_; + + my $long_name = $self->{name__} . '_' . $name; + + if ( defined( $value ) ) { + $self->{configuration__}->{configuration}{$long_name} = $value; + + if ( defined( $short_name ) ) { + $self->{configuration__}->{configuration}{$name} = $value; + } + } + + return $self->{configuration__}->{configuration}{$long_name}; + } + # GETTER/SETTER methods. Note that I do not expect documentation of these unless they # are non-trivial since the documentation would be a waste of space *************** *** 223,231 **** # { # my ( $self, $value ) = @_; ! # # if ( defined( $value ) ) { # $self->{foo_} = $value; # } ! # # return $self->{foo_}; # } --- 280,288 ---- # { # my ( $self, $value ) = @_; ! # # if ( defined( $value ) ) { # $self->{foo_} = $value; # } ! # # return $self->{foo_}; # } *************** *** 237,246 **** { my ( $self, $value ) = @_; ! if ( defined( $value ) ) { ! $self->{configuration_} = $value; } ! ! return $self->{configuration_}; } --- 294,303 ---- { my ( $self, $value ) = @_; ! if ( defined( $value ) ) { ! $self->{configuration__} = $value; } ! ! return $self->{configuration__}; } *************** *** 248,256 **** { my ( $self, $value ) = @_; ! if ( defined( $value ) ) { $self->{forker_} = $value; } ! return $self->{forker_}; } --- 305,313 ---- { my ( $self, $value ) = @_; ! if ( defined( $value ) ) { $self->{forker_} = $value; } ! return $self->{forker_}; } *************** *** 259,268 **** { my ( $self, $value ) = @_; ! if ( defined( $value ) ) { ! $self->{logger_} = $value; } ! ! return $self->{logger_}; } --- 316,325 ---- { my ( $self, $value ) = @_; ! if ( defined( $value ) ) { ! $self->{logger__} = $value; } ! ! return $self->{logger__}; } *************** *** 270,278 **** { my ( $self, $value ) = @_; ! if ( defined( $value ) ) { $self->{pipeready_} = $value; } ! return $self->{pipeready_}; } --- 327,335 ---- { my ( $self, $value ) = @_; ! if ( defined( $value ) ) { $self->{pipeready_} = $value; } ! return $self->{pipeready_}; } *************** *** 281,290 **** { my ( $self, $value ) = @_; ! if ( defined( $value ) ) { $self->{alive_} = $value; } ! return $self->{alive_}; } --- 338,358 ---- { my ( $self, $value ) = @_; ! if ( defined( $value ) ) { $self->{alive_} = $value; } ! return $self->{alive_}; + } + + sub name + { + my ( $self, $value ) = @_; + + if ( defined( $value ) ) { + $self->{name__} = $value; + } + + return $self->{name__}; } |
From: <jgr...@us...> - 2003-03-03 15:22:23
|
Update of /cvsroot/popfile/engine/Classifier In directory sc8-pr-cvs1:/tmp/cvs-serv12042/Classifier Modified Files: Bayes.pm MailParse.pm WordMangle.pm Log Message: Partial and broken work on POPFile refactoring; READ ONLY at this point; do not bother running unless you are very brave Index: Bayes.pm =================================================================== RCS file: /cvsroot/popfile/engine/Classifier/Bayes.pm,v retrieving revision 1.107 retrieving revision 1.108 diff -C2 -d -r1.107 -r1.108 *** Bayes.pm 28 Feb 2003 00:21:03 -0000 1.107 --- Bayes.pm 3 Mar 2003 15:21:37 -0000 1.108 *************** *** 2,5 **** --- 2,8 ---- package Classifier::Bayes; + use POPFile::Module; + @ISA = ("POPFile::Module"); + # --------------------------------------------------------------------------------------------- # *************** *** 20,24 **** [...1348 lines suppressed...] ! ! # --------------------------------------------------------------------------------------------- ! # ! # set_bucket_parameter ! # ! # Sets the value associated with a bucket specific parameter ! # ! # $bucket The name of the bucket ! # $parameter The name of the parameter ! # $value The new value ! # ! # --------------------------------------------------------------------------------------------- ! ! sub set_bucket_parameter ! { ! my ( $self, $bucket, $parameter, $value ) = @_; ! ! $self->{parameters__}{$bucket}{$parameter} = $value; } Index: MailParse.pm =================================================================== RCS file: /cvsroot/popfile/engine/Classifier/MailParse.pm,v retrieving revision 1.91 retrieving revision 1.92 diff -C2 -d -r1.91 -r1.92 *** MailParse.pm 27 Feb 2003 09:49:38 -0000 1.91 --- MailParse.pm 3 Mar 2003 15:21:39 -0000 1.92 *************** *** 21,25 **** my %entityhash; ! @entityhash{'amp', 'nbsp','iexcl','cent','pound','curren','yen','brvbar','sect','uml','copy','ordf','laquo','not','shy','reg','macr','deg','plusmn','sup2','sup3','acute','micro','para','middot','cedil','sup1','ordm','raquo','frac14','frac12','frac34','iquest','Agrave','Aacute','Acirc','Atilde','Auml','Aring','AElig','Ccedil','Egrave','Eacute','Ecirc','Euml','Igrave','Iacute','Icirc','Iuml','ETH','Ntilde','Ograve','Oacute','Ocirc','Otilde','Ouml','times','Oslash','Ugrave','Uacute','Ucirc','Uuml','Yacute','THORN','szlig','agrave','aacute','acirc','atilde','auml','aring','aelig','ccedil','egrave','eacute','ecirc','euml','igrave','iacute','icirc','iuml','eth','ntilde','ograve','oacute','ocirc','otilde','ouml','divide','oslash','ugrave','uacute','ucirc','uuml','yacute','thorn','yuml'} = ( 38, 160,161,162,163,164,165,166,167,168,169,170,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 ); #---------------------------------------------------------------------------- --- 21,25 ---- my %entityhash; ! @entityhash{'amp', 'nbsp','iexcl','cent','pound','curren','yen','brvbar','sect','uml','copy','ordf','laquo','not','shy','reg','macr','deg','plusmn','sup2','sup3','acute','micro','para','middot','cedil','sup1','ordm','raquo','frac14','frac12','frac34','iquest','Agrave','Aacute','Acirc','Atilde','Auml','Aring','AElig','Ccedil','Egrave','Eacute','Ecirc','Euml','Igrave','Iacute','Icirc','Iuml','ETH','Ntilde','Ograve','Oacute','Ocirc','Otilde','Ouml','times','Oslash','Ugrave','Uacute','Ucirc','Uuml','Yacute','THORN','szlig','agrave','aacute','acirc','atilde','auml','aring','aelig','ccedil','egrave','eacute','ecirc','euml','igrave','iacute','icirc','iuml','eth','ntilde','ograve','oacute','ocirc','otilde','ouml','divide','oslash','ugrave','uacute','ucirc','uuml','yacute','thorn','yuml'} = ( 38, 160,161,162,163,164,165,166,167,168,169,170,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 ); [...1700 lines suppressed...] } } ! ! $self->{base64__} = ''; ! return $colorized; } *************** *** 1114,1118 **** # # =?charset?[BQ]?text?= ! # # A B indicates base64 encoding, a Q indicates quoted printable encoding # --------------------------------------------------------------------------------------------- --- 1111,1115 ---- # # =?charset?[BQ]?text?= ! # # A B indicates base64 encoding, a Q indicates quoted printable encoding # --------------------------------------------------------------------------------------------- Index: WordMangle.pm =================================================================== RCS file: /cvsroot/popfile/engine/Classifier/WordMangle.pm,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** WordMangle.pm 22 Jan 2003 18:32:33 -0000 1.20 --- WordMangle.pm 3 Mar 2003 15:21:41 -0000 1.21 *************** *** 24,28 **** my $self; ! $self->{stop} = { 'all', 1, 'also', 1, 'and', 1, 'any', 1, 'are', 1, 'ask', 1, 'but', 1, 'can', 1, 'com', 1, 'did', 1, 'edu', 1, 'etc', 1, 'for', 1, 'from', 1, 'had', 1, 'has', 1, 'have', 1, 'her', 1, 'him', 1, 'his', 1, 'inc', 1, 'its', 1, 'it\'s', 1, 'ltd', 1, 'may', 1, 'not', 1, 'off', 1, 'our', 1, 'out', 1, 'she', 1, 'the', 1, 'this', --- 24,28 ---- my $self; ! $self->{stop__} = { 'all', 1, 'also', 1, 'and', 1, 'any', 1, 'are', 1, 'ask', 1, 'but', 1, 'can', 1, 'com', 1, 'did', 1, 'edu', 1, 'etc', 1, 'for', 1, 'from', 1, 'had', 1, 'has', 1, 'have', 1, 'her', 1, 'him', 1, 'his', 1, 'inc', 1, 'its', 1, 'it\'s', 1, 'ltd', 1, 'may', 1, 'not', 1, 'off', 1, 'our', 1, 'out', 1, 'she', 1, 'the', 1, 'this', *************** *** 54,65 **** { my ($self) = @_; ! if ( open STOPS, "<stopwords" ) { ! delete $self->{stop}; while ( <STOPS> ) { s/[\r\n]//g; ! $self->{stop}{$_} = 1; } ! close STOPS; } --- 54,65 ---- { my ($self) = @_; ! if ( open STOPS, "<stopwords" ) { ! delete $self->{stop__}; while ( <STOPS> ) { s/[\r\n]//g; ! $self->{stop__}{$_} = 1; } ! close STOPS; } *************** *** 69,78 **** { my ($self) = @_; ! if ( open STOPS, ">stopwords" ) { ! for my $word (keys %{$self->{stop}}) { print STOPS "$word\n"; } ! close STOPS; } --- 69,78 ---- { my ($self) = @_; ! if ( open STOPS, ">stopwords" ) { ! for my $word (keys %{$self->{stop__}}) { print STOPS "$word\n"; } ! close STOPS; } *************** *** 99,119 **** # All words are treated as lowercase ! $word = lc($word); # Stop words are ignored ! ! return '' if ( $self->{stop}{$word} ); # Remove characters that would mess up a Perl regexp and replace with . ! $word =~ s/(\+|\/|\?|\*|\||\(|\)|\[|\]|\{|\}|\^|\$|\.)/\./g; # Long words are ignored also ! return '' if ( length($word) > 45 ); # Ditch long hex numbers ! return '' if ( $word =~ /^[A-F0-9]{8,}$/i ); --- 99,119 ---- # All words are treated as lowercase ! $word = lc($word); # Stop words are ignored ! ! return '' if ( $self->{stop__}{$word} ); # Remove characters that would mess up a Perl regexp and replace with . ! $word =~ s/(\+|\/|\?|\*|\||\(|\)|\[|\]|\{|\}|\^|\$|\.)/\./g; # Long words are ignored also ! return '' if ( length($word) > 45 ); # Ditch long hex numbers ! return '' if ( $word =~ /^[A-F0-9]{8,}$/i ); |
From: <jgr...@us...> - 2003-03-03 15:22:10
|
Update of /cvsroot/popfile/engine In directory sc8-pr-cvs1:/tmp/cvs-serv12042 Modified Files: popfile.pl Log Message: Partial and broken work on POPFile refactoring; READ ONLY at this point; do not bother running unless you are very brave Index: popfile.pl =================================================================== RCS file: /cvsroot/popfile/engine/popfile.pl,v retrieving revision 1.204 retrieving revision 1.205 diff -C2 -d -r1.204 -r1.205 *** popfile.pl 25 Feb 2003 22:17:40 -0000 1.204 --- popfile.pl 3 Mar 2003 15:21:29 -0000 1.205 *************** *** 5,9 **** # # Acts as a POP3 server and client designed to sit between a real mail client and a real mail ! # server using POP3. Inserts an extra header X-Text-Classification: into the mail header to # tell the client whether the mail is spam or not based on a text classification algorithm # --- 5,9 ---- # # Acts as a POP3 server and client designed to sit between a real mail client and a real mail ! # server using POP3. Inserts an extra header X-Text-Classification: into the mail header to # tell the client whether the mail is spam or not based on a text classification algorithm # *************** *** 15,57 **** use locale; - # NOTE: POPFile is constructed from a collection of classes which all have special - # interface functions and variables: - # - # initialize() - called after the class is created to set default values for internal - # variables and global configuration information - # start() - called once all configuration has been read and POPFile is ready to start - # operating - # stop() - called when POPFile is shutting down - # - # service() - called by the main POPFile process to allow a submodule to do its own - # work (this is optional for modules that do not need to perform any service) - # - # forked() - called when a module has forked the process. This is called within the child - # process and should be used to clean up - # - # reaper() - called when a process has terminated to give a module a chance to do - # whatever clean up is needed - # - # name() - returns a simple name for the module by which other modules can get access - # through the %components hash. The name returned here will be the name - # used as the key for this module in %components - # - # pipeready - This is a reference to the pipeready() function in this file that it used - # to determine if a pipe if ready for reading - # - # alive - Gets set to 1 when the parent wants to kill all the running sub modules - # - # forker - This is a reference to a function (forker) in this file that performs a fork - # and informs modules that a fork has occurred. - # # The POPFile classes are stored by reference in the %components hash, the top level key is ! # the type of the component (see load_modules) and then the name of the component derived from # calls to each loadable modules name() method and which points to the actual module my %components; ! # This is the A PIECE OF PLATFORM SPECIFIC CODE and all it does is force Windows users to have # v5.8.0 because that's the version with good fork() support everyone else can use whatever they ! # want. This is probably only temporary because at some point I am going to force 5.8.0 for # everyone because of the better Unicode support --- 15,27 ---- use locale; # The POPFile classes are stored by reference in the %components hash, the top level key is ! # the type of the component (see load_modules) and then the name of the component derived from # calls to each loadable modules name() method and which points to the actual module my %components; ! # This is the A PIECE OF PLATFORM SPECIFIC CODE and all it does is force Windows users to have # v5.8.0 because that's the version with good fork() support everyone else can use whatever they ! # want. This is probably only temporary because at some point I am going to force 5.8.0 for # everyone because of the better Unicode support *************** *** 59,64 **** if ( $^O eq 'MSWin32' ) { ! require v5.8.0; ! $on_windows = 1; } --- 29,34 ---- if ( $^O eq 'MSWin32' ) { ! require v5.8.0; ! $on_windows = 1; } *************** *** 71,88 **** # --------------------------------------------------------------------------------------------- # ! # aborting # ! # Called if we are going to be aborted or are being asked to abort our operation. Sets the # alive flag to 0 that will cause us to abort at the next convenient moment # # --------------------------------------------------------------------------------------------- ! sub aborting { $alive = 0; ! foreach my $type (keys %components) { ! foreach my $name (keys %{$components{$type}}) { ! $components{$type}{$name}->{alive} = 0; ! $components{$type}{$name}->stop(); ! } } } --- 41,58 ---- # --------------------------------------------------------------------------------------------- # ! # aborting # ! # Called if we are going to be aborted or are being asked to abort our operation. Sets the # alive flag to 0 that will cause us to abort at the next convenient moment # # --------------------------------------------------------------------------------------------- ! sub aborting { $alive = 0; ! foreach my $type (keys %components) { ! foreach my $name (keys %{$components{$type}}) { ! $components{$type}{$name}->alive(0); ! $components{$type}{$name}->stop(); ! } } } *************** *** 94,127 **** # Returns 1 if there is data available to be read on the passed in pipe handle # ! # $pipe Pipe handle # # --------------------------------------------------------------------------------------------- sub pipeready { ! my ( $pipe ) = @_; ! # Check that the $pipe is still a valid handle ! ! if ( !defined( $pipe ) ) { ! return 0; ! } ! if ( $on_windows ) { ! ! # I am NOT doing a select() here because that does not work ! # on Perl running on Windows. -s returns the "size" of the file ! # (in this case a pipe) and will be non-zero if there is data to read ! ! return ( ( -s $pipe ) > 0 ); ! } else { ! ! # Here I do a select because we are not running on Windows where ! # you can't select() on a pipe ! my $rin = ''; ! vec( $rin, fileno( $pipe ), 1 ) = 1; ! my $ready = select( $rin, undef, undef, 0.01 ); ! return ( $ready > 0 ); ! } } --- 64,97 ---- # Returns 1 if there is data available to be read on the passed in pipe handle # ! # $pipe Pipe handle # # --------------------------------------------------------------------------------------------- sub pipeready { ! my ( $pipe ) = @_; ! # Check that the $pipe is still a valid handle ! ! if ( !defined( $pipe ) ) { ! return 0; ! } ! if ( $on_windows ) { ! ! # I am NOT doing a select() here because that does not work ! # on Perl running on Windows. -s returns the "size" of the file ! # (in this case a pipe) and will be non-zero if there is data to read ! ! return ( ( -s $pipe ) > 0 ); ! } else { ! ! # Here I do a select because we are not running on Windows where ! # you can't select() on a pipe ! my $rin = ''; ! vec( $rin, fileno( $pipe ), 1 ) = 1; ! my $ready = select( $rin, undef, undef, 0.01 ); ! return ( $ready > 0 ); ! } } *************** *** 137,147 **** sub reaper { ! foreach my $type (keys %components) { ! foreach my $name (keys %{$components{$type}}) { ! $components{$type}{$name}->reaper(); ! } } ! $SIG{CHLD} = \&reaper; } --- 107,117 ---- sub reaper { ! foreach my $type (keys %components) { ! foreach my $name (keys %{$components{$type}}) { ! $components{$type}{$name}->reaper(); ! } } ! $SIG{CHLD} = \&reaper; } *************** *** 161,173 **** sub forker { ! # Create the pipe that will be used to send data from the child to the parent process, # $writer will be returned to the child process and $reader to the parent process ! pipe my $reader, my $writer; my $pid = fork(); ! # If fork() returns an undefined value then we failed to fork and are # in serious trouble (probably out of resources) so we return undef ! if ( !defined( $pid ) ) { close $reader; --- 131,143 ---- sub forker { ! # Create the pipe that will be used to send data from the child to the parent process, # $writer will be returned to the child process and $reader to the parent process ! pipe my $reader, my $writer; my $pid = fork(); ! # If fork() returns an undefined value then we failed to fork and are # in serious trouble (probably out of resources) so we return undef ! if ( !defined( $pid ) ) { close $reader; *************** *** 177,205 **** # If fork returns a PID of 0 then we are in the child process so close the ! # reading pipe file handle, inform all modules that are fork has occurred and # then return 0 as the PID so that the caller knows that we are in the child ! if ( $pid == 0 ) { ! foreach my $type (keys %components) { ! foreach my $name (keys %{$components{$type}}) { ! $components{$type}{$name}->forked(); ! } } ! close $reader; ! # Set autoflush on the write handle so that output goes straight through # to the parent without buffering it until the socket closes ! use IO::Handle; $writer->autoflush(1); ! return (0, $writer); } ! # Reach here because we are in the parent process, close out the writer pipe # file handle and return our PID (non-zero) indicating that this is the parent # process ! close $writer; return ($pid, $reader); --- 147,175 ---- # If fork returns a PID of 0 then we are in the child process so close the ! # reading pipe file handle, inform all modules that are fork has occurred and # then return 0 as the PID so that the caller knows that we are in the child ! if ( $pid == 0 ) { ! foreach my $type (keys %components) { ! foreach my $name (keys %{$components{$type}}) { ! $components{$type}{$name}->forked(); ! } } ! close $reader; ! # Set autoflush on the write handle so that output goes straight through # to the parent without buffering it until the socket closes ! use IO::Handle; $writer->autoflush(1); ! return (0, $writer); } ! # Reach here because we are in the parent process, close out the writer pipe # file handle and return our PID (non-zero) indicating that this is the parent # process ! close $writer; return ($pid, $reader); *************** *** 213,220 **** # comment on first line) in a specific subdirectory # ! # $directory The directory to search for loadable modules ! # $type The 'type' of module being loaded (e.g. proxy, core, ui) which is used ! # below when fixing up references between modules (e.g. proxy modules all ! # need access to the classifier module) # # --- 183,190 ---- # comment on first line) in a specific subdirectory # ! # $directory The directory to search for loadable modules ! # $type The 'type' of module being loaded (e.g. proxy, core, ui) which is used ! # below when fixing up references between modules (e.g. proxy modules all ! # need access to the classifier module) # # *************** *** 222,254 **** sub load_modules { ! my ( $directory, $type ) = @_; ! # Look for all the .pm files in named directory and then see which of them ! # are POPFile modules indicated by the first line of the file being and ! # comment (# POPFILE LOADABLE MODULE) and load that module into the %components ! # hash getting the name from the module by calling name() ! ! my @modules = glob "$directory/*.pm"; ! ! foreach my $module (@modules) { ! if ( open MODULE, "<$module" ) { ! my $first = <MODULE>; ! close MODULE; ! ! if ( $first =~ /^# POPFILE LOADABLE MODULE/ ) { ! require $module; ! $module =~ s/\//::/; ! $module =~ s/\.pm//; ! my $mod = new $module; ! my $name = $mod->name(); ! $components{$type}{$name} = $mod; ! ! print " {$name}"; ! } ! } ! } } --- 192,224 ---- sub load_modules { ! my ( $directory, $type ) = @_; ! # Look for all the .pm files in named directory and then see which of them ! # are POPFile modules indicated by the first line of the file being and ! # comment (# POPFILE LOADABLE MODULE) and load that module into the %components ! # hash getting the name from the module by calling name() ! my @modules = glob "$directory/*.pm"; ! foreach my $module (@modules) { ! if ( open MODULE, "<$module" ) { ! my $first = <MODULE>; ! close MODULE; ! if ( $first =~ /^# POPFILE LOADABLE MODULE/ ) { ! require $module; ! ! $module =~ s/\//::/; ! $module =~ s/\.pm//; ! ! my $mod = new $module; ! my $name = $mod->name(); ! ! $components{$type}{$name} = $mod; ! ! print " {$name}"; ! } ! } ! } } *************** *** 276,280 **** print " Loading... "; ! load_modules( 'POPFile', 'core' ); load_modules( 'Classifier', 'classifier' ); load_modules( 'UI', 'ui' ); --- 246,250 ---- print " Loading... "; ! load_modules( 'POPFile', 'core' ); load_modules( 'Classifier', 'classifier' ); load_modules( 'UI', 'ui' ); *************** *** 293,300 **** foreach my $type (keys %components) { ! foreach my $name (keys %{$components{$type}}) { ! $components{$type}{$name}->{configuration} = $components{core}{config} if ( $name ne 'config' ); ! $components{$type}{$name}->{logger} = $components{core}{logger} if ( $name ne 'logger' ); ! } } --- 263,270 ---- foreach my $type (keys %components) { ! foreach my $name (keys %{$components{$type}}) { ! $components{$type}{$name}->configuration( $components{core}{config} ) if ( $name ne 'config' ); ! $components{$type}{$name}->logger( $components{core}{logger} ) if ( $name ne 'logger' ); ! } } *************** *** 302,307 **** foreach my $name (keys %{$components{proxy}}) { ! $components{proxy}{$name}->{classifier} = $components{classifier}{classifier}; ! $components{proxy}{$name}->{ui} = $components{ui}{html}; } --- 272,277 ---- foreach my $name (keys %{$components{proxy}}) { ! $components{proxy}{$name}->classifier( $components{classifier}{bayes} ); ! $components{proxy}{$name}->ui( $components{ui}{ui} ); } *************** *** 309,313 **** foreach my $name (keys %{$components{ui}}) { ! $components{ui}{$name}->{classifier} = $components{classifier}{classifier}; } --- 279,283 ---- foreach my $name (keys %{$components{ui}}) { ! $components{ui}{$name}->classifier( $components{classifier}{bayes} ); } *************** *** 317,331 **** foreach my $type (keys %components) { ! foreach my $name (keys %{$components{$type}}) { ! print "{$name} "; ! flush STDOUT; ! if ( $components{$type}{$name}->initialize() == 0 ) { ! die "Failed to start while initializing the $name module"; ! } ! $components{$type}{$name}->{alive} = 1; ! $components{$type}{$name}->{forker} = \&forker; ! $components{$type}{$name}->{pipeready} = \&pipeready; ! } } --- 287,301 ---- foreach my $type (keys %components) { ! foreach my $name (keys %{$components{$type}}) { ! print "{$name} "; ! flush STDOUT; ! if ( $components{$type}{$name}->initialize() == 0 ) { ! die "Failed to start while initializing the $name module"; ! } ! $components{$type}{$name}->alive( 1 ); ! $components{$type}{$name}->forker( \&forker ); ! $components{$type}{$name}->pipeready( \&pipeready ); ! } } *************** *** 341,354 **** foreach my $type (keys %components) { ! foreach my $name (keys %{$components{$type}}) { ! print "{$name} "; ! flush STDOUT; ! if ( $components{$type}{$name}->start() == 0 ) { ! die "Failed to start while starting the $name module"; ! } ! } } print "\nPOPFile Engine v$components{core}{config}->{major_version}.$components{core}{config}->{minor_version}.$components{core}{config}->{build_version} running\n"; # MAIN LOOP - Call each module's service() method to all it to --- 311,325 ---- foreach my $type (keys %components) { ! foreach my $name (keys %{$components{$type}}) { ! print "{$name} "; ! flush STDOUT; ! if ( $components{$type}{$name}->start() == 0 ) { ! die "Failed to start while starting the $name module"; ! } ! } } print "\nPOPFile Engine v$components{core}{config}->{major_version}.$components{core}{config}->{minor_version}.$components{core}{config}->{build_version} running\n"; + flush STDOUT; # MAIN LOOP - Call each module's service() method to all it to *************** *** 356,381 **** while ( $alive == 1 ) { ! foreach my $type (keys %components) { ! foreach my $name (keys %{$components{$type}}) { ! if ( $components{$type}{$name}->service() == 0 ) { ! $alive = 0; ! last; ! } ! } } ! # Sleep for 0.05 of a second to ensure that POPFile does not hog the machine's # CPU select(undef, undef, undef, 0.05); ! # If we are on Windows then reap children here if ( $on_windows ) { ! foreach my $type (keys %components) { ! foreach my $name (keys %{$components{$type}}) { ! $components{$type}{$name}->reaper(); ! } ! } } } --- 327,352 ---- while ( $alive == 1 ) { ! foreach my $type (keys %components) { ! foreach my $name (keys %{$components{$type}}) { ! if ( $components{$type}{$name}->service() == 0 ) { ! $alive = 0; ! last; ! } ! } } ! # Sleep for 0.05 of a second to ensure that POPFile does not hog the machine's # CPU select(undef, undef, undef, 0.05); ! # If we are on Windows then reap children here if ( $on_windows ) { ! foreach my $type (keys %components) { ! foreach my $name (keys %{$components{$type}}) { ! $components{$type}{$name}->reaper(); ! } ! } } } *************** *** 386,397 **** foreach my $type (keys %components) { ! foreach my $name (keys %{$components{$type}}) { ! print "{$name} "; ! $components{$type}{$name}->{alive} = 0; ! $components{$type}{$name}->stop(); ! } } print "\n Saving configuration\n"; # Write the final configuration to disk --- 357,370 ---- foreach my $type (keys %components) { ! foreach my $name (keys %{$components{$type}}) { ! print "{$name} "; ! flush STDOUT; ! $components{$type}{$name}->alive(0); ! $components{$type}{$name}->stop(); ! } } print "\n Saving configuration\n"; + flush STDOUT; # Write the final configuration to disk |
From: <ssc...@us...> - 2003-03-02 19:26:58
|
Update of /cvsroot/popfile/engine/Proxy In directory sc8-pr-cvs1:/tmp/cvs-serv18428 Modified Files: Tag: v0/18/1 POP3.pm Log Message: fixed reporting of remaining child pop3 pid's Index: POP3.pm =================================================================== RCS file: /cvsroot/popfile/engine/Proxy/POP3.pm,v retrieving revision 1.40 retrieving revision 1.40.2.1 diff -C2 -d -r1.40 -r1.40.2.1 *** POP3.pm 26 Feb 2003 04:35:12 -0000 1.40 --- POP3.pm 2 Mar 2003 19:26:53 -0000 1.40.2.1 *************** *** 265,269 **** delete $self->{children}{$kid}; ! debug( $self, "Done with $kid (" . (length(keys %{$self->{children}})-1) . " to go)" ); } } --- 265,269 ---- delete $self->{children}{$kid}; ! debug( $self, "Done with $kid (" . scalar( keys %{$self->{children}} ) . " to go)" ); } } |
From: <jgr...@us...> - 2003-02-28 02:08:39
|
Update of /cvsroot/popfile/engine In directory sc8-pr-cvs1:/tmp/cvs-serv13002 Modified Files: Makefile Log Message: UI::HTML was missing from the ZIP package instructions Index: Makefile =================================================================== RCS file: /cvsroot/popfile/engine/Makefile,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Makefile 28 Feb 2003 02:01:33 -0000 1.5 --- Makefile 28 Feb 2003 02:08:36 -0000 1.6 *************** *** 21,28 **** # build a ZIPped up package of POPFile ! BUILD_ZIP=wzzip -r -P popfile.zip -a $^ popfile.zip: core manual skins ! core: popfile.pl pix.gif black.gif insert.pl Classifier/*.pm POPFile/Configuration.pm POPFile/Logger.pm Proxy/POP3.pm rm -f popfile.zip $(BUILD_ZIP) --- 21,28 ---- # build a ZIPped up package of POPFile ! BUILD_ZIP=wzzip -P popfile.zip -a $^ popfile.zip: core manual skins ! core: popfile.pl pix.gif black.gif insert.pl Classifier/*.pm POPFile/Configuration.pm POPFile/Logger.pm Proxy/POP3.pm UI/HTML.pm *.change rm -f popfile.zip $(BUILD_ZIP) |
From: <jgr...@us...> - 2003-02-28 02:01:38
|
Update of /cvsroot/popfile/engine In directory sc8-pr-cvs1:/tmp/cvs-serv10715 Modified Files: Makefile Log Message: Update the makefile so that we handle the new skins and don't include SMTP.pm and Module.pm in the package Index: Makefile =================================================================== RCS file: /cvsroot/popfile/engine/Makefile,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Makefile 7 Feb 2003 22:20:45 -0000 1.4 --- Makefile 28 Feb 2003 02:01:33 -0000 1.5 *************** *** 6,10 **** # Copyright (c) 2003 John Graham-Cumming ! .PHONY: test package windows # test runs the POPFile unit test suite --- 6,13 ---- # Copyright (c) 2003 John Graham-Cumming ! .PHONY: test package windows core manual skins ! ! error: ! @echo Must specify one of test, package or windows # test runs the POPFile unit test suite *************** *** 18,25 **** # build a ZIPped up package of POPFile ! popfile.zip: popfile.pl pix.gif black.gif insert.pl Classifier/*.pm POPFile/*.pm Proxy/*.pm manual/*.gif manual/*/*.html languages/*.msg skins/*.css skins/*.gif ! rm -f $@ ! wzzip -r -P $@ -a $^ # package builds a zip file containing the POPFile package and the windows # installer --- 21,37 ---- # build a ZIPped up package of POPFile ! BUILD_ZIP=wzzip -r -P popfile.zip -a $^ ! popfile.zip: core manual skins + core: popfile.pl pix.gif black.gif insert.pl Classifier/*.pm POPFile/Configuration.pm POPFile/Logger.pm Proxy/POP3.pm + rm -f popfile.zip + $(BUILD_ZIP) + + manual: manual/*.gif manual/en/*.html languages/*.msg + $(BUILD_ZIP) + + skins: skins/*.css skins/*.gif skins/*/*.gif + $(BUILD_ZIP) + # package builds a zip file containing the POPFile package and the windows # installer |
Update of /cvsroot/popfile/engine/tests In directory sc8-pr-cvs1:/tmp/cvs-serv9451 Modified Files: TestMailParse001.cam TestMailParse002.cam TestMailParse003.cam TestMailParse004.cam TestMailParse005.cam TestMailParse006.cam TestMailParse007.cam TestMailParse008.cam TestMailParse009.cam TestMailParse010.cam TestMailParse011.cam TestMailParse012.cam TestMailParse013.cam TestMailParse014.cam TestMailParse015.cam TestMailParse016.cam TestMailParse017.cam TestMailParse018.cam TestMailParse019.cam TestMailParse020.cam TestMailParse021.cam Log Message: Update classify_and_modify tests because I just fixed a bug where we would correctly remove a non messages/ prefix from the XPL links and the test suite actually contained incorrect tests that relied on this bug Index: TestMailParse001.cam =================================================================== RCS file: /cvsroot/popfile/engine/tests/TestMailParse001.cam,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestMailParse001.cam 20 Feb 2003 21:30:34 -0000 1.1 --- TestMailParse001.cam 28 Feb 2003 01:57:23 -0000 1.2 *************** *** 2,6 **** Subject: [spam] X-Text-Classification: spam ! X-POPFile-Link: <http://127.0.0.1:8080/jump_to_message?view=tests/popfile0=0.msg> Testing S P A C E D out words spaced out in a document. --- 2,6 ---- Subject: [spam] X-Text-Classification: spam ! X-POPFile-Link: <http://127.0.0.1:8080/jump_to_message?view=popfile0=0.msg> Testing S P A C E D out words spaced out in a document. Index: TestMailParse002.cam =================================================================== RCS file: /cvsroot/popfile/engine/tests/TestMailParse002.cam,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestMailParse002.cam 20 Feb 2003 21:30:35 -0000 1.1 --- TestMailParse002.cam 28 Feb 2003 01:57:23 -0000 1.2 *************** *** 2,6 **** Subject: [spam] X-Text-Classification: spam ! X-POPFile-Link: <http://127.0.0.1:8080/jump_to_message?view=tests/popfile0=0.msg> who wants to be a millionaire milli<!---->onaire mi<!-- testing -->llionaire millionair<!-- -->e --- 2,6 ---- Subject: [spam] X-Text-Classification: spam ! X-POPFile-Link: <http://127.0.0.1:8080/jump_to_message?view=popfile0=0.msg> who wants to be a millionaire milli<!---->onaire mi<!-- testing -->llionaire millionair<!-- -->e Index: TestMailParse003.cam =================================================================== RCS file: /cvsroot/popfile/engine/tests/TestMailParse003.cam,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestMailParse003.cam 20 Feb 2003 21:30:35 -0000 1.1 --- TestMailParse003.cam 28 Feb 2003 01:57:23 -0000 1.2 *************** *** 31,34 **** --=gs6mlah1knva3tk5nbs4422k3570q7m3k==-- X-Text-Classification: spam ! X-POPFile-Link: <http://127.0.0.1:8080/jump_to_message?view=tests/popfile0=0.msg> --- 31,34 ---- --=gs6mlah1knva3tk5nbs4422k3570q7m3k==-- X-Text-Classification: spam ! X-POPFile-Link: <http://127.0.0.1:8080/jump_to_message?view=popfile0=0.msg> Index: TestMailParse004.cam =================================================================== RCS file: /cvsroot/popfile/engine/tests/TestMailParse004.cam,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestMailParse004.cam 20 Feb 2003 21:30:36 -0000 1.1 --- TestMailParse004.cam 28 Feb 2003 01:57:23 -0000 1.2 *************** *** 10,14 **** X-UIDL: B<E!!^8S!!0'="!J;6"! X-Text-Classification: spam ! X-POPFile-Link: <http://127.0.0.1:8080/jump_to_message?view=tests/popfile0=0.msg> ------=_NextPart_000_60BF_00005753.000048CC --- 10,14 ---- X-UIDL: B<E!!^8S!!0'="!J;6"! X-Text-Classification: spam ! X-POPFile-Link: <http://127.0.0.1:8080/jump_to_message?view=popfile0=0.msg> ------=_NextPart_000_60BF_00005753.000048CC Index: TestMailParse005.cam =================================================================== RCS file: /cvsroot/popfile/engine/tests/TestMailParse005.cam,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestMailParse005.cam 20 Feb 2003 21:30:36 -0000 1.1 --- TestMailParse005.cam 28 Feb 2003 01:57:23 -0000 1.2 *************** *** 6,10 **** X-UIDL: ll'"!$DC!!7ld"!85K!! X-Text-Classification: spam ! X-POPFile-Link: <http://127.0.0.1:8080/jump_to_message?view=tests/popfile0=0.msg> Below is the result of your feedback form. It was submitted by --- 6,10 ---- X-UIDL: ll'"!$DC!!7ld"!85K!! X-Text-Classification: spam ! X-POPFile-Link: <http://127.0.0.1:8080/jump_to_message?view=popfile0=0.msg> Below is the result of your feedback form. It was submitted by Index: TestMailParse006.cam =================================================================== RCS file: /cvsroot/popfile/engine/tests/TestMailParse006.cam,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestMailParse006.cam 20 Feb 2003 21:30:36 -0000 1.1 --- TestMailParse006.cam 28 Feb 2003 01:57:23 -0000 1.2 *************** *** 2,6 **** Subject: [spam] X-Text-Classification: spam ! X-POPFile-Link: <http://127.0.0.1:8080/jump_to_message?view=tests/popfile0=0.msg> We're so sure about the quality and effectiveness of our p.roducts, we --- 2,6 ---- Subject: [spam] X-Text-Classification: spam ! X-POPFile-Link: <http://127.0.0.1:8080/jump_to_message?view=popfile0=0.msg> We're so sure about the quality and effectiveness of our p.roducts, we Index: TestMailParse007.cam =================================================================== RCS file: /cvsroot/popfile/engine/tests/TestMailParse007.cam,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestMailParse007.cam 20 Feb 2003 21:30:37 -0000 1.1 --- TestMailParse007.cam 28 Feb 2003 01:57:23 -0000 1.2 *************** *** 11,15 **** Subject: [spam] Think you've seen porn? How about a dog giving 5+ girls oral sex till they cum? X-Text-Classification: spam ! X-POPFile-Link: <http://127.0.0.1:8080/jump_to_message?view=tests/popfile0=0.msg> So you think you've seen some crazy porn? --- 11,15 ---- Subject: [spam] Think you've seen porn? How about a dog giving 5+ girls oral sex till they cum? X-Text-Classification: spam ! X-POPFile-Link: <http://127.0.0.1:8080/jump_to_message?view=popfile0=0.msg> So you think you've seen some crazy porn? Index: TestMailParse008.cam =================================================================== RCS file: /cvsroot/popfile/engine/tests/TestMailParse008.cam,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestMailParse008.cam 20 Feb 2003 21:30:37 -0000 1.1 --- TestMailParse008.cam 28 Feb 2003 01:57:23 -0000 1.2 *************** *** 14,18 **** Message-Id: <20030112013444.RTJR4607.priv-edtnes27.telusplanet.net@N1N> X-Text-Classification: spam ! X-POPFile-Link: <http://127.0.0.1:8080/jump_to_message?view=tests/popfile0=0.msg> <HTML><HEAD><TITLE></TITLE> --- 14,18 ---- Message-Id: <20030112013444.RTJR4607.priv-edtnes27.telusplanet.net@N1N> X-Text-Classification: spam ! X-POPFile-Link: <http://127.0.0.1:8080/jump_to_message?view=popfile0=0.msg> <HTML><HEAD><TITLE></TITLE> Index: TestMailParse009.cam =================================================================== RCS file: /cvsroot/popfile/engine/tests/TestMailParse009.cam,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestMailParse009.cam 20 Feb 2003 21:30:38 -0000 1.1 --- TestMailParse009.cam 28 Feb 2003 01:57:23 -0000 1.2 *************** *** 16,20 **** Message-ID: <avj...@FQ...valid> X-Text-Classification: spam ! X-POPFile-Link: <http://127.0.0.1:8080/jump_to_message?view=tests/popfile0=0.msg> <font color=white>*-*-**-*-*-*-*-*-*-*-*-*-*-*--*-*-*-*-*-*-*-*-*--*-*-*-*-*-*-* --- 16,20 ---- Message-ID: <avj...@FQ...valid> X-Text-Classification: spam ! X-POPFile-Link: <http://127.0.0.1:8080/jump_to_message?view=popfile0=0.msg> <font color=white>*-*-**-*-*-*-*-*-*-*-*-*-*-*--*-*-*-*-*-*-*-*-*--*-*-*-*-*-*-* Index: TestMailParse010.cam =================================================================== RCS file: /cvsroot/popfile/engine/tests/TestMailParse010.cam,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestMailParse010.cam 20 Feb 2003 21:30:40 -0000 1.1 --- TestMailParse010.cam 28 Feb 2003 01:57:23 -0000 1.2 *************** *** 17,21 **** Content-Transfer-Encoding: base64 X-Text-Classification: spam ! X-POPFile-Link: <http://127.0.0.1:8080/jump_to_message?view=tests/popfile0=0.msg> Q29uZ3JhdHVsYXRpb25zIQ0KDQpZb3UgaGF2ZSBiZWVuIHNlbGVjdGVkIHRvIHJlY2lldmUgbWVt --- 17,21 ---- Content-Transfer-Encoding: base64 X-Text-Classification: spam ! X-POPFile-Link: <http://127.0.0.1:8080/jump_to_message?view=popfile0=0.msg> Q29uZ3JhdHVsYXRpb25zIQ0KDQpZb3UgaGF2ZSBiZWVuIHNlbGVjdGVkIHRvIHJlY2lldmUgbWVt Index: TestMailParse011.cam =================================================================== RCS file: /cvsroot/popfile/engine/tests/TestMailParse011.cam,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestMailParse011.cam 20 Feb 2003 21:30:41 -0000 1.1 --- TestMailParse011.cam 28 Feb 2003 01:57:23 -0000 1.2 *************** *** 18,22 **** FILETIME=[8FDC2900:01BAAAABA] X-Text-Classification: spam ! X-POPFile-Link: <http://127.0.0.1:8080/jump_to_message?view=tests/popfile0=0.msg> I think you answered my ad longtime ago if it was not you I am sorry. --- 18,22 ---- FILETIME=[8FDC2900:01BAAAABA] X-Text-Classification: spam ! X-POPFile-Link: <http://127.0.0.1:8080/jump_to_message?view=popfile0=0.msg> I think you answered my ad longtime ago if it was not you I am sorry. Index: TestMailParse012.cam =================================================================== RCS file: /cvsroot/popfile/engine/tests/TestMailParse012.cam,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestMailParse012.cam 20 Feb 2003 21:30:42 -0000 1.1 --- TestMailParse012.cam 28 Feb 2003 01:57:23 -0000 1.2 *************** *** 16,20 **** X-POPFile-Link: <http://127.0.0.1:9090/jump_to_message?view=popfile2146=1.msg> X-Text-Classification: spam ! X-POPFile-Link: <http://127.0.0.1:8080/jump_to_message?view=tests/popfile0=0.msg> <html> --- 16,20 ---- X-POPFile-Link: <http://127.0.0.1:9090/jump_to_message?view=popfile2146=1.msg> X-Text-Classification: spam ! X-POPFile-Link: <http://127.0.0.1:8080/jump_to_message?view=popfile0=0.msg> <html> Index: TestMailParse013.cam =================================================================== RCS file: /cvsroot/popfile/engine/tests/TestMailParse013.cam,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestMailParse013.cam 20 Feb 2003 21:30:43 -0000 1.1 --- TestMailParse013.cam 28 Feb 2003 01:57:23 -0000 1.2 *************** *** 23,27 **** X-MBF-FILE: MDaemon Gateway to RFC822 (RFC822.MBF v1.0) X-Text-Classification: spam ! X-POPFile-Link: <http://127.0.0.1:8080/jump_to_message?view=tests/popfile0=0.msg> On Sun, 5 Jan 2003 22:46:10 -0800, --- 23,27 ---- X-MBF-FILE: MDaemon Gateway to RFC822 (RFC822.MBF v1.0) X-Text-Classification: spam ! X-POPFile-Link: <http://127.0.0.1:8080/jump_to_message?view=popfile0=0.msg> On Sun, 5 Jan 2003 22:46:10 -0800, Index: TestMailParse014.cam =================================================================== RCS file: /cvsroot/popfile/engine/tests/TestMailParse014.cam,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestMailParse014.cam 20 Feb 2003 21:30:44 -0000 1.1 --- TestMailParse014.cam 28 Feb 2003 01:57:23 -0000 1.2 *************** *** 10,14 **** X-OriginalArrivalTime: 26 Nov 2002 04:51:23.0664 (UTC) FILETIME=[785FA900:01C29507] X-Text-Classification: spam ! X-POPFile-Link: <http://127.0.0.1:8080/jump_to_message?view=tests/popfile0=0.msg> <BODY BGCOLOR="WHITE"> --- 10,14 ---- X-OriginalArrivalTime: 26 Nov 2002 04:51:23.0664 (UTC) FILETIME=[785FA900:01C29507] X-Text-Classification: spam ! X-POPFile-Link: <http://127.0.0.1:8080/jump_to_message?view=popfile0=0.msg> <BODY BGCOLOR="WHITE"> Index: TestMailParse015.cam =================================================================== RCS file: /cvsroot/popfile/engine/tests/TestMailParse015.cam,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestMailParse015.cam 20 Feb 2003 21:30:44 -0000 1.1 --- TestMailParse015.cam 28 Feb 2003 01:57:23 -0000 1.2 *************** *** 16,20 **** X-UIDL: &Tb"!2d_!!]9M!!OK]!! X-Text-Classification: spam ! X-POPFile-Link: <http://127.0.0.1:8080/jump_to_message?view=tests/popfile0=0.msg> ------=_NextPart_000_00C3_68A82A2C.D7041A60 --- 16,20 ---- X-UIDL: &Tb"!2d_!!]9M!!OK]!! X-Text-Classification: spam ! X-POPFile-Link: <http://127.0.0.1:8080/jump_to_message?view=popfile0=0.msg> ------=_NextPart_000_00C3_68A82A2C.D7041A60 Index: TestMailParse016.cam =================================================================== RCS file: /cvsroot/popfile/engine/tests/TestMailParse016.cam,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestMailParse016.cam 20 Feb 2003 21:30:44 -0000 1.1 --- TestMailParse016.cam 28 Feb 2003 01:57:23 -0000 1.2 *************** *** 2,6 **** Subject: [spam] X-Text-Classification: spam ! X-POPFile-Link: <http://127.0.0.1:8080/jump_to_message?view=tests/popfile0=0.msg> --- 2,6 ---- Subject: [spam] X-Text-Classification: spam ! X-POPFile-Link: <http://127.0.0.1:8080/jump_to_message?view=popfile0=0.msg> Index: TestMailParse017.cam =================================================================== RCS file: /cvsroot/popfile/engine/tests/TestMailParse017.cam,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestMailParse017.cam 20 Feb 2003 21:30:44 -0000 1.1 --- TestMailParse017.cam 28 Feb 2003 01:57:23 -0000 1.2 *************** *** 19,23 **** X-OriginalArrivalTime: 25 Jan 2003 07:51:07.0369 (UTC) X-Text-Classification: spam ! X-POPFile-Link: <http://127.0.0.1:8080/jump_to_message?view=tests/popfile0=0.msg> ------=_NextPart_000_33CD_00000E99.00006014 --- 19,23 ---- X-OriginalArrivalTime: 25 Jan 2003 07:51:07.0369 (UTC) X-Text-Classification: spam ! X-POPFile-Link: <http://127.0.0.1:8080/jump_to_message?view=popfile0=0.msg> ------=_NextPart_000_33CD_00000E99.00006014 Index: TestMailParse018.cam =================================================================== RCS file: /cvsroot/popfile/engine/tests/TestMailParse018.cam,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestMailParse018.cam 20 Feb 2003 21:30:44 -0000 1.1 --- TestMailParse018.cam 28 Feb 2003 01:57:23 -0000 1.2 *************** *** 20,24 **** X-POPFile-Link: http://127.0.0.1:8080/jump_to_message?view=popfile1043193600_48.msg X-Text-Classification: spam ! X-POPFile-Link: <http://127.0.0.1:8080/jump_to_message?view=tests/popfile0=0.msg> --isboundary --- 20,24 ---- X-POPFile-Link: http://127.0.0.1:8080/jump_to_message?view=popfile1043193600_48.msg X-Text-Classification: spam ! X-POPFile-Link: <http://127.0.0.1:8080/jump_to_message?view=popfile0=0.msg> --isboundary Index: TestMailParse019.cam =================================================================== RCS file: /cvsroot/popfile/engine/tests/TestMailParse019.cam,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestMailParse019.cam 20 Feb 2003 21:30:44 -0000 1.1 --- TestMailParse019.cam 28 Feb 2003 01:57:23 -0000 1.2 *************** *** 22,26 **** X-POPFile-Link: <http://127.0.0.1:8080/jump_to_message?view=popfile523=1.msg> X-Text-Classification: spam ! X-POPFile-Link: <http://127.0.0.1:8080/jump_to_message?view=tests/popfile0=0.msg> --isboundary --- 22,26 ---- X-POPFile-Link: <http://127.0.0.1:8080/jump_to_message?view=popfile523=1.msg> X-Text-Classification: spam ! X-POPFile-Link: <http://127.0.0.1:8080/jump_to_message?view=popfile0=0.msg> --isboundary Index: TestMailParse020.cam =================================================================== RCS file: /cvsroot/popfile/engine/tests/TestMailParse020.cam,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestMailParse020.cam 20 Feb 2003 21:36:43 -0000 1.1 --- TestMailParse020.cam 28 Feb 2003 01:57:23 -0000 1.2 *************** *** 25,29 **** X-Sender: 320...@t-... X-Text-Classification: spam ! X-POPFile-Link: <http://127.0.0.1:8080/jump_to_message?view=tests/popfile0=0.msg> --=.P.GDOi)uP6IbU+ --- 25,29 ---- X-Sender: 320...@t-... X-Text-Classification: spam ! X-POPFile-Link: <http://127.0.0.1:8080/jump_to_message?view=popfile0=0.msg> --=.P.GDOi)uP6IbU+ Index: TestMailParse021.cam =================================================================== RCS file: /cvsroot/popfile/engine/tests/TestMailParse021.cam,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestMailParse021.cam 25 Feb 2003 02:04:13 -0000 1.1 --- TestMailParse021.cam 28 Feb 2003 01:57:23 -0000 1.2 *************** *** 28,32 **** X-OriginalArrivalTime: 13 Feb 2003 02:51:23.0500 (UTC) FILETIME=[CB6012C0:01C2D30A] X-Text-Classification: spam ! X-POPFile-Link: <http://127.0.0.1:8080/jump_to_message?view=tests/popfile0=0.msg> <html><body><font face=Tahoma size=2 color=#FFFFFF><table border=0 width=489 height=41 bgcolor=#FFFFFF><tr><td width=100% height=35 bgcolor=#000000 align=center><font face=Impact size=3 color=#00FFFF>Take Control of Your Computer With This Top-of-the-Line Software!</font></td></tr></table><table border=5 cellspacing=3 width=489 cellpadding=3 bgcolor=#000080 bordercolor=#FFFFFF style="border-collapse: collapse" bordercolordark=#000000 height=567 bordercolorlight=#CCCCFF><tr><td width=467 height=555 bordercolorlight=#FFFFFF bordercolordark=#FFFF99><table border=6 width=100% height=86 bgcolor=#000000 bordercolor=#FFFFFF><tr><td width=100% height=80 align=center><b><font face=Tahoma size=6 color=#FFFFFF> --- 28,32 ---- X-OriginalArrivalTime: 13 Feb 2003 02:51:23.0500 (UTC) FILETIME=[CB6012C0:01C2D30A] X-Text-Classification: spam ! X-POPFile-Link: <http://127.0.0.1:8080/jump_to_message?view=popfile0=0.msg> <html><body><font face=Tahoma size=2 color=#FFFFFF><table border=0 width=489 height=41 bgcolor=#FFFFFF><tr><td width=100% height=35 bgcolor=#000000 align=center><font face=Impact size=3 color=#00FFFF>Take Control of Your Computer With This Top-of-the-Line Software!</font></td></tr></table><table border=5 cellspacing=3 width=489 cellpadding=3 bgcolor=#000080 bordercolor=#FFFFFF style="border-collapse: collapse" bordercolordark=#000000 height=567 bordercolorlight=#CCCCFF><tr><td width=467 height=555 bordercolorlight=#FFFFFF bordercolordark=#FFFF99><table border=6 width=100% height=86 bgcolor=#000000 bordercolor=#FFFFFF><tr><td width=100% height=80 align=center><b><font face=Tahoma size=6 color=#FFFFFF> |
From: <sta...@us...> - 2003-02-28 01:56:59
|
Update of /cvsroot/popfile/engine/skins In directory sc8-pr-cvs1:/tmp/cvs-serv9313 Modified Files: Sleet.css Log Message: D. Smith further tweaks - fixes Opera 605 anomalies and w3c validator warnings Index: Sleet.css =================================================================== RCS file: /cvsroot/popfile/engine/skins/Sleet.css,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Sleet.css 27 Feb 2003 23:19:55 -0000 1.3 --- Sleet.css 28 Feb 2003 01:56:55 -0000 1.4 *************** *** 52,55 **** --- 52,56 ---- width: 17em; background-image: none; + color: #FFFFFF; background-color: #545B7E; border: 1px outset #000000; *************** *** 58,61 **** --- 59,63 ---- width: 17em; background-image: none; + color: #FFFFFF; background-color: #545B7E; border: 1px outset #000000; *************** *** 155,158 **** --- 157,161 ---- font-size: 1em; text-decoration: underline; + border: 0; } :link:focus, :visited:focus { *************** *** 183,188 **** } ! .menuLink:hover { ! border: none; cursor: pointer; } --- 186,191 ---- } ! .menuLink:link:hover, .menuLink:visited:hover { ! border: 0; cursor: pointer; } *************** *** 228,231 **** --- 231,235 ---- height: 21px; background-repeat: no-repeat; + text-align: center; } *************** *** 235,238 **** --- 239,243 ---- height: 21px; background-repeat: no-repeat; + text-align: center; } |
From: <jgr...@us...> - 2003-02-28 01:45:58
|
Update of /cvsroot/popfile/engine/POPFile In directory sc8-pr-cvs1:/tmp/cvs-serv5532/POPFile Modified Files: Configuration.pm Log Message: Added code to write the PID of POPFile to a popfile.pid file in the current directory which can be controlled with the new piddir option Index: Configuration.pm =================================================================== RCS file: /cvsroot/popfile/engine/POPFile/Configuration.pm,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Configuration.pm 13 Feb 2003 21:24:17 -0000 1.6 --- Configuration.pm 28 Feb 2003 01:45:20 -0000 1.7 *************** *** 47,50 **** --- 47,55 ---- { my ( $self ) = @_; + + # This is the location where we store the PID of POPFile in a file + # called popfile.pid + + $self->{configuration}{piddir} = './'; return 1; *************** *** 62,65 **** --- 67,75 ---- my ( $self ) = @_; + if ( open PID, ">$self->{configuration}{piddir}popfile.pid" ) { + print PID "$$\n"; + close PID; + } + return 1; } *************** *** 75,78 **** --- 85,90 ---- { my ( $self ) = @_; + + unlink( "$self->{configuration}{piddir}popfile.pid" ); } |
From: <jgr...@us...> - 2003-02-28 00:21:08
|
Update of /cvsroot/popfile/engine/UI In directory sc8-pr-cvs1:/tmp/cvs-serv9180/UI Modified Files: HTML.pm Log Message: Added code to make sure that magnets do not have trailing or leading space and to automatically fix old magnets saved in the magnets files that have leading and trailing space Index: HTML.pm =================================================================== RCS file: /cvsroot/popfile/engine/UI/HTML.pm,v retrieving revision 1.97 retrieving revision 1.98 diff -C2 -d -r1.97 -r1.98 *** HTML.pm 27 Feb 2003 20:11:26 -0000 1.97 --- HTML.pm 28 Feb 2003 00:21:03 -0000 1.98 *************** *** 1352,1355 **** --- 1352,1364 ---- if ( $found == 0 ) { + + # It is possible to type leading or trailing white space in a magnet definition + # which can later cause mysterious failures because the whitespace is eaten by + # the browser when the magnet is displayed but is matched in the regular expression + # that does the magnet matching and will cause failures... so strip off the whitespace + + $self->{form}{text} =~ s/^[ \t]+//; + $self->{form}{text} =~ s/[ \t]+$//; + $self->{classifier}->{magnets}{$self->{form}{bucket}}{$self->{form}{type}}{$self->{form}{text}} = 1; $magnet_message = "<blockquote>" . sprintf( $self->{language}{Magnet_Error3}, "$self->{form}{type}: $self->{form}{text}", $self->{form}{bucket} ) . "</blockquote>"; |
From: <jgr...@us...> - 2003-02-28 00:21:06
|
Update of /cvsroot/popfile/engine/Classifier In directory sc8-pr-cvs1:/tmp/cvs-serv9180/Classifier Modified Files: Bayes.pm Log Message: Added code to make sure that magnets do not have trailing or leading space and to automatically fix old magnets saved in the magnets files that have leading and trailing space Index: Bayes.pm =================================================================== RCS file: /cvsroot/popfile/engine/Classifier/Bayes.pm,v retrieving revision 1.106 retrieving revision 1.107 diff -C2 -d -r1.106 -r1.107 *** Bayes.pm 28 Feb 2003 00:08:50 -0000 1.106 --- Bayes.pm 28 Feb 2003 00:21:03 -0000 1.107 *************** *** 444,447 **** --- 444,454 ---- my $value = $2; + # Some people were accidently creating magnets with trailing whitespace + # which really confused them later when their magnet did not match (see + # comment in UI::HTML::magnet for more detail) + + $value =~ s/^[ \t]+//g; + $value =~ s/[ \t]+$//g; + $value =~ s/\\(\?|\*|\||\(|\)|\[|\]|\{|\}|\^|\$|\.)/$1/g; $self->{magnets}{$bucket}{$type}{$value} = 1; |
From: <jgr...@us...> - 2003-02-28 00:08:54
|
Update of /cvsroot/popfile/engine/Classifier In directory sc8-pr-cvs1:/tmp/cvs-serv4776/Classifier Modified Files: Bayes.pm Log Message: There was a hardcoded reference to the messages/ directory which meant that if you used the msgdir command line option the XPL link would not work because the new directory name would not get stripped Index: Bayes.pm =================================================================== RCS file: /cvsroot/popfile/engine/Classifier/Bayes.pm,v retrieving revision 1.105 retrieving revision 1.106 diff -C2 -d -r1.105 -r1.106 *** Bayes.pm 27 Feb 2003 02:39:50 -0000 1.105 --- Bayes.pm 28 Feb 2003 00:08:50 -0000 1.106 *************** *** 867,871 **** # Add the XPL header ! $temp_file =~ s/messages\/(.*)/$1/; my $xpl = ''; --- 867,871 ---- # Add the XPL header ! $temp_file =~ s/.*\/([^\/]+)/$1/; my $xpl = ''; |
From: <sta...@us...> - 2003-02-27 23:19:59
|
Update of /cvsroot/popfile/engine/skins In directory sc8-pr-cvs1:/tmp/cvs-serv13570 Modified Files: Sleet.css Log Message: D. Smith revamp - syncs w/ accessibility fixes - class smartening - relative fonts Index: Sleet.css =================================================================== RCS file: /cvsroot/popfile/engine/skins/Sleet.css,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Sleet.css 20 Feb 2003 23:17:32 -0000 1.2 --- Sleet.css 27 Feb 2003 23:19:55 -0000 1.3 *************** *** 2,32 **** margin: 1%; color: #FFFFFF; - font-family: sans-serif; background-color: #7988A5; - text-align: center; - } - - .shell, .shellTop { - background-color: #424d63; - color: #FFFFFF; - border-collapse: collapse; - } - - .naked { - font-size: 8pt; font-family: sans-serif; ! padding: 5px; } ! table.head { ! width: 100%; ! font-family: sans-serif; ! text-align: left; } ! td.head { ! font-weight: bold; ! font-size: 12pt; ! font-family: arial, sans-serif; } --- 2,20 ---- margin: 1%; color: #FFFFFF; background-color: #7988A5; font-family: sans-serif; ! font-size: 67%; ! text-align: center; } ! h2 { ! font-weight: bold; ! font-size: 1.5em; } ! hr { ! color: #888888; ! background-color: transparent; ! height: 1px; } *************** *** 35,39 **** background-color: #BAB8C6; color: black; ! font-size: 8pt; font-weight: normal; margin: 0px 0px 0px 0px; --- 23,27 ---- background-color: #BAB8C6; color: black; ! font-size: 1em; font-weight: normal; margin: 0px 0px 0px 0px; *************** *** 41,65 **** } ! .submit { border: none; background-color: transparent; height: 22px; width: 99px; - font-size: 8pt; - font-weight: bold; - color: #FFFFFF; - margin: 0px 0px 0px 0px; - padding: 0px 0px 0px 0px; background-image: url(sleetImages/button.gif); cursor: pointer; } .shellTopCenter { - background-image: url(sleetImages/top.gif); - background-repeat: repeat-x; height: 21px; ! padding: 0px; ! margin: 0px; border: none; } --- 29,79 ---- } ! * html .checkbox { ! border: none; ! background-color: transparent; ! } ! ! ! .submit, .toggleOn, .toggleOff, .deleteButton, .undoButton, .reclassifyButton { border: none; + color: #FFFFFF; background-color: transparent; + font-size: 1em; + font-weight: bold; + margin: 0; + padding: 0; height: 22px; width: 99px; background-image: url(sleetImages/button.gif); cursor: pointer; } + #securityAcceptPOP3Off { + width: 17em; + background-image: none; + background-color: #545B7E; + border: 1px outset #000000; + } + #securityAcceptHTTPOff { + width: 17em; + background-image: none; + background-color: #545B7E; + border: 1px outset #000000; + } + + + .shell, .shellTop { + background-color: #424d63; + color: #FFFFFF; + border-collapse: collapse; + } + .shellTopCenter { height: 21px; ! padding: 0; ! margin: 0; border: none; + background-image: url(sleetImages/top.gif); + background-repeat: repeat-x; } *************** *** 67,72 **** height: 21px; width: 27px; ! padding: 0px; ! margin: 0px; border: none; background-image: url(sleetImages/topLeft.gif); --- 81,86 ---- height: 21px; width: 27px; ! padding: 0; ! margin: 0; border: none; background-image: url(sleetImages/topLeft.gif); *************** *** 77,82 **** height: 21px; width: 25px; ! padding: 0px; ! margin: 0px; border: none; background-image: url(sleetImages/topRight.gif); --- 91,96 ---- height: 21px; width: 25px; ! padding: 0; ! margin: 0; border: none; background-image: url(sleetImages/topRight.gif); *************** *** 85,92 **** .shellLeft { - padding: 0px; - margin: 0px; - border: none; width: 27px; background-image: url(sleetImages/left.gif); background-repeat: repeat-y; --- 99,106 ---- .shellLeft { width: 27px; + padding: 0; + margin: 0; + border: none; background-image: url(sleetImages/left.gif); background-repeat: repeat-y; *************** *** 94,147 **** .shellRight { ! padding: 0px; ! margin: 0px; border: none; background-image: url(sleetImages/right.gif); - width: 25px; background-repeat: repeat-y; } .shellBottomCenter { ! padding: 0px; ! margin: 0px; border: none; background-image: url(sleetImages/bottom.gif); background-repeat: repeat-x; - height: 22px; } .shellBottomLeft { - padding: 0px; - margin: 0px; - border: none; - background-image: url(sleetImages/bottomLeft.gif); width: 27px; height: 22px; background-repeat: no-repeat; } .shellBottomRight { ! padding: 0px; ! margin: 0px; border: none; background-image: url(sleetImages/bottomRight.gif); - width: 25px; background-repeat: no-repeat; - height: 22px; } ! .menu { ! background-image: url(sleetImages/menu.gif); ! font-weight: normal; ! font-size: 10pt; ! width: 100%; } ! .menuLink { ! color: #ffffff; background-color: transparent; text-decoration: none; font-weight: bold; - font-size: 8pt; } --- 108,184 ---- .shellRight { ! width: 25px; ! padding: 0; ! margin: 0; border: none; background-image: url(sleetImages/right.gif); background-repeat: repeat-y; } .shellBottomCenter { ! height: 22px; ! padding: 0; ! margin: 0; border: none; background-image: url(sleetImages/bottom.gif); background-repeat: repeat-x; } .shellBottomLeft { width: 27px; height: 22px; + padding: 0; + margin: 0; + border: none; + background-image: url(sleetImages/bottomLeft.gif); background-repeat: no-repeat; } .shellBottomRight { ! height: 22px; ! width: 25px; ! padding: 0; ! margin: 0; border: none; background-image: url(sleetImages/bottomRight.gif); background-repeat: no-repeat; } ! .naked { ! font-size: 1em; ! font-family: sans-serif; ! padding: 5px; } ! ! :link, :visited { ! font-size: 1em; ! text-decoration: underline; ! } ! :link:focus, :visited:focus { ! color: #FFFFFF; ! background-color: transparent; ! } ! :link { ! color: #FFFFFF; ! background-color: transparent; ! } ! :visited { ! color: #FFFFFF; ! background-color: transparent; ! } ! :link:hover, :visited:hover { ! border: 1px #FFFFFF solid; ! } ! :link:active, :visited:active { ! color: #FFFFFF; ! background-color: transparent; ! } ! ! .menuLink:link, .menuLink:visited { ! color: #FFFFFF; background-color: transparent; text-decoration: none; font-weight: bold; } *************** *** 151,156 **** } ! .menuSelected { background-image: url(sleetImages/menuButton.gif); width: 109px; --- 188,227 ---- } + .bottomLink:link, .bottomLink:visited { + color: #000000; + background-color: transparent; + } ! .bottomLink:link:hover, .bottomLink:visited:hover { ! color: #000000; ! background-color: transparent; ! } ! ! .colorChooserLink:link:hover, .colorChooserLink:visited:hover { ! border: 0; ! } ! ! ! table.head { ! width: 100%; ! font-family: sans-serif; ! text-align: left; ! } ! ! td.head { ! font-weight: bold; ! font-size: 1.5em; ! font-family: arial, sans-serif; ! } ! ! ! .menu { ! background-image: url(sleetImages/menu.gif); ! font-weight: normal; ! font-size: 1.25em; ! width: 100%; ! } ! ! .menuStandard { background-image: url(sleetImages/menuButton.gif); width: 109px; *************** *** 159,196 **** } ! .menuStandard { background-image: url(sleetImages/menuButton.gif); width: 109px; height: 21px; background-repeat: no-repeat; - } .menuIndent { - background-image: none; color: #FFFFFF; background-color: #7988a5; ! padding: 0px; ! margin: 0px; ! width: 0px; } ! .rowEven, .rowEven a { ! font-size: 8pt; ! color: #FFFFFF; ! background-color: transparent; } .rowOdd { ! color: #AAAAAA; background-color: #545F74; } - .rowOdd a { - font-size: 8pt; - color: #AAAAAA; - background-color: transparent; - } - .rowOdd td { border-top: 1px #888888 solid; --- 230,260 ---- } ! .menuSelected { background-image: url(sleetImages/menuButton.gif); width: 109px; height: 21px; background-repeat: no-repeat; } .menuIndent { color: #FFFFFF; background-color: #7988a5; ! padding: 0; ! margin: 0; ! width: 0; } ! .menuSpacer { ! padding: 0; ! margin: 0; ! width: 0; } + .rowOdd { ! color: #FFFFFF; background-color: #545F74; } .rowOdd td { border-top: 1px #888888 solid; *************** *** 198,211 **** } ! tr.rowHighlighted { color: #EEEEEE; background-color: #545f74; } ! td.openMessageCloser { text-align: right; } ! td.openMessageBody { text-align: left; } --- 262,287 ---- } ! .rowEven, .rowEven :link, .rowEven :visited { ! color: #BBBBBB; ! background-color: transparent; ! } ! ! .rowHighlighted { color: #EEEEEE; background-color: #545f74; } ! .openMessageTable, .lookupResultsTable { ! border: 1px solid #888888; ! color: #FFFFFF; ! background-color: #545F74; ! } ! ! .openMessageCloser { text-align: right; } ! .openMessageBody { ! font-size: 1.2em; text-align: left; } *************** *** 237,254 **** } ! span.graphfont { font-size: x-small; } - h2 { - font-weight: bold; - font-size: 12pt; - } - .historyLabel { font-weight: normal; } ! .historyLabel em { font-weight: bold; font-style: normal; --- 313,325 ---- } ! span.graphFont { font-size: x-small; } .historyLabel { font-weight: normal; } ! .historyLabelSort { font-weight: bold; font-style: normal; *************** *** 283,317 **** } ! td.logo2menuspace { ! height: 1.0em; ! } ! ! a { ! font-size: 10pt; ! color: #FFFFFF; ! text-decoration: underline; ! background-color: transparent; ! } ! ! a:hover { ! border: 1px #FFFFFF solid; ! } ! ! hr { ! color: #888888; ! background-color: transparent; ! height: 1px; ! } ! ! .menuSpacer { ! padding-right: 0px; ! padding-left: 0px; ! padding-bottom: 0px; ! margin: 0px; ! width: 0px; ! padding-top: 0px } - .settingsTable, .settingsPanel { border: 1px solid #888888; --- 354,361 ---- } ! .logo2menuSpace { ! height: 1em; } .settingsTable, .settingsPanel { border: 1px solid #888888; *************** *** 320,329 **** } - .openMessageTable, .lookupResultsTable { - border: 1px solid #888888; - color: #FFFFFF; - background-color: #545F74; - } - .footer { background-image: url(sleetImages/menu.gif); --- 364,367 ---- *************** *** 333,345 **** height: 22px; width: 80%; ! font-size: 8pt; background-color: transparent; color: #000000; } ! .bottomLink { ! font-size: 8pt; ! color: #000000; ! background-color: transparent; } --- 371,389 ---- height: 22px; width: 80%; ! font-size: 1em; background-color: transparent; color: #000000; } ! .historyNavigatorTop, .historyNavigatorBottom { ! text-align: right; ! } ! ! .lineImg { ! width: 4px; ! } ! ! .colorChooserTable td { ! border: 0; } |
From: <jgr...@us...> - 2003-02-27 20:11:32
|
Update of /cvsroot/popfile/engine/UI In directory sc8-pr-cvs1:/tmp/cvs-serv2500/UI Modified Files: HTML.pm Log Message: Sam left a print statement in HTML.pm so I converted it to a debug statement instead Index: HTML.pm =================================================================== RCS file: /cvsroot/popfile/engine/UI/HTML.pm,v retrieving revision 1.96 retrieving revision 1.97 diff -C2 -d -r1.96 -r1.97 *** HTML.pm 27 Feb 2003 09:49:38 -0000 1.96 --- HTML.pm 27 Feb 2003 20:11:26 -0000 1.97 *************** *** 3417,3421 **** $mail_file =~ /(popfile.+\=.+\.msg)/; $mail_file = $1; ! print "delete: $mail_file\n"; if ( $archive ) { --- 3417,3421 ---- $mail_file =~ /(popfile.+\=.+\.msg)/; $mail_file = $1; ! $self->{logger}->debug( "delete: $mail_file" ); if ( $archive ) { |
From: <jgr...@us...> - 2003-02-27 17:58:17
|
Update of /cvsroot/popfile/windows In directory sc8-pr-cvs1:/tmp/cvs-serv6313 Modified Files: installer.nsi Log Message: Move the insertion of the MUI_SYSTEM macro to the before other MUI macros are inserted because this makes the Uninstall button appear correctly when uninstalling; remove the RC2 in the version number Index: installer.nsi =================================================================== RCS file: /cvsroot/popfile/windows/installer.nsi,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** installer.nsi 27 Feb 2003 00:20:05 -0000 1.32 --- installer.nsi 27 Feb 2003 17:58:11 -0000 1.33 *************** *** 4,8 **** ; Modified to work with NSIS v2.0b1 !define MUI_PRODUCT "POPFile" ! !define MUI_VERSION "0.18.1 RC2" !include "MUI.nsh" ;-------------------------------- --- 4,8 ---- ; Modified to work with NSIS v2.0b1 !define MUI_PRODUCT "POPFile" ! !define MUI_VERSION "0.18.1" !include "MUI.nsh" ;-------------------------------- *************** *** 33,36 **** --- 33,38 ---- !define OEIDENT $8 !define ACCTID $9 + + !insertmacro MUI_SYSTEM ;Language *************** *** 117,125 **** FunctionEnd - - ;-------------------------------- - ;Modern UI System - - !insertmacro MUI_SYSTEM ;-------------------------------- --- 119,122 ---- |
From: <ssc...@us...> - 2003-02-27 09:49:42
|
Update of /cvsroot/popfile/engine/tests In directory sc8-pr-cvs1:/tmp/cvs-serv3131/tests Modified Files: TestMailParse010.wrd Log Message: fixed possible handle leak in archive code. made spaced word detector more aggressive at word edges and updated spaced tests Index: TestMailParse010.wrd =================================================================== RCS file: /cvsroot/popfile/engine/tests/TestMailParse010.wrd,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestMailParse010.wrd 20 Jan 2003 20:11:59 -0000 1.1 --- TestMailParse010.wrd 27 Feb 2003 09:49:38 -0000 1.2 *************** *** 1,54 **** ! site 1 ! membership 1 ! less 1 ! congratulations 1 ! here 2 rm_...@ma... 1 ! lottery 1 ! simply 1 ! offers 1 ! instanthome 1 ! free 1 ! 65.100.247.142 2 ! selected 1 myrealbox.com 1 ! every 1 ! vasya 1 ! bestpornhost.com 1 adult 1 ! min 1 digitalme.com 1 ! encoding:base64 1 ! error 1 ! niche 1 ! click 1 ! further 1 ! high 1 best 2 section 1 - imagine 1 notices 1 ! subject:regarding 1 ! to:myrealbox.com 1 ! receive 1 ! card 1 ! than 1 mail.com 1 credit 1 ! trick:spacedout 9 ! recieve 1 ! to:ar...@my... 1 ! subject:activation 1 ! sites 1 ! needed 1 contant 1 ! choice 1 ! member 1 ! 193.97.97.75 1 ! wish 1 ! mailing 1 ! from:iplvwq 1 ! from:u's'a 1 cs...@my... 1 ! authenticated 2 ! quality 1 --- 1,54 ---- ! niche 1 rm_...@ma... 1 ! authenticated 2 myrealbox.com 1 ! subject:activation 1 ! less 1 ! further 1 ! membership 1 adult 1 ! bestpornhost.com 1 ! 193.97.97.75 1 ! sites 1 ! member 1 ! recieve 1 ! simply 1 ! receive 1 ! card 1 digitalme.com 1 ! wish 1 ! subject:regarding 1 best 2 + encoding:base64 1 + to:ar...@my... 1 + here 2 + instanthome 1 + mailing 1 section 1 notices 1 ! needed 1 ! high 1 ! free 1 ! offers 1 ! error 1 ! vasya 1 mail.com 1 + quality 1 + choice 1 + congratulations 1 + imagine 1 + from:usa 1 + min 1 + to:myrealbox.com 1 credit 1 ! than 1 ! every 1 contant 1 ! trick:spacedout 10 ! 65.100.247.142 2 ! click 1 ! site 1 cs...@my... 1 ! from:lottery 1 ! from:iplvwq 1 ! selected 1 |
From: <ssc...@us...> - 2003-02-27 09:49:41
|
Update of /cvsroot/popfile/engine/UI In directory sc8-pr-cvs1:/tmp/cvs-serv3131/UI Modified Files: HTML.pm Log Message: fixed possible handle leak in archive code. made spaced word detector more aggressive at word edges and updated spaced tests Index: HTML.pm =================================================================== RCS file: /cvsroot/popfile/engine/UI/HTML.pm,v retrieving revision 1.95 retrieving revision 1.96 diff -C2 -d -r1.95 -r1.96 *** HTML.pm 27 Feb 2003 00:55:24 -0000 1.95 --- HTML.pm 27 Feb 2003 09:49:38 -0000 1.96 *************** *** 3414,3420 **** { my ( $self, $mail_file, $archive ) = @_; ! $mail_file =~ /(popfile.+\=.+\.msg)/; $mail_file = $1; if ( $archive ) { --- 3414,3421 ---- { my ( $self, $mail_file, $archive ) = @_; ! $mail_file =~ /(popfile.+\=.+\.msg)/; $mail_file = $1; + print "delete: $mail_file\n"; if ( $archive ) { *************** *** 3476,3482 **** print TO $_; } - close FROM; - } close TO; } } --- 3477,3483 ---- print TO $_; } close TO; + } + close FROM; } } |
From: <ssc...@us...> - 2003-02-27 09:49:41
|
Update of /cvsroot/popfile/engine/Classifier In directory sc8-pr-cvs1:/tmp/cvs-serv3131/Classifier Modified Files: MailParse.pm Log Message: fixed possible handle leak in archive code. made spaced word detector more aggressive at word edges and updated spaced tests Index: MailParse.pm =================================================================== RCS file: /cvsroot/popfile/engine/Classifier/MailParse.pm,v retrieving revision 1.90 retrieving revision 1.91 diff -C2 -d -r1.90 -r1.91 *** MailParse.pm 25 Feb 2003 02:04:12 -0000 1.90 --- MailParse.pm 27 Feb 2003 09:49:38 -0000 1.91 *************** *** 257,265 **** # without using the encoded content printer or modifying $self->{ut} ! foreach my $space (' ', '\'', '*', '^', '`' ){ ! while ( $line =~ s/ (([A-Z]\Q$space\E){2,15}[A-Z])( |\Q$space\E|[!\?])/ /i ) { ! my $word = $1; $word =~ s/\Q$space\E//g; ! update_word( $self, $word, $encoded, ' ', ' ', '' ); increment_word( $self, 'trick:spacedout' ); } --- 257,267 ---- # without using the encoded content printer or modifying $self->{ut} ! foreach my $space (' ', '\'', '*', '^', '`', ' ', '\38' ){ ! while ( $line =~ s/( |^)(([A-Z]\Q$space\E){2,15}[A-Z])( |\Q$space\E|[!\?])/ /i ) { ! my $word = $2; ! print "$word ->" if $self->{debug}; $word =~ s/\Q$space\E//g; ! print "$word\n" if $self->{debug}; ! update_word( $self, $word, $encoded, ' ', ' ', $prefix); increment_word( $self, 'trick:spacedout' ); } |
From: <jgr...@us...> - 2003-02-27 02:39:55
|
Update of /cvsroot/popfile/engine/Classifier In directory sc8-pr-cvs1:/tmp/cvs-serv938/Classifier Modified Files: Bayes.pm Log Message: Add a little safety check on the color files because bonelifer had created empty color files which would cause a problem Index: Bayes.pm =================================================================== RCS file: /cvsroot/popfile/engine/Classifier/Bayes.pm,v retrieving revision 1.104 retrieving revision 1.105 diff -C2 -d -r1.104 -r1.105 *** Bayes.pm 27 Feb 2003 00:40:12 -0000 1.104 --- Bayes.pm 27 Feb 2003 02:39:50 -0000 1.105 *************** *** 349,353 **** if ( open COLOR, "<$bucket/color" ) { $color = <COLOR>; ! $color =~ s/[\r\n]//g; close COLOR; } --- 349,365 ---- if ( open COLOR, "<$bucket/color" ) { $color = <COLOR>; ! ! # Someone (who shall remain nameless) went in an manually created ! # empty color files in their corpus directories which would cause ! # $color at this point to be undefined and hence you'd get warnings ! # about undefined variables below. So this little test is to deal ! # with that user and to make POPFile a little safer which is always ! # a good thing ! ! if ( !defined( $color ) ) { ! $color = ''; ! } else { ! $color =~ s/[\r\n]//g; ! } close COLOR; } |
From: <jgr...@us...> - 2003-02-27 00:55:28
|
Update of /cvsroot/popfile/engine/tests In directory sc8-pr-cvs1:/tmp/cvs-serv29404/tests Added Files: TestHTML.tst Log Message: Fix bug where you couldn't delete magnets with special characters in them; lesson is that you should not call url_encode on form values because the browser will do the URL encoding for you; add the start of a test suite for HTML.pm that does some simple tests on url_encode --- NEW FILE: TestHTML.tst --- # --------------------------------------------------------------------------------------------- # # Tests for HTML.pm # # Copyright (c) 2003 John Graham-Cumming # # --------------------------------------------------------------------------------------------- use UI::HTML; my $c = new UI::HTML; test_assert_equal( $c->url_encode( ']' ), '%5d' ); test_assert_equal( $c->url_encode( '[' ), '%5b' ); test_assert_equal( $c->url_encode( '[]' ), '%5b%5d' ); test_assert_equal( $c->url_encode( '[foo]' ), '%5bfoo%5d' ); |
From: <jgr...@us...> - 2003-02-27 00:55:28
|
Update of /cvsroot/popfile/engine/UI In directory sc8-pr-cvs1:/tmp/cvs-serv29404/UI Modified Files: HTML.pm Log Message: Fix bug where you couldn't delete magnets with special characters in them; lesson is that you should not call url_encode on form values because the browser will do the URL encoding for you; add the start of a test suite for HTML.pm that does some simple tests on url_encode Index: HTML.pm =================================================================== RCS file: /cvsroot/popfile/engine/UI/HTML.pm,v retrieving revision 1.94 retrieving revision 1.95 diff -C2 -d -r1.94 -r1.95 *** HTML.pm 27 Feb 2003 00:40:15 -0000 1.94 --- HTML.pm 27 Feb 2003 00:55:24 -0000 1.95 *************** *** 1400,1404 **** $body .= "<input type=\"hidden\" name=\"bucket\" value=\"$bucket\" />\n"; $body .= "<input type=\"hidden\" name=\"dtype\" value=\"$type\" />\n"; ! $body .= "<input type=\"hidden\" name=\"dmagnet\" value=\"" . url_encode($self, "$validatingMagnet") . "\" />\n"; $body .= "<input type=\"hidden\" name=\"session\" value=\"$self->{session_key}\" />\n"; $body .= "</form>\n</td>\n"; --- 1400,1404 ---- $body .= "<input type=\"hidden\" name=\"bucket\" value=\"$bucket\" />\n"; $body .= "<input type=\"hidden\" name=\"dtype\" value=\"$type\" />\n"; ! $body .= "<input type=\"hidden\" name=\"dmagnet\" value=\"$validatingMagnet\" />\n"; $body .= "<input type=\"hidden\" name=\"session\" value=\"$self->{session_key}\" />\n"; $body .= "</form>\n</td>\n"; |
From: <jgr...@us...> - 2003-02-27 00:40:23
|
Update of /cvsroot/popfile/engine/UI In directory sc8-pr-cvs1:/tmp/cvs-serv24532/UI Modified Files: HTML.pm Log Message: Walk through and make sure that everytime we use a variable inside a regular expression we surround it with \Q and \E to prevent special characters inside the variable Index: HTML.pm =================================================================== RCS file: /cvsroot/popfile/engine/UI/HTML.pm,v retrieving revision 1.93 retrieving revision 1.94 diff -C2 -d -r1.93 -r1.94 *** HTML.pm 27 Feb 2003 00:00:50 -0000 1.93 --- HTML.pm 27 Feb 2003 00:40:15 -0000 1.94 *************** *** 2993,2999 **** my $arg = $2; ! if ( $head =~ /$header/i ) { ! if ( $arg =~ /$text/i ) { ! $line =~ s/($text)/<b><font color\"$self->{classifier}->{colors}{$self->{history_}{$mail_file}{bucket}}\">$1<\/font><\/b>/; } } --- 2993,2999 ---- my $arg = $2; ! if ( $head =~ /\Q$header\E/i ) { ! if ( $arg =~ /\Q$text\E/i ) { ! $line =~ s/(\Q$text\E)/<b><font color\"$self->{classifier}->{colors}{$self->{history_}{$mail_file}{bucket}}\">$1<\/font><\/b>/; } } |