|
From: <jgr...@us...> - 2003-06-14 21:10:15
|
Update of /cvsroot/popfile/engine/Proxy
In directory sc8-pr-cvs1:/tmp/cvs-serv29263/Proxy
Modified Files:
NNTP.pm POP3.pm Proxy.pm SMTP.pm
Log Message:
Added new message queuing engine for asynchronous message passing, use it for classification data and UI registrations, remove mcount and ecount global variables, add new access to all configuration options on Advanced page
Index: NNTP.pm
===================================================================
RCS file: /cvsroot/popfile/engine/Proxy/NNTP.pm,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** NNTP.pm 28 May 2003 20:33:20 -0000 1.10
--- NNTP.pm 14 Jun 2003 21:10:12 -0000 1.11
***************
*** 73,87 ****
# item that needs a UI component
! $self->{ui__}->register_configuration_item( 'configuration',
! 'nntp_port',
! $self );
! $self->{ui__}->register_configuration_item( 'configuration',
! 'nntp_separator',
! $self );
! $self->{ui__}->register_configuration_item( 'security',
! 'nntp_local',
! $self );
return 1;
--- 73,87 ----
# item that needs a UI component
! $self->register_configuration_item_( 'configuration',
! 'nntp_port',
! $self );
! $self->register_configuration_item_( 'configuration',
! 'nntp_separator',
! $self );
! $self->register_configuration_item_( 'security',
! 'nntp_local',
! $self );
return 1;
Index: POP3.pm
===================================================================
RCS file: /cvsroot/popfile/engine/Proxy/POP3.pm,v
retrieving revision 1.55
retrieving revision 1.56
diff -C2 -d -r1.55 -r1.56
*** POP3.pm 14 May 2003 09:12:12 -0000 1.55
--- POP3.pm 14 Jun 2003 21:10:12 -0000 1.56
***************
*** 77,99 ****
# item that needs a UI component
! $self->{ui__}->register_configuration_item( 'configuration',
! 'pop3_port',
! $self );
! $self->{ui__}->register_configuration_item( 'configuration',
! 'pop3_separator',
! $self );
! $self->{ui__}->register_configuration_item( 'security',
! 'pop3_local',
! $self );
! $self->{ui__}->register_configuration_item( 'chain',
! 'pop3_secure_server',
! $self );
! $self->{ui__}->register_configuration_item( 'chain',
! 'pop3_secure_server_port',
! $self );
return 1;
--- 77,99 ----
# item that needs a UI component
! $self->register_configuration_item_( 'configuration',
! 'pop3_port',
! $self );
! $self->register_configuration_item_( 'configuration',
! 'pop3_separator',
! $self );
! $self->register_configuration_item_( 'security',
! 'pop3_local',
! $self );
! $self->register_configuration_item_( 'chain',
! 'pop3_secure_server',
! $self );
! $self->register_configuration_item_( 'chain',
! 'pop3_secure_server_port',
! $self );
return 1;
***************
*** 142,147 ****
# and mail accounts
my $user_command = 'USER (.+)(:(\d+))?' . $self->config_( 'separator' ) . '(.+)';
! if ( $command =~ /$user_command/i ) {
if ( $1 ne '' ) {
if ( $mail = $self->verify_connected_( $mail, $client, $1, $3 || 110 ) ) {
# Pass through the USER command with the actual user name for this server,
--- 142,148 ----
# and mail accounts
my $user_command = 'USER (.+)(:(\d+))?' . $self->config_( 'separator' ) . '(.+)';
! if ( $command =~ /$user_command/i ) {
if ( $1 ne '' ) {
+ print $pipe "LOGIN:$4$eol";
if ( $mail = $self->verify_connected_( $mail, $client, $1, $3 || 110 ) ) {
# Pass through the USER command with the actual user name for this server,
***************
*** 282,286 ****
# Tell the parent that we just handled a mail
! print $pipe "$class$eol";
}
}
--- 283,287 ----
# Tell the parent that we just handled a mail
! print $pipe "CLASS:$class$eol";
}
}
***************
*** 343,347 ****
# Tell the parent that we just handled a mail
! print $pipe "$class$eol";
$self->flush_extra_( $mail, $client, 0 );
--- 344,348 ----
# Tell the parent that we just handled a mail
! print $pipe "CLASS:$class$eol";
$self->flush_extra_( $mail, $client, 0 );
Index: Proxy.pm
===================================================================
RCS file: /cvsroot/popfile/engine/Proxy/Proxy.pm,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** Proxy.pm 22 May 2003 23:33:55 -0000 1.16
--- Proxy.pm 14 Jun 2003 21:10:12 -0000 1.17
***************
*** 190,204 ****
while ( &{$self->{pipeready_}}($handle) )
{
! my $class = <$handle>;
! if ( defined( $class ) ) {
! $class =~ s/[\r\n]//g;
! $self->{classifier__}->set_bucket_parameter( $class, 'count',
! $self->{classifier__}->get_bucket_parameter( $class, 'count' ) + 1 );
! $self->global_config_( 'mcount', $self->global_config_( 'mcount' ) + 1 );
! $stats_changed = 1;
! $self->log_( "Incrementing $class" );
} else {
# This is here so that we get in errorneous position where the pipeready
--- 190,210 ----
while ( &{$self->{pipeready_}}($handle) )
{
! my $message = <$handle>;
! if ( defined( $message ) ) {
! $message =~ s/[\r\n]//g;
! if ( $message =~ /CLASS:(.*)/ ) {
! # Post a message to the MQ indicating that we just handled
! # a message with a specific classification
!
! $self->mq_post_( 'CLASS', $1, '' );
! $self->log_( "Incrementing $1" );
! }
!
! if ( $message =~ /LOGIN:(.*)/ ) {
! $self->mq_post_( 'LOGIN', $1, '' );
! }
} else {
# This is here so that we get in errorneous position where the pipeready
***************
*** 210,219 ****
}
}
-
- if ( $stats_changed ) {
- $self->{ui__}->invalidate_history_cache();
- $self->{configuration__}->save_configuration();
- $self->{classifier__}->write_parameters();
- }
}
--- 216,219 ----
***************
*** 584,609 ****
}
! # GETTERS/SETTERS
sub classifier
{
! my ( $self, $value ) = @_;
!
! if ( defined( $value ) ) {
! $self->{classifier__} = $value;
! }
!
! return $self->{classifier__};
! }
!
! sub ui
! {
! my ( $self, $value ) = @_;
!
! if ( defined( $value ) ) {
! $self->{ui__} = $value;
! }
! return $self->{ui__};
}
--- 584,594 ----
}
! # SETTER
sub classifier
{
! my ( $self, $classifier ) = @_;
! $self->{classifier__} = $classifier;
}
Index: SMTP.pm
===================================================================
RCS file: /cvsroot/popfile/engine/Proxy/SMTP.pm,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** SMTP.pm 22 May 2003 23:33:55 -0000 1.12
--- SMTP.pm 14 Jun 2003 21:10:12 -0000 1.13
***************
*** 74,92 ****
# item that needs a UI component
! $self->{ui__}->register_configuration_item( 'configuration',
! 'smtp_port',
! $self );
! $self->{ui__}->register_configuration_item( 'security',
! 'smtp_local',
! $self );
! $self->{ui__}->register_configuration_item( 'chain',
! 'smtp_server',
! $self );
! $self->{ui__}->register_configuration_item( 'chain',
! 'smtp_server_port',
! $self );
return 1;
--- 74,92 ----
# item that needs a UI component
! $self->register_configuration_item_( 'configuration',
! 'smtp_port',
! $self );
! $self->register_configuration_item_( 'security',
! 'smtp_local',
! $self );
! $self->register_configuration_item_( 'chain',
! 'smtp_server',
! $self );
! $self->register_configuration_item_( 'chain',
! 'smtp_server_port',
! $self );
return 1;
***************
*** 218,222 ****
}
}
!
# The mail client wants to stop using the server, so send that message through to the
# real mail server, echo the response back up to the client and exit the while. We will
--- 218,222 ----
}
}
!
# The mail client wants to stop using the server, so send that message through to the
# real mail server, echo the response back up to the client and exit the while. We will
|