From: naoki i. <am...@us...> - 2008-04-06 08:27:05
|
Update of /cvsroot/popfile/engine/Proxy In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14448/Proxy Modified Files: POP3.pm Log Message: Change Log 1. There's no need to create account if pop3 transparent proxy server is used 2. Add a new option to use SSL when using pop3 transparent proxy 3. Add a new test for get_session_key_from_token with pop3 transparent proxy Proxy/POP3.pm Classifier/Bayes.pm skins/default/pop3-chain-panel.thtml languages/English.msg tests/TestBayes.tst Memo: If the pop3 transparent proxy server is defined (e.g. mail.example.com), POPFile will accept 'USER username' command and act as if the user 'username' has an account 'use...@ma...'. 4. insert.pl now supports multiuser mode insert.pl Classifier/Bayes.pm New command line options: insert.pl - insert mail messages into a specific bucket of the specific user Usage: insert.pl [<user>] <bucket> <messages> <user> The name of the user (multiuser mode only) <bucket> The name of the bucket <messages> Filename of message(s) to insert 5. A new session key is generated in the single user mode to avoid releasing administrator's session key Proxy/POP3.pm Classifier/Bayes.pm tests/TestBayes.tst 6. Merged a patch to solve the sqlite3 (DBD::SQLite 1.x) issues POPFile/History.pm 7. Fixed a bug that POP3.pm had not passed get_slot_fields no session keys Proxy/POP3.pm 8. New tips for deleting accounts from user skins/users-page.thtml languages/English.msg 9. New XMLRPC APIs (Ticket #39) POPFile/API.pm New APIs get_user_name_from_session initialize_users_password (ADMIN ONLY) change_users_password (ADMIN ONLY) set_password_for_user get_user_name_from_id 10. Update language file languages/Nihongo.msg Current state of the test suite: TestBayesScript PASS TestBayes PASS TestConfiguration PASS * TestHistory PASS * TestHTML PASS * TestHTTP PASS TestIMAP not tested yet TestInsertScript PASS * TestLogger PASS TestMailParse PASS TestModule PASS TestMQ PASS TestMutex PASS TestPipeScript PASS TestPOP3 fail (horribly) TestProxy PASS TestWordMangle PASS TestXMLRPC PASS (but child process does not terminate) * : needs to add tests for multi user support TODO 1. multi user mode tests are needed tests/TestConfiguration.tst tests/TestHistory.tst tests/TestHTML.tst tests/TestInsertScript.tst Index: POP3.pm =================================================================== RCS file: /cvsroot/popfile/engine/Proxy/POP3.pm,v retrieving revision 1.118 retrieving revision 1.119 diff -C2 -d -r1.118 -r1.119 *** POP3.pm 5 Apr 2008 16:50:45 -0000 1.118 --- POP3.pm 6 Apr 2008 08:27:07 -0000 1.119 *************** *** 94,97 **** --- 94,98 ---- $self->config_( 'secure_server', '' ); $self->config_( 'secure_port', 110 ); + $self->config_( 'secure_ssl', 0 ); # Only accept connections from the local machine for POP3 *************** *** 196,200 **** $s =~ s/(\$|\@|\[|\]|\(|\)|\||\?|\*|\.|\^|\+)/\\$1/; ! my $transparent = "^USER ([^$s])+\$"; my $user_command = "USER ([^$s]+)($s(\\d+))?$s([^$s]+)($s([^$s]+))?"; my $apop_command = "APOP ([^$s]+)($s(\\d+))?$s([^$s]+) (.*?)"; --- 197,201 ---- $s =~ s/(\$|\@|\[|\]|\(|\)|\||\?|\*|\.|\^|\+)/\\$1/; ! my $transparent = "^USER ([^$s]+)\$"; my $user_command = "USER ([^$s]+)($s(\\d+))?$s([^$s]+)($s([^$s]+))?"; my $apop_command = "APOP ([^$s]+)($s(\\d+))?$s([^$s]+) (.*?)"; *************** *** 239,243 **** if ( $self->config_( 'secure_server' ) ne '' ) { $token = $self->config_( 'secure_server' ). ":$1"; ! if ( $mail = $self->verify_connected_( $mail, $client, $self->config_( 'secure_server' ), $self->config_( 'secure_port' ) ) ) { last if ($self->echo_response_($mail, $client, $command) == 2 ); } else { --- 240,249 ---- if ( $self->config_( 'secure_server' ) ne '' ) { $token = $self->config_( 'secure_server' ). ":$1"; ! $self->log_( 2, "Set transparent proxy token : '$token'" ); ! ! if ( $mail = $self->verify_connected_( $mail, $client, ! $self->config_( 'secure_server' ), ! $self->config_( 'secure_port' ), ! $self->config_( 'secure_ssl' ) ) ) { last if ($self->echo_response_($mail, $client, $command) == 2 ); } else { *************** *** 347,350 **** --- 353,357 ---- $session = $self->get_session_key_( $token ); if ( !defined( $session ) ) { + $self->tee_( $client, "-ERR Unknown account $token$eol" ); last; } *************** *** 352,364 **** $self->tee_( $client, $response ); } ! } else { ! last if ($self->echo_response_($mail, $client, ! $command) == 2 ); ! $session = $self->get_session_key_( $token ); ! if ( !defined( $session ) ) { ! last; ! } ! } ! next; } --- 359,372 ---- $self->tee_( $client, $response ); } ! } else { ! last if ($self->echo_response_($mail, $client, ! $command) == 2 ); ! $session = $self->get_session_key_( $token ); ! if ( !defined( $session ) ) { ! $self->tee_( $client, "-ERR Unknown account $token$eol" ); ! last; ! } ! } ! next; } *************** *** 381,385 **** if ( $command =~ /AUTH ([^ ]+)/ ) { if ( $self->config_( 'secure_server' ) ne '' ) { ! if ( $mail = $self->verify_connected_( $mail, $client, $self->config_( 'secure_server' ), $self->config_( 'secure_port' ) ) ) { # Loop until we get -ERR or +OK --- 389,396 ---- if ( $command =~ /AUTH ([^ ]+)/ ) { if ( $self->config_( 'secure_server' ) ne '' ) { ! if ( $mail = $self->verify_connected_( $mail, $client, ! $self->config_( 'secure_server' ), ! $self->config_( 'secure_port' ), ! $self->config_( 'secure_ssl' ) ) ) { # Loop until we get -ERR or +OK *************** *** 405,409 **** if ( $command =~ /AUTH/ ) { if ( $self->config_( 'secure_server' ) ne '' ) { ! if ( $mail = $self->verify_connected_( $mail, $client, $self->config_( 'secure_server' ), $self->config_( 'secure_port' ) ) ) { my $response = $self->echo_response_($mail, $client, "AUTH" ); last if ( $response == 2 ); --- 416,423 ---- if ( $command =~ /AUTH/ ) { if ( $self->config_( 'secure_server' ) ne '' ) { ! if ( $mail = $self->verify_connected_( $mail, $client, ! $self->config_( 'secure_server' ), ! $self->config_( 'secure_port' ), ! $self->config_( 'secure_ssl' ) ) ) { my $response = $self->echo_response_($mail, $client, "AUTH" ); last if ( $response == 2 ); *************** *** 537,541 **** if ( $command =~ /CAPA/i ) { if ( $mail || $self->config_( 'secure_server' ) ne '' ) { ! if ( $mail || ( $mail = $self->verify_connected_( $mail, $client, $self->config_( 'secure_server' ), $self->config_( 'secure_port' ) ) ) ) { my $response = $self->echo_response_($mail, $client, "CAPA" ); last if ( $response == 2 ); --- 551,558 ---- if ( $command =~ /CAPA/i ) { if ( $mail || $self->config_( 'secure_server' ) ne '' ) { ! if ( $mail || ( $mail = $self->verify_connected_( $mail, $client, ! $self->config_( 'secure_server' ), ! $self->config_( 'secure_port' ), ! $self->config_( 'secure_ssl' ) ) ) ) { my $response = $self->echo_response_($mail, $client, "CAPA" ); last if ( $response == 2 ); *************** *** 604,608 **** my ( $id, $from, $to, $cc, $subject, $date, $hash, $inserted, $bucket, $reclassified ) = ! $self->history_()->get_slot_fields( $downloaded{$count} ); if ( $bucket ne 'unknown class' ) { --- 621,625 ---- my ( $id, $from, $to, $cc, $subject, $date, $hash, $inserted, $bucket, $reclassified ) = ! $self->history_()->get_slot_fields( $downloaded{$count}, $session ); if ( $bucket ne 'unknown class' ) { *************** *** 721,724 **** --- 738,742 ---- $templ->param( 'POP3_Chain_Secure_Server' => $self->config_( 'secure_server' ) ); $templ->param( 'POP3_Chain_Secure_Port' => $self->config_( 'secure_port' ) ); + $templ->param( 'POP3_Chain_Secure_SSL' => ( $self->config_( 'secure_ssl' ) == 1 ) ); } else { $self->SUPER::configure_item( $name, $templ, $language ); *************** *** 788,791 **** --- 806,810 ---- if ( defined( $$form{server} ) ) { $self->config_( 'secure_server', $$form{server} ); + $status_message .= "\n" if ( defined( $status_message ) ); $status_message .= sprintf( $$language{Security_SecureServerUpdate}, $self->config_( 'secure_server' ) ); } *************** *** 794,797 **** --- 813,817 ---- if ( ( $$form{sport} =~ /^\d+$/ ) && ( $$form{sport} >= 1 ) && ( $$form{sport} < 65536 ) ) { $self->config_( 'secure_port', $$form{sport} ); + $status_message .= "\n" if ( defined( $status_message ) ); $status_message .= sprintf( $$language{Security_SecurePortUpdate}, $self->config_( 'secure_port' ) ); } else { *************** *** 800,803 **** --- 820,835 ---- } + if ( defined($$form{sssl}) ) { + if ( $$form{sssl} eq 'UseSSL' ) { + $self->config_( 'secure_ssl', 1 ); + $status_message .= "\n" if ( defined( $status_message ) ); + $status_message .= $$language{Security_SecureServerUseSSLOn}; + } else { + $self->config_( 'secure_ssl', 0 ); + $status_message .= "\n" if ( defined( $status_message ) ); + $status_message .= $$language{Security_SecureServerUseSSLOff}; + } + } + return( $status_message, $error_message ); } |