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: Joseph C. <tex...@us...> - 2007-12-02 08:48:57
|
Update of /cvsroot/popfile/engine/skins/blue In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5824/blue Modified Files: Tag: b0_22_2 style.css Log Message: Port some skin changes from HEAD. Add Javascript Check All box for message history. Add text that magnet matches (any opinions on that?). Still need to update the rest of the skins (this causes minor issues with them). Index: style.css =================================================================== RCS file: /cvsroot/popfile/engine/skins/blue/style.css,v retrieving revision 1.3.6.1 retrieving revision 1.3.6.2 diff -C2 -d -r1.3.6.1 -r1.3.6.2 *** style.css 14 Sep 2005 19:24:29 -0000 1.3.6.1 --- style.css 2 Dec 2007 08:48:59 -0000 1.3.6.2 *************** *** 17,20 **** --- 17,25 ---- font-weight: bold; font-family: verdana, sans-serif; + font-size: 0.9em; + } + + input.submit:hover { + background-color: #363E75; } *************** *** 33,49 **** td.head { font-weight: normal; ! font-size: 22pt; background-color : #4C558E; color: white; } ! a.shutdownLink { background-color : #4C558E; color: white; ! font-size: 12pt; } .menu { ! font-size: 14pt; font-weight: bold; width: 100%; --- 38,54 ---- td.head { font-weight: normal; ! font-size: 1.3em; background-color : #4C558E; color: white; } ! a.shutdownLink, a.logoutLink { background-color : #4C558E; color: white; ! font-size: 1em; } .menu { ! font-size: 1.1em; font-weight: bold; width: 100%; *************** *** 102,109 **** .menuIndent { ! width: 8%; } ! table.historyWidgetsTop { width: 100%; margin-left: 1.5em; --- 107,114 ---- .menuIndent { ! width: 7%; } ! td.historyWidgetsTop { width: 100%; margin-left: 1.5em; *************** *** 115,118 **** --- 120,124 ---- text-align: right; padding-right: 0.5em; + vertical-align: top; } *************** *** 140,144 **** a.changeSettingLink { background-color: transparent ; ! color: #ddeeff ; } --- 146,150 ---- a.changeSettingLink { background-color: transparent ; ! color: #DDEEFF; } *************** *** 173,177 **** tr.rowHighlighted { background-color: #000030; ! color: #eeeeee; } --- 179,183 ---- tr.rowHighlighted { background-color: #000030; ! color: #EEEEEE; } *************** *** 256,260 **** tr.rowBoundary { ! background-color: white; } --- 262,266 ---- tr.rowBoundary { ! background-color: #FFFFFF; } *************** *** 262,266 **** border: 2px solid #363E68; padding: 0.4em; ! padding-bottom: 0; } --- 268,275 ---- border: 2px solid #363E68; padding: 0.4em; ! } ! ! div.helpMessage form { ! margin: 0; } *************** *** 268,270 **** --- 277,294 ---- display: block; width: 100%; + } + + .historyMagnetUsed { + overflow: hidden; + white-space: nowrap; + vertical-align: middle; + } + + .historyMagnetUsed img { + vertical-align: bottom; + } + + .historyMagnetUsed span { + font-size:80%; + vertical-align: middle; } \ No newline at end of file |
From: Manni H. <man...@us...> - 2007-12-02 08:20:24
|
Update of /cvsroot/popfile/engine/Classifier In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27645/Classifier Modified Files: popfile.sql Log Message: Forgot to update the schema version number. Maybe we should automate this by using a CVS revision tag? Index: popfile.sql =================================================================== RCS file: /cvsroot/popfile/engine/Classifier/popfile.sql,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** popfile.sql 1 Dec 2007 22:36:31 -0000 1.29 --- popfile.sql 2 Dec 2007 08:20:23 -0000 1.30 *************** *** 1,3 **** ! -- POPFILE SCHEMA 8 -- --------------------------------------------------------------------------- -- --- 1,3 ---- ! -- POPFILE SCHEMA 9 -- --------------------------------------------------------------------------- -- |
From: Manni H. <man...@us...> - 2007-12-01 23:49:54
|
Update of /cvsroot/popfile/engine/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7534/tests Modified Files: TestIMAP.tst Log Message: First big step toward v2.0 for the IMAP module. The test suite is working, the module is looking good, we just have to adapt the UI tests to the v2.0 templates. Index: TestIMAP.tst =================================================================== RCS file: /cvsroot/popfile/engine/tests/TestIMAP.tst,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** TestIMAP.tst 20 Feb 2006 02:20:57 -0000 1.5 --- TestIMAP.tst 1 Dec 2007 23:49:57 -0000 1.6 *************** *** 23,39 **** # # --------------------------------------------------------------------------------------------- ! $SIG{CHLD} = 'IGNORE'; ! ! rmtree( 'messages' ); ! rmtree( 'corpus' ); ! test_assert( rec_cp( 'corpus.base', 'corpus' ) ); ! rmtree( 'corpus/CVS' ); ! ! unlink 'popfile.db'; ! unlink 'stopwords'; ! test_assert( copy ( 'stopwords.base', 'stopwords' ) ); ! mkdir 'messages'; # This test will fork itself. The child will run --- 23,43 ---- # # --------------------------------------------------------------------------------------------- + # TODO: + # IMAP.pm: + # * fail while statusing + # * duplicate hash value => duplicate message in inbox + # * fail while fetching a part + # * fail while fetching_header_fields + # + # Client.pm + # * ssl connection (difficult) + # * fail while saying something + # * say no to copy msg ! use strict; ! use POPFile::Loader; ! use HTML::Template; ! $SIG{CHLD} = 'IGNORE'; # This test will fork itself. The child will run *************** *** 45,50 **** # child: runs the server if ( $pid == 0 ) { ! my $debug_server = ''; #'debug'; ! system "perl IMAP_test_server.pl $debug_server"; exit 0; } --- 49,53 ---- # child: runs the server if ( $pid == 0 ) { ! system 'perl IMAP_test_server.pl'; exit 0; } *************** *** 52,133 **** else { # First, start POPFile. ! use POPFile::Loader; ! my $POPFile = POPFile::Loader->new(); ! $POPFile->CORE_loader_init(); ! $POPFile->CORE_signals(); ! ! my %valid = ( 'POPFile/Database' => 1, ! 'POPFile/Logger' => 1, ! 'POPFile/MQ' => 1, ! 'POPFile/History' => 1, ! 'Classifier/Bayes' => 1, ! 'Classifier/WordMangle' => 1, ! 'POPFile/Configuration' => 1, ! 'Services/IMAP' => 1 ); ! ! $POPFile->CORE_load( 0, \%valid ); ! $POPFile->CORE_initialize(); ! $POPFile->CORE_config( 1 ); ! my $im = $POPFile->get_module( 'Services/IMAP' ); ! $im->module_config_( 'enabled', 1 ); ! $POPFile->CORE_start(); ! my $b = $POPFile->get_module( 'Classifier/Bayes' ); ! my $h = $POPFile->get_module( 'POPFile/History' ); ! my $l = $POPFile->get_module( 'POPFile/Logger' ); ! my $mq = $POPFile->get_module( 'POPFile/MQ' ); ! $im->user_module_config_( 1, 'html', 'language', 'English' ); ! $im->module_config_( 'html', 'port', '8080' ); my $session = $b->get_session_key( 'admin', '' ); ! $l->module_config_( 'level', 2 ); ! $l->service(); ! # Configure the IMAP module so it will ! # talk to the server. ! $im->user_config_( 1, 'expunge', 1 ); ! $im->user_config_( 1, 'hostname', '127.0.0.1' ); ! $im->user_config_( 1, 'password', 'password' ); ! $im->user_config_( 1, 'port', '1143' ); ! $im->user_config_( 1, 'update_interval', 10 ); ! $im->user_config_( 1, 'watched_folders', '' ); ! $im->{last_update__} = 0; ! $im->watched_folders__( 'INBOX' ); ! $im->folder_for_bucket__( 'spam', 'spam' ); ! $im->folder_for_bucket__( 'personal', 'personal' ); ! $im->folder_for_bucket__( 'other', 'other' ); ! $im->folder_for_bucket__( 'unclassified', 'unclassified' ); ! test_assert( $im->start() ); ! $im->user_config_( 1, 'login', 'someone' ); $im->service(); ! ! # Did we get the UIDVALIDITY values correctly? ! test_assert_equal( $im->uid_validity__( 'INBOX' ), 1 ); ! test_assert_equal( $im->uid_validity__( 'personal' ), 1 ); ! test_assert_equal( $im->uid_validity__( 'spam' ), 1 ); ! test_assert_equal( $im->uid_validity__( 'other' ), 1 ); ! ! # Did we note the correct UIDNEXT values? ! test_assert_equal( $im->uid_next__( 'INBOX' ), 1 ); ! test_assert_equal( $im->uid_next__( 'personal' ), 1 ); ! test_assert_equal( $im->uid_next__( 'spam' ), 1 ); ! test_assert_equal( $im->uid_next__( 'other' ), 1 ); $im->disconnect_folders__(); ! # Let the INBOX have one new message, make sure it is classified correctly ! # and moved to the according folder. ! ! $im->user_config_( 1, 'login', 'new_INBOX_003' ); $im->{last_update__} = 0; $im->service(); --- 55,130 ---- else { # First, start POPFile. + my ( $c, $mq, $l, $b, $h, $im ) = start_popfile(); + my $session = $b->get_session_key( 'admin', '' ); ! # Configure the IMAP module so it will ! # talk to the server. ! configure_imap_module( $im, $c, $mq, $l, $b, $h ); ! test_imap_ui( $im ); ! onfigure_imap_module( $im, $c, $mq, $l, $b, $h ); ! test_imap_module( $im, $c, $mq, $l, $b, $h ); ! test_imap_client( $im ); ! $mq->stop(); ! $h->stop(); ! $im->stop(); ! $b->stop(); ! rmtree( 'imap.spool' ); ! } ! ################################################################################# ! # Tests for Services::IMAP ! # Test classification, reclassification, UI stuff and error handling ! ## ! sub test_imap_module { ! my ( $im, $c, $mq, $l, $b, $h ) = @_; my $session = $b->get_session_key( 'admin', '' ); + test_assert( $im->start() ); ! # The module is not supposed to do anything when the update ! # interval hasn't elapsed yet: ! my $last_update = time - 2; ! $im->{last_update__} = $last_update; ! $im->service(); ! test_assert_equal( $im->{last_update__}, $last_update ); ! $im->{last_update__} = 0; ! # Login. The server doesn't have any messages for us yet ! $im->log_( 0, "---- testing login to empty server (uidnext and uidvalidity)" ); ! $im->user_config_( 1, 'login', 'someone' ); ! $im->service(); ! test_assert_equal( $im->{last_update__}, time ); ! foreach my $folder (qw/ INBOX personal spam other / ) { ! my $client = $im->{folders__}{$folder}{imap}; ! test_assert( $client ); ! # Did we get the UIDVALIDITY values correctly? ! test_assert_equal( $client->uid_validity( $folder ), 1 ); ! # Did we note the correct UIDNEXT values? ! test_assert_equal( $client->uid_next( $folder ), 1 ); ! } ! # We change the uidvalidity and see whether the module detects ! # the difference between the (manipulated) stored value and ! # the value from the server. ! my $client = $im->{folders__}{spam}{imap}; ! $client->uid_validity( 'spam', 50 ); ! $im->{last_update__} = 0; $im->service(); ! test_assert_equal( $client->uid_validity( 'spam' ), 1 ); $im->disconnect_folders__(); ! # Let the INBOX have four new messages, make sure they are ! # classified correctly and moved to the according folders. ! $im->log_( 0, "---- testing classify with 6 new messages" ); ! $im->user_config_( 1, 'login', 'new_INBOX_007_003_004_005_013_021' ); ! $b->create_magnet( $session, 'other', 'from', 'cxc...@ya...' ); $im->{last_update__} = 0; $im->service(); *************** *** 136,155 **** # The message must have ended up as spam and must have been ! # moved to the spam folder test_assert( -e 'imap.spool/spam/1' ); ! # This is a good opportunity to test reclassify-on-move: ! # we move the message from the spam folder to the ! # personal folder. The IMAP module should see this and ! # reclassify the message to that bucket. We test whether ! # history returns the changed classification and if ! # bayes comes up with the same classification ! # move to folder presonal ! copy 'imap.spool/spam/1', 'imap.spool/personal/1'; ! unlink 'imap.spool/spam/1'; # let the IMAP module have a look $im->{last_update__} = 0; $im->service(); --- 133,168 ---- # The message must have ended up as spam and must have been ! # moved to the spam folder, except for the magneted msg. test_assert( -e 'imap.spool/spam/1' ); + test_assert( -e 'imap.spool/spam/2' ); + test_assert( -e 'imap.spool/spam/3' ); + test_assert( -e 'imap.spool/spam/4' ); + test_assert( -e 'imap.spool/spam/5' ); + test_assert( -e 'imap.spool/other/1' ); ! # The module should not allow reclassification to the same ! # bucket. ! my $hash = ( $h->get_slot_fields( 1 ) )[6]; ! test_assert( ! $im->can_reclassify__( $hash, 'spam' ) ); ! # If the hash is unknown, it should reclassify either ! test_assert( ! $im->can_reclassify__( 'hash', 'other' ) ); ! # But with a good hash and a valid bucket: ! test_assert( $im->can_reclassify__( $hash, 'other' ) ); ! # move msgs 1, 2, and 3 to folder personal ! $client = $im->{folders__}{'spam'}{imap}; ! test_assert( $client ); ! test_assert_equal( $client->select( 'spam' ), 1 ); ! test_assert_equal( $client->move_message( 1, 'personal' ), 1 ); ! test_assert_equal( $client->move_message( 2, 'personal' ), 1 ); ! test_assert_equal( $client->move_message( 3, 'personal' ), 1 ); ! ! # move msgs 4 and 5 to folder other ! test_assert_equal( $client->move_message( 4, 'other' ), 1 ); ! test_assert_equal( $client->move_message( 5, 'other' ), 1 ); # let the IMAP module have a look + $im->log_( 0, "---- Testing reclassification" ); $im->{last_update__} = 0; $im->service(); *************** *** 159,191 **** # check classification stored in history test_assert_equal( ($h->get_slot_fields( 1 ))[8], 'personal' ); # check that a fresh classification confirms the reclassification ! test_assert_equal( $b->classify( $session, 'TestMailParse003.msg' ), 'personal' ); $im->disconnect_folders__(); ! # test magnet match # Make the server drop the connection and make sure we don't crash ! $im->user_config_( 1, 'login', 'dropConnection3' ); $im->service(); ! # close the server process by logging in as user "shutdown" ! $im->user_config_( 1, 'login', 'shutdown' ); $im->{last_update__} = 0; $im->service(); - foreach ( $b->get_buckets( $session ) ) { print "$_\n"; } ! $mq->stop(); ! $h->stop(); ! $im->stop(); ! $b->stop(); ! rmtree( 'imap.spool' ); } ! 1; --- 172,848 ---- # check classification stored in history test_assert_equal( ($h->get_slot_fields( 1 ))[8], 'personal' ); + test_assert_equal( ($h->get_slot_fields( 2 ))[8], 'personal' ); + test_assert_equal( ($h->get_slot_fields( 3 ))[8], 'personal' ); + test_assert_equal( ($h->get_slot_fields( 4 ))[8], 'other' ); + test_assert_equal( ($h->get_slot_fields( 5 ))[8], 'other' ); + + # check that history knows that the msgs were reclassfified + test_assert_equal( ($h->get_slot_fields( 1 ))[9], 4 ); + test_assert_equal( ($h->get_slot_fields( 2 ))[9], 4 ); + test_assert_equal( ($h->get_slot_fields( 3 ))[9], 4 ); + test_assert_equal( ($h->get_slot_fields( 4 ))[9], 4 ); + test_assert_equal( ($h->get_slot_fields( 5 ))[9], 4 ); + + # history should also know about the used manget + test_assert_equal( ($h->get_slot_fields( 6 ))[11], 'cxc...@ya...' ); + + # get the msgs hashes and ask the imap module whether those messages + # can be reclassified. It should say 'no!' + foreach ( 1 .. 5 ) { + $hash = ($h->get_slot_fields( $_ ))[6]; + test_assert_equal( $im->can_reclassify__( $hash, 'spam' ), undef ); + test_assert( ! $im->can_classify__( $hash ) ); + } # check that a fresh classification confirms the reclassification ! test_assert_equal( $b->classify( $session, 'TestMailParse007.msg' ), 'personal' ); ! ! # Now let's see whether the words in one of the reclassified messages ! # actually ended up in the corpus ! ! my %words; ! ! open WORDS, "<TestMailParse013.wrd"; ! while ( <WORDS> ) { ! if ( /(.+) (\d+)/ ) { ! $words{$1} = $2; ! } ! } ! close WORDS; ! ! foreach my $word (keys %words) { ! test_assert( $b->get_count_for_word( $session, 'other', $word ) > 0, "other: $word $words{$word}" ); ! } $im->disconnect_folders__(); ! # Change the UIDVALIDITY values and then log in again ! $im->log_( 0, '---- changing uidvalies' ); ! $im->user_config_( 1, 'login', 'someone'); ! my $uidvalis = $im->user_config_( 1, 'uidvalidities'); ! my $newvalis = $uidvalis; ! $newvalis =~ s/-->(\d+)-->/'-->' . ( $1 +2 ) . '-->'/ge; ! $im->user_config_( 1, 'uidvalidities', $newvalis ); ! $im->{last_update__} = 0; ! $im->service(); ! $im->disconnect_folders__(); ! test_assert_equal( $im->user_config_( 1, 'uidvalidities' ), $uidvalis ); ! $im->user_config_( 1, 'uidvalidities', $uidvalis ); + # The module is supposed to retrieve the list of mailboxes if it + # hasn't got any yet. + $im->log_( 0, '---- using invalid uidvalidities' ); + $im->{mailboxes__} = []; + $im->{last_update__} = 0; + $im->service(); + test_assert_equal( scalar @{$im->{mailboxes__}}, 5 ); + $im->disconnect_folders__(); + + # Give an invalid configuration string for uidnexts and uidvalidities + # and see whether we react in a graceful manner + $newvalis = $uidvalis; + $newvalis =~ s/-->(\d+)-->/-->-->/; + $im->user_config_( 1, 'uidvalidities', $newvalis ); + $im->{last_update__} = 0; + $im->service(); + test_assert_equal( $im->user_config_( 1, 'uidvalidities'), $uidvalis ); + + # Check what happens when we time out + $im->log_( 0, "---- Testing time-out behaviour for the module." ); + $im->user_config_( 1, 'login', 'timeOut1' ); + $im->{last_update__} = 0; + $im->service(); + $im->disconnect_folders__(); # Make the server drop the connection and make sure we don't crash + $im->log_( 0, "---- Testing dropped-connection behaviour for the module." ); + $im->user_config_( 1, 'login', 'dropConnection3' ); + $im->{last_update__} = 0; + $im->service(); ! $im->log_( 0, "---- Testing train_on_archive." ); ! $im->user_config_( 1, login => 'new_INBOX_007_003_004_005_013_021' ); ! $im->{last_update__} = 0; ! $client = $im->new_imap_client(); ! $client->select( 'INBOX' ); ! $client->move_message( 7, 'personal' ); ! $client->move_message( 8, 'other' ); ! $client->move_message( 9, 'spam' ); ! $client->move_message( 10, 'personal' ); ! $client->move_message( 11, 'other' ); ! $client->move_message( 12, 'spam' ); ! ! $im->user_config_( 1, 'training_mode', 1 ); ! $im->user_config_( 1, login => 'someone' ); $im->service(); + test_assert_equal( $im->user_config_( 1, 'training_mode' ), 0 ); ! # Test the multiple-connection approach ! $im->log_( 0, "---- Testing multiple connections" ); ! $im->user_config_( 1, use_multiple_connections => 1 ); ! $im->user_config_( 1, login => 'someone' ); $im->{last_update__} = 0; $im->service(); + $im->user_config_( 1, use_multiple_connections => 0 ); + # TODO: login and place some msgs in the INBOX. + # check classifications. + } ! ################################################################################# ! # Tests for Services::IMAP::Client ! # Test the code that actually talks to the IMAP ! # server ! ## ! sub test_imap_client { ! my $im = shift; ! ! $im->log_( 0, "---- Testing various client methods" ); ! $im->user_config_( 1, 'login', 'someone' ); ! my $client = $im->new_imap_client(); ! ! test_assert( $client, "Have we got a valid imap client?" ); ! test_assert( $client->connected() ); ! my @mailboxes = $client->get_mailbox_list(); ! test_assert_equal( scalar @mailboxes, 5 ); ! ! test_assert_equal( 1, $client->noop() ); ! my $info = $client->status( 'INBOX' ); ! test_assert_equal( $info->{UIDNEXT}, 13 ); ! test_assert_equal( $info->{UIDVALIDITY}, 1 ); ! test_assert_equal( $client->select( 'INBOX' ), 1 ); ! ! test_assert_equal( $client->uid_next( 'INBOX' ), 7 ); ! test_assert_equal( $client->uid_validity( 'INBOX' ), 1 ); ! ! $client->uid_next( 'INBOX', 100 ); ! test_assert_equal( $client->uid_next( 'INBOX' ), 100 ); ! ! $client->uid_validity( 'INBOX', 99 ); ! test_assert_equal( $client->uid_validity( 'INBOX' ), 99 ); ! ! $client->uid_validity( 'INBOX', 1 ); ! test_assert_equal( $client->uid_validity( 'INBOX' ), 1 ); ! ! test_assert_equal( 1, $client->expunge() ); ! ! $client->say( 'unknown command' ); ! test_assert_equal( $client->get_response(), -1 ); ! ! test_assert_equal( $client->select( 'personal' ), 1 ); ! $client->uid_next( 'personal', 0 ); ! my @msgs = $client->get_new_message_list(); ! test_assert_equal( scalar @msgs, 5 ); ! ! $client->move_message( 1, 'spam' ); ! $client->uid_next( 'spam', 0 ); ! $client->select( 'spam' ); ! @msgs = $client->get_new_message_list(); ! test_assert_equal( scalar @msgs, 3 ); ! ! test_assert( $client->logout()); ! ! $im->log_( 0, "---- testing client methods with 3 new messages." ); ! $im->user_config_( 1, 'login', 'new_INBOX_003_002_001' ); ! $client = $im->new_imap_client(); ! $client->uid_next( 'INBOX', 0 ); ! @msgs = $client->get_new_message_list_unselected( 'INBOX' ); ! test_assert_equal( scalar @msgs, 3 ); ! ! # Now get the messages and compare them to the originals ! foreach my $msg_number ( qw/ 003 002 001 / ) { ! my $uid = shift @msgs; ! my ( $ok, @msg_lines ) = $client->fetch_message_part( $uid, '' ); ! test_assert_equal( $ok, 1 ); ! my $filename = "TestMailParse$msg_number.msg"; ! if ( open my $ORG, '<', $filename ) { ! my @org_lines = (); ! while ( <$ORG> ) { ! push @org_lines, $_; ! } ! close $ORG; ! foreach my $org_line ( @org_lines ) { ! my $msg_line = shift @msg_lines; ! $org_line =~ s/[\r\n]//g; ! $msg_line =~ s/[\r\n]//g; ! test_assert_equal( $msg_line, $org_line ); ! } ! $uid++; ! } ! else { ! die "Could not open message $filename ($!)"; ! } ! } ! ! $im->log_( 0, "---- Testing failing login behaviour for client" ); ! $im->user_config_( 1, 'login', 'fail' ); ! $im->new_imap_client(); ! test_assert_equal( $im->{imap_error}, 'NO_LOGIN' ); ! ! $im->log_( 0, "---- testing time-out behaviour in client" ); ! $im->user_config_( 1, 'login', 'timeOut1' ); ! $client = $im->new_imap_client(); ! eval { ! $client->get_mailbox_list(); ! }; ! test_assert( $@ ); ! test_assert_regexp( $@, 'POPFILE-IMAP-EXCEPTION: ' ); ! # sleep 3; ! ! $im->log_( 0, "---- testing something with the client here." ); ! $im->user_config_( 1, 'login', 'new_INBOX_003_002_001' ); ! ! $im->log_( 0, "shutting down the test server by logging in as user 'shutdown'." ); ! # close the server process by logging in as user "shutdown" ! $im->user_config_( 1, 'login', 'shutdown' ); ! eval { ! $im->new_imap_client(); ! }; ! test_assert( $im->{imap_error} ); ! test_assert_equal( $im->{imap_error}, 'NO_LOGIN' ); } ! ################################################################################# ! # test_imap_ui ! # Test the UI widgets of the IMAP module. All we are going to have to do ! # here is test the two methods configure_item and validate_item ! ## ! ! sub test_imap_ui { ! my $im = shift; ! ! # We are going to set up a template object that we will pass into ! # configure_item and validate_item. ! # Later, we'll test whether the correct parameters are set to the ! # correct values. + # Here's a list of all the templates we have to test: + # imap-connection-details.thtml + # imap-watch-folders.thtml + # imap-watch-more-folders.thtml + # imap-bucket-folders.thtml + # imap-update-mailbox-list.thtml + # imap-options.thtml + + # We also need to provide those methods with a language hash: + my $language = load_language( 'English' ); + + # Start with the connection details + # imap-connection-details.thtml + + my $tmpl = HTML::Template->new( filename => '../skins/default/imap-connection-details.thtml' ); + + # Test the template itself. Does it contain all the variables that it must contain + test_assert_equal( $tmpl->query( name => 'IMAP_hostname'), 'VAR' ); + test_assert_equal( $tmpl->query( name => 'IMAP_port' ), 'VAR' ); + test_assert_equal( $tmpl->query( name => 'IMAP_password' ), 'VAR' ); + test_assert_equal( $tmpl->query( name => 'IMAP_login' ), 'VAR' ); + + # Now let the IMAP module populate the template + $im->user_config_( 1, hostname => 'some host' ); + $im->user_config_( 1, port => 1234 ); + $im->user_config_( 1, password => 'some password' ); + $im->user_config_( 1, login => 'some login' ); + + $im->configure_item( 'imap_0_connection_details', $tmpl, $language ); + + test_assert_equal( $tmpl->param( 'IMAP_hostname'), 'some host' ); + test_assert_equal( $tmpl->param( 'IMAP_port' ), 1234 ); + test_assert_equal( $tmpl->param( 'IMAP_password' ), 'some password' ); + test_assert_equal( $tmpl->param( 'IMAP_login' ), 'some login' ); + + + # imap-watch-folders.thtml + $tmpl = HTML::Template->new( filename => '../skins/default/imap-watch-folders.thtml' ); + + test_assert_equal( $tmpl->query( name => 'IMAP_if_mailboxes' ), 'VAR' ); + test_assert_equal( $tmpl->query( name => 'IMAP_loop_watched_folders' ), 'LOOP' ); + test_assert_equal( $tmpl->query( name => ['IMAP_loop_watched_folders', 'IMAP_loop_counter'] ), 'VAR' ); + test_assert_equal( $tmpl->query( name => ['IMAP_loop_watched_folders', 'IMAP_WatchedFolder_Msg' ] ), 'VAR' ); + test_assert_equal( $tmpl->query( name => ['IMAP_loop_watched_folders', 'IMAP_loop_mailboxes'] ), 'LOOP' ); + test_assert_equal( $tmpl->query( name => ['IMAP_loop_watched_folders', 'IMAP_loop_mailboxes', 'IMAP_mailbox' ] ), 'VAR' ); + test_assert_equal( $tmpl->query( name => ['IMAP_loop_watched_folders', 'IMAP_loop_mailboxes', 'IMAP_selected' ] ), 'VAR' ); + + # We set both, the mailboxes__ arrayref and the list of watched folders, to be empty + $im->{mailboxes__} = []; + $im->user_config_( 1, 'watched_folders', '' ); + $im->configure_item( 'imap_1_watch_folders', $tmpl, $language ); + test_assert( ! $tmpl->param( 'IMAP_if_mailboxes' ) ); + + # Now we set only one to a non-empty list + $im->{mailboxes__} = [ 1 ]; + $im->configure_item( 'imap_1_watch_folders', $tmpl, $language ); + test_assert( ! $tmpl->param( 'IMAP_if_mailboxes' ) ); + + $im->{mailboxes__} = []; + $im->watched_folders__( 'INBOX' ); + $im->configure_item( 'imap_1_watch_folders', $tmpl, $language ); + test_assert( ! $tmpl->param( 'IMAP_if_mailboxes' ) ); + + # Finally, both get a value + $im->{mailboxes__} = ['INBOX','something', 'other', 'second']; + $im->watched_folders__( 'INBOX', 'second' ); + $im->configure_item( 'imap_1_watch_folders', $tmpl, $language ); + test_assert( $tmpl->param( 'IMAP_if_mailboxes' ) ); + + # This should be an arrayref containing a hash for each + # iteration of the loop, ie for each watched folder + my $params = $tmpl->param('IMAP_loop_watched_folders'); + + # since we have two watched folders, we should have to elements + # in our params array + test_assert_equal( scalar @$params, 2 ); + + my $inner_loop = $params->[0]->{IMAP_loop_mailboxes}; + # since we have four mailboxes, this inner loop should have + # four elements + test_assert_equal( scalar @$inner_loop, 4 ); + my %included_mailboxes = (); + foreach ( @$inner_loop ) { + $included_mailboxes{ $_->{IMAP_mailbox} } = 1; + if ( $_->{IMAP_mailbox} eq 'INBOX' ) { + test_assert_equal( $_->{IMAP_selected}, 'selected="selected"' ); + } + else { + test_assert_equal( $_->{IMAP_selected}, '' ); + } + } + test_assert_equal( scalar keys %included_mailboxes, 4 ); + foreach ( @{$im->{mailboxes__}} ) { + test_assert_equal( $included_mailboxes{ $_ }, 1 ); + } + + # and the same for the second watched folder: + $inner_loop = $params->[1]->{IMAP_loop_mailboxes}; + # since we have four mailboxes, this inner loop should have + # four elements + test_assert_equal( scalar @$inner_loop, 4 ); + %included_mailboxes = (); + foreach ( @$inner_loop ) { + $included_mailboxes{ $_->{IMAP_mailbox} } = 1; + if ( $_->{IMAP_mailbox} eq 'second' ) { + test_assert_equal( $_->{IMAP_selected}, 'selected="selected"' ); + } + else { + test_assert_equal( $_->{IMAP_selected}, '' ); + } + } + test_assert_equal( scalar keys %included_mailboxes, 4 ); + foreach ( @{$im->{mailboxes__}} ) { + test_assert_equal( $included_mailboxes{ $_ }, 1 ); + } + + test_assert_equal( $params->[0]->{IMAP_loop_counter}, 1 ); + test_assert_equal( $params->[1]->{IMAP_loop_counter}, 2 ); + + + # imap-watch-more-folders.thtml + $tmpl = HTML::Template->new( filename => '../skins/default/imap-watch-more-folders.thtml' ); + + test_assert_equal( $tmpl->query( name => 'IMAP_if_mailboxes' ), 'VAR' ); + + $im->{mailboxes__} = []; + $im->configure_item( 'imap_2_watch_more_folders', $tmpl, $language ); + test_assert( ! $tmpl->param( 'IMAP_if_mailboxes' ) ); + + $im->{mailboxes__} = [1]; + $im->configure_item( 'imap_2_watch_more_folders', $tmpl, $language ); + test_assert( $tmpl->param( 'IMAP_if_mailboxes' ) ); + + + # imap-bucket-folders.thtml + $tmpl = HTML::Template->new( filename => '../skins/default/imap-bucket-folders.thtml' ); + test_assert_equal( $tmpl->query( name => 'IMAP_if_mailboxes' ), 'VAR' ); + $im->{mailboxes__} = []; + $im->configure_item( 'imap_3_bucket_folders', $tmpl, $language ); + test_assert( ! $tmpl->param( 'IMAP_if_mailboxes' ) ); + + $im->{mailboxes__} = ['INBOX', 'spam', 'other', 'personal', 'unclassified']; + $im->watched_folders__( 'INBOX' ); + + $im->configure_item( 'imap_3_bucket_folders', $tmpl, $language ); + test_assert( $tmpl->param( 'IMAP_if_mailboxes' ) ); + my $selected = 0; + foreach my $record ( @{$tmpl->param('imap_loop_buckets')} ) { + $record->{IMAP_Bucket_Header} =~ m|<b>(.+)</b>|; + my $bucket = $1; + test_assert( $bucket ); + my $inner_loop = $record->{IMAP_loop_mailboxes}; + test_assert( $inner_loop ); + test_assert_equal( ref $inner_loop, 'ARRAY' ); + + foreach my $inner_record ( @$inner_loop ) { + if ( $inner_record->{IMAP_mailbox} eq $bucket ) { + test_assert_equal( $inner_record->{IMAP_selected}, 'selected="selected"' ); + $selected++; + } + else { + test_assert_equal( $inner_record->{IMAP_selected}, '' ); + } + } + } + test_assert_equal( $selected, 4 ); + test_assert_equal( $selected, scalar @{$tmpl->param('imap_loop_buckets')} ); + + + # imap-update-mailbox-list.thtml + $tmpl = HTML::Template->new( filename => '../skins/default/imap-update-mailbox-list.thtml' ); + test_assert_equal( $tmpl->query( name => 'IMAP_if_connection_configured' ), 'VAR' ); + $im->user_config_( 1, 'hostname', '' ); + $im->configure_item( 'imap_4_update_mailbox_list', $tmpl, $language ); + test_assert( ! $tmpl->param('IMAP_if_connection_configured' ) ); + $im->user_config_( 1, 'hostname', 'test-host' ); + $im->configure_item( 'imap_4_update_mailbox_list', $tmpl, $language ); + test_assert( $tmpl->param('IMAP_if_connection_configured' ) ); + + # imap-options.thtml + $tmpl = HTML::Template->new( filename => '../skins/default/imap-options.thtml' ); + $im->user_config_( 1, 'expunge', 1 ); + $im->configure_item( 'imap_5_options', $tmpl, $language ); + test_assert_equal( $tmpl->param( 'IMAP_expunge_is_checked' ), 'checked="checked"' ); + + $im->user_config_( 1, 'expunge', 0 ); + $im->user_config_( 1, 'update_interval', 99 ); + $im->configure_item( 'imap_5_options', $tmpl, $language ); + test_assert_equal( $tmpl->param( 'IMAP_expunge_is_checked' ), '' ); + test_assert_equal( $tmpl->param( 'IMAP_interval', '99' ) ); + + # We now will have to test validate_item. + + # imap-connection-details.thtml + my $form = {}; + $tmpl = HTML::Template->new( filename => '../skins/default/imap-connection-details.thtml' ); + $form->{update_imap_0_connection_details} = 1; + $form->{imap_hostname} = 'hostname'; + $form->{imap_port} = 123; + $form->{imap_login} = 'username'; + $form->{imap_password} = 'secret'; + $form->{imap_use_ssl} = 1; + $im->validate_item( 'imap_0_connection_details', $tmpl, $language, $form ); + test_assert_equal( $im->user_config_( 1, 'use_ssl' ), 1 ); + test_assert_equal( $im->user_config_( 1, 'password' ), 'secret' ); + test_assert_equal( $im->user_config_( 1, 'login' ), 'username' ); + test_assert_equal( $im->user_config_( 1, 'port' ), 123 ); + test_assert_equal( $im->user_config_( 1, 'hostname' ), 'hostname' ); + + $form->{imap_use_ssl} = undef; + $im->validate_item( 'imap_0_connection_details', $tmpl, $language, $form ); + test_assert_equal( $im->user_config_( 1, 'use_ssl' ), 0 ); + + # After updating the connection details, the module must disconnect + # and empty its folders hash: + test_assert_equal( scalar keys %{$im->{folders__}}, 0 ); + + # Now test some values that should NOT validate: + + # all the parameters need to be set to something (except for use_ssl) + foreach ( qw/ imap_hostname imap_port imap_login imap_password / ) { + my %invalid_form = %$form; + delete $invalid_form{$_}; + $tmpl = HTML::Template->new( filename => '../skins/default/imap-connection-details.thtml' ); + $im->validate_item( 'imap_0_connection_details', $tmpl, $language, \%invalid_form ); + my $template_param = $_; + $template_param =~ s/imap_//; + $template_param = 'IMAP_connection_if_' . $template_param . '_error'; + test_assert_equal( $tmpl->param( $template_param ), 1, $_ ); + } + + + # imap-watch-folders.thtml + $form = {}; + $tmpl = HTML::Template->new( filename => '../skins/default/imap-watch-folders.thtml' ); + $form->{imap_folder_1} = 'first watched folder'; + $form->{imap_folder_2} = 'second watched folder'; + $form->{update_imap_1_watch_folders} = 1; + $im->watched_folders__( '1', '2' ); + $im->validate_item( 'imap_1_watch_folders', $tmpl, $language, $form ); + test_assert_equal( $im->{folder_change_flag__}, 1 ); + my @folders = $im->watched_folders__(); + test_assert_equal( scalar @folders, 2 ); + test_assert_equal( $folders[0], 'first watched folder' ); + test_assert_equal( $folders[1], 'second watched folder' ); + + # imap-watch-more-folders.thtml + $form = {}; + $form->{imap_2_watch_more_folders} = 1; + $tmpl = HTML::Template->new( filename => '../skins/default/imap-watch-more-folders.thtml' ); + $im->validate_item( 'imap_2_watch_more_folders', $tmpl, $language, $form ); + @folders = $im->watched_folders__(); + test_assert_equal( scalar @folders, 3 ); + test_assert_equal( pop @folders, 'INBOX' ); + + # imap-bucket-folders.thtml + $form = {}; + $form->{imap_3_bucket_folders} = 1; + $form->{imap_folder_for_other} = 'personal'; + $form->{imap_folder_for_personal} = 'other'; + + $tmpl = HTML::Template->new( filename => '../skins/default/imap-bucket-folders.thtml' ); + $im->validate_item('imap_3_bucket_folders', $tmpl, $language, $form ); + test_assert_equal( $im->{folder_change_flag__}, 1 ); + test_assert_equal( $im->folder_for_bucket__( 'other' ), 'personal' ); + test_assert_equal( $im->folder_for_bucket__( 'personal' ), 'other' ); + + # imap-update-mailbox-list.thtml + $form = {}; + $form->{do_imap_4_update_mailbox_list} = 1; + $tmpl = HTML::Template->new( filename => '../skins/default/imap-update-mailbox-list.thtml' ); + $im->user_config_( 1, 'hostname', '127.0.0.1' ); + $im->user_config_( 1, 'password', 'password' ); + $im->user_config_( 1, 'login', 'someone' ); + $im->user_config_( 1, 'port', '1143' ); + $im->user_config_( 1, 'update_interval', 10 ); + $im->user_config_( 1, 'use_ssl', 0 ); + $im->validate_item( 'imap_4_update_mailbox_list', $tmpl, $language, $form ); + test_assert_equal( scalar @{$im->{mailboxes__}}, 5 ); + test_assert( ! $tmpl->param( 'IMAP_update_list_failed' ) ); + + $im->user_config_( 1, 'login', 'someone' ); + $im->user_config_( 1, 'hostname', '' ); + $tmpl = HTML::Template->new( filename => '../skins/default/imap-update-mailbox-list.thtml' ); + $im->validate_item( 'imap_4_update_mailbox_list', $tmpl, $language, $form ); + test_assert( $tmpl->param( 'IMAP_update_list_failed' ) ); + + $im->user_config_( 1, 'hostname', '127.0.0.1' ); + $im->user_config_( 1, 'port', '12345' ); + $tmpl = HTML::Template->new( filename => '../skins/default/imap-update-mailbox-list.thtml' ); + $im->validate_item( 'imap_4_update_mailbox_list', $tmpl, $language, $form ); + test_assert( $tmpl->param( 'IMAP_update_list_failed' ) ); + + $im->user_config_( 1, 'port', 1143 ); + $im->user_config_( 1, 'login', 'fail' ); + $tmpl = HTML::Template->new( filename => '../skins/default/imap-update-mailbox-list.thtml' ); + $im->validate_item( 'imap_4_update_mailbox_list', $tmpl, $language, $form ); + test_assert( $tmpl->param( 'IMAP_update_list_failed' ) ); + + + # imap-options.thtml + $form = {}; + $tmpl = HTML::Template->new( filename => '../skins/default/imap-options.thtml' ); + $form->{update_imap_5_options} = 1; + $form->{imap_options_expunge} = 1; + $form->{imap_options_update_interval} = 1234; + $im->validate_item( 'imap_5_options', $tmpl, $language, $form ); + test_assert_equal( $im->user_config_( 1, 'expunge' ), 1 ); + test_assert_equal( $im->user_config_( 1, 'update_interval' ), 1234 ); + + $form->{imap_options_expunge} = undef; + $im->validate_item( 'imap_5_options', $tmpl, $language, $form ); + test_assert_equal( $im->user_config_( 1, 'expunge' ), 0 ); + + $form->{imap_options_update_interval} = 0; + $im->validate_item( 'imap_5_options', $tmpl, $language, $form ); + test_assert_equal( $tmpl->param('IMAP_if_interval_error'), 1 ); + } + + sub load_language { + my $lang = shift; + my $language = {}; + + if ( open LANG, '<', "../languages/$lang.msg" ) { + while ( <LANG> ) { + next if ( /[ \t]*#/ ); + + if ( /([^\t ]+)[ \t]+(.+)/ ) { + my ( $id, $value ) = ( $1, $2 ); + if ( $value =~ /^\"(.+)\"$/ ) { + $value = $1; + } + my $msg = $value; + $msg =~ s/[\r\n]//g; + + $language->{$id} = $msg; + } + } + close LANG; + } + return $language; + } + + + ################################################################################# + # configure_imap_module + # Tweak our configuration settings to prepare the test environment + ## + + sub configure_imap_module { + my ( $im, $c, $mq, $l, $b, $h ) = @_; + + $im->initialize(); + + # We should not do anything when we're not enabled: + $im->config_( 'enabled', 0 ); + test_assert_equal( $im->start(), 2 ); + $im->config_( 'enabled', 1 ); + $im->user_config_( 1, 'expunge', 1 ); + $im->user_config_( 1, 'hostname', '127.0.0.1' ); + $im->user_config_( 1, 'password', 'password' ); + $im->user_config_( 1, 'port', '1143' ); + $im->user_config_( 1, 'update_interval', 10 ); + $im->user_config_( 1, 'watched_folders', '' ); + + $im->global_config_( 'message_cutoff', 100000 ); + $im->global_config_( 'timeout', 4 ); + + $im->{last_update__} = 0; + $im->watched_folders__( 'INBOX' ); + $im->folder_for_bucket__( 'spam', 'spam' ); + $im->folder_for_bucket__( 'personal', 'personal' ); + $im->folder_for_bucket__( 'other', 'other' ); + $im->folder_for_bucket__( 'unclassified', 'unclassified' ); + } + + + ################################################################################# + # start_popfile + # Bring up the POPFile engine and prepare the test environment + ## + + sub start_popfile { + rmtree( 'messages' ); + rmtree( 'corpus' ); + test_assert( rec_cp( 'corpus.base', 'corpus' ) ); + test_assert( rmtree( 'corpus/CVS' ) > 0 ) if -e 'corpus/CVS'; + + unlink 'popfile.db'; + unlink 'stopwords'; + test_assert( copy ( 'stopwords.base', 'stopwords' ) ); + + mkdir 'messages'; + + my $POPFile = POPFile::Loader->new(); + $POPFile->CORE_loader_init(); + $POPFile->CORE_signals(); + + my %valid = ( 'POPFile/Database' => 1, + 'POPFile/Logger' => 1, + 'POPFile/MQ' => 1, + 'POPFile/History' => 1, + 'Classifier/Bayes' => 1, + 'Classifier/WordMangle' => 1, + 'Classifier/MailParse' => 1, + 'POPFile/Configuration' => 1, + 'Services/IMAP' => 1 ); + + $POPFile->CORE_load( 0, \%valid ); + $POPFile->CORE_initialize(); + $POPFile->CORE_config( 1 ); + my $im = $POPFile->get_module( 'Services/IMAP' ); + my $b = $POPFile->get_module( 'Classifier/Bayes' ); + my $h = $POPFile->get_module( 'POPFile/History' ); + my $l = $POPFile->get_module( 'POPFile/Logger' ); + my $mq = $POPFile->get_module( 'POPFile/MQ' ); + my $c = $POPFile->get_module( 'POPFile/Configuration' ); + + $im->config_( enabled => 1 ); + $l->config_( 'level', 1 ); + $l->config_( logdir => '/tmp/' ); + + $POPFile->CORE_start(); + + return ( $c, $mq, $l, $b, $h, $im ); + } + + + 1; |
From: Manni H. <man...@us...> - 2007-12-01 23:49:53
|
Update of /cvsroot/popfile/engine/Services In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7534/Services Modified Files: IMAP.pm Log Message: First big step toward v2.0 for the IMAP module. The test suite is working, the module is looking good, we just have to adapt the UI tests to the v2.0 templates. Index: IMAP.pm =================================================================== RCS file: /cvsroot/popfile/engine/Services/IMAP.pm,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** IMAP.pm 29 Jul 2006 19:44:11 -0000 1.26 --- IMAP.pm 1 Dec 2007 23:49:57 -0000 1.27 *************** *** 3,7 **** --- 3,10 ---- use POPFile::Module; + use Services::IMAP::Client; @ISA = ("POPFile::Module"); + use Carp; + use Fcntl; # ---------------------------------------------------------------------------- *************** [...2739 lines suppressed...] ! else { ! $self->log_( 0, "Could not LOGIN." ); ! $self->{imap_error} = 'NO_LOGIN'; ! } ! } ! else { ! $self->log_( 0, "Could not CONNECT to server." ); ! $self->{imap_error} = 'NO_CONNECT'; ! } ! } ! else { ! $self->log_( 0, 'Could not create IMAP object!' ); ! $self->{imap_error} = 'NO_OBJECT'; ! } ! ! return; } 1; |
From: Manni H. <man...@us...> - 2007-12-01 22:42:56
|
Update of /cvsroot/popfile/engine/languages In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15931/languages Modified Files: Deutsch.msg English.msg Log Message: Add text and German translation for the use_ssl widget. Index: Deutsch.msg =================================================================== RCS file: /cvsroot/popfile/engine/languages/Deutsch.msg,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** Deutsch.msg 18 Jan 2007 09:21:55 -0000 1.39 --- Deutsch.msg 1 Dec 2007 22:42:58 -0000 1.40 *************** *** 405,408 **** --- 405,409 ---- Imap_DoingTraining Das IMAP Module wird das Training jetzt anhand Ihrer archivierten Nachrichten starten. Je nach der Größe des Archivs und der Geschwindigkeit der Verbindung zum Server, kann diese einige Zeit dauern, während der die Benutzeroberfläche nicht reagieren wird. Imap_DoTraining Training anhand archivierter Mail. + Imap_Use_SSL Use SSL Shutdown_Message POPFile wurde beendet Index: English.msg =================================================================== RCS file: /cvsroot/popfile/engine/languages/English.msg,v retrieving revision 1.104 retrieving revision 1.105 diff -C2 -d -r1.104 -r1.105 *** English.msg 18 Jan 2007 08:44:43 -0000 1.104 --- English.msg 1 Dec 2007 22:42:58 -0000 1.105 *************** *** 418,421 **** --- 418,422 ---- Imap_DoingTraining The IMAP module is now going to start training on your message archive. The POPFile UI will remain unresponsive until training is completed. Depending on the size of your archive and the speed of the connection to the IMAP server, this may take a while. Imap_DoTraining Train from existing mail archive. + Imap_Use_SSL Use SSL Shutdown_Message POPFile has shut down |
From: Manni H. <man...@us...> - 2007-12-01 22:39:57
|
Update of /cvsroot/popfile/engine/skins/default In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14805/skins/default Modified Files: imap-do-training.thtml Log Message: Remove ugly <hr> from the last widget Index: imap-do-training.thtml =================================================================== RCS file: /cvsroot/popfile/engine/skins/default/imap-do-training.thtml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** imap-do-training.thtml 29 Jul 2006 19:44:12 -0000 1.1 --- imap-do-training.thtml 1 Dec 2007 22:39:59 -0000 1.2 *************** *** 16,20 **** </TMPL_IF> ! <hr width="60%" align="center" /> ! ! <!-- End of template imap-do-training.thtml --> --- 16,18 ---- </TMPL_IF> ! <!-- End of template imap-do-training.thtml --> \ No newline at end of file |
From: Manni H. <man...@us...> - 2007-12-01 22:38:36
|
Update of /cvsroot/popfile/engine/skins/default In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14449/skins/default Modified Files: imap-connection-details.thtml Log Message: Add the use_ssl widget to HEAD. Index: imap-connection-details.thtml =================================================================== RCS file: /cvsroot/popfile/engine/skins/default/imap-connection-details.thtml,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** imap-connection-details.thtml 16 Mar 2005 21:49:46 -0000 1.6 --- imap-connection-details.thtml 1 Dec 2007 22:38:39 -0000 1.7 *************** *** 14,17 **** --- 14,23 ---- <input id="imap_port" name="imap_port" type="text" value="<TMPL_VAR NAME="IMAP_port">" /> <br /> + <label for="imap_use_ssl" class="configurationLabel"> + <TMPL_VAR NAME="Localize_Imap_Use_SSL"> + </label> + <input id="imap_use_ssl" name="imap_use_ssl" type="checkbox" <TMPL_VAR NAME="IMAP_ssl_checked"> /> + <br /> + <label for="imap_login" class="configurationLabel"> <TMPL_VAR NAME="Localize_Imap_Login"> |
From: Manni H. <man...@us...> - 2007-12-01 22:37:32
|
Update of /cvsroot/popfile/engine/Services/IMAP In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14084/Services/IMAP Modified Files: Client.pm Log Message: Add comments to some of my hackery. Index: Client.pm =================================================================== RCS file: /cvsroot/popfile/engine/Services/IMAP/Client.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Client.pm 26 Nov 2007 14:48:21 -0000 1.2 --- Client.pm 1 Dec 2007 22:37:36 -0000 1.3 *************** *** 60,64 **** --- 60,68 ---- my $self = bless {}, $class; + # This is needed when the client module is run in POPFile 0.22.2 context $self->{logger__} = $log or return; + # And this one is for the 0.23 (aka 2.0) context: + $self->{modules__}{logger} = $log; + $self->{config__} = $config or return; $self->{global_config__} = $global_config or return; |
From: Manni H. <man...@us...> - 2007-12-01 22:36:28
|
Update of /cvsroot/popfile/engine/Classifier In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13716/Classifier Modified Files: popfile.sql Log Message: A new configuration value for the IMAP module: use_multiple_connections. Index: popfile.sql =================================================================== RCS file: /cvsroot/popfile/engine/Classifier/popfile.sql,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** popfile.sql 29 Apr 2006 09:07:15 -0000 1.28 --- popfile.sql 1 Dec 2007 22:36:31 -0000 1.29 *************** *** 114,118 **** -- -- buckets - the table that stores the name of POPFile buckets and relates ! -- them to users. -- -- Note: A single user may have multiple buckets, but a single bucket only has --- 114,118 ---- -- -- buckets - the table that stores the name of POPFile buckets and relates ! -- them to users. -- -- Note: A single user may have multiple buckets, but a single bucket only has *************** *** 135,139 **** -- --------------------------------------------------------------------------- -- ! -- words - the table that creates a unique ID for a word. -- -- Words and buckets come together in the matrix table to form the corpus of --- 135,139 ---- -- --------------------------------------------------------------------------- -- ! -- words - the table that creates a unique ID for a word. -- -- Words and buckets come together in the matrix table to form the corpus of *************** *** 162,171 **** -- or written unique (wordid, bucketid) -- each word appears once in a ! -- bucket ); -- --------------------------------------------------------------------------- -- ! -- user_template - the table of possible parameters that a user can have. -- -- For example in the users table there is just an password associated with --- 162,171 ---- -- or written unique (wordid, bucketid) -- each word appears once in a ! -- bucket ); -- --------------------------------------------------------------------------- -- ! -- user_template - the table of possible parameters that a user can have. -- -- For example in the users table there is just an password associated with *************** *** 185,189 **** -- for parameter unique (name) -- parameter name's are ! -- unique ); --- 185,189 ---- -- for parameter unique (name) -- parameter name's are ! -- unique ); *************** *** 198,202 **** -- entry userid integer, -- a user ! utid integer, -- points to an entry in -- user_template val varchar(255), -- value for the --- 198,202 ---- -- entry userid integer, -- a user ! utid integer, -- points to an entry in -- user_template val varchar(255), -- value for the *************** *** 205,212 **** -- instance of each parameter ); ! -- --------------------------------------------------------------------------- -- ! -- bucket_template - the table of possible parameters that a bucket can have. -- -- See commentary for user_template for an explanation of the philosophy --- 205,212 ---- -- instance of each parameter ); ! -- --------------------------------------------------------------------------- -- ! -- bucket_template - the table of possible parameters that a bucket can have. -- -- See commentary for user_template for an explanation of the philosophy *************** *** 220,225 **** def varchar(255), -- the default value for -- the parameter ! unique (name) -- parameter names ! -- are unique ); --- 220,225 ---- def varchar(255), -- the default value for -- the parameter ! unique (name) -- parameter names ! -- are unique ); *************** *** 238,246 **** unique (account) -- Each account appears -- once ! ); -- --------------------------------------------------------------------------- -- ! -- bucket_params - the table that relates buckets with bucket parameters -- (as defined in bucket_template) and specific values. -- --- 238,246 ---- unique (account) -- Each account appears -- once ! ); -- --------------------------------------------------------------------------- -- ! -- bucket_params - the table that relates buckets with bucket parameters -- (as defined in bucket_template) and specific values. -- *************** *** 250,259 **** -- entry bucketid integer, -- a bucket ! btid integer, -- points to an entry in -- bucket_template val varchar(255), -- value for the -- parameter ! unique (bucketid, btid) -- each bucket has just ! -- one instance of each -- parameter ); --- 250,259 ---- -- entry bucketid integer, -- a bucket ! btid integer, -- points to an entry in -- bucket_template val varchar(255), -- value for the -- parameter ! unique (bucketid, btid) -- each bucket has just ! -- one instance of each -- parameter ); *************** *** 299,305 **** committed integer, -- 1 if this item has been -- committed ! hdr_from varchar(255), -- The From: header ! hdr_to varchar(255), -- The To: header ! hdr_cc varchar(255), -- The Cc: header hdr_subject varchar(255), -- The Subject: header hdr_date date, -- The Date: header --- 299,305 ---- committed integer, -- 1 if this item has been -- committed ! hdr_from varchar(255), -- The From: header ! hdr_to varchar(255), -- The To: header ! hdr_cc varchar(255), -- The Cc: header hdr_subject varchar(255), -- The Subject: header hdr_date date, -- The Date: header *************** *** 309,320 **** usedtobe integer, -- Previous classification magnetid integer, -- If classified with magnet ! sort_from varchar(255), -- The From: header ! sort_to varchar(255), -- The To: header ! sort_cc varchar(255), -- The Cc: header sort_subject varchar(255), -- The Subject: header size integer -- Size of the message (bytes) ); ! -- MySQL SPECIFIC -- --------------------------------------------------------------------------- --- 309,320 ---- usedtobe integer, -- Previous classification magnetid integer, -- If classified with magnet ! sort_from varchar(255), -- The From: header ! sort_to varchar(255), -- The To: header ! sort_cc varchar(255), -- The Cc: header sort_subject varchar(255), -- The Subject: header size integer -- Size of the message (bytes) ); ! -- MySQL SPECIFIC -- --------------------------------------------------------------------------- *************** *** 344,348 **** alter table words modify word binary(255); ! -- MySQL enforces types, SQLite uses the concept of manifest typing, where -- the type of a value is associated with the value itself, not the column that -- it is stored in. POPFile has two date fields in history where POPFile --- 344,348 ---- alter table words modify word binary(255); ! -- MySQL enforces types, SQLite uses the concept of manifest typing, where -- the type of a value is associated with the value itself, not the column that -- it is stored in. POPFile has two date fields in history where POPFile *************** *** 364,371 **** -- -- It deletes the related entries in the 'matrix', 'bucket_params' and ! -- 'magnets' tables. -- -- --------------------------------------------------------------------------- ! create trigger delete_bucket delete on buckets begin --- 364,371 ---- -- -- It deletes the related entries in the 'matrix', 'bucket_params' and ! -- 'magnets' tables. -- -- --------------------------------------------------------------------------- ! create trigger delete_bucket delete on buckets begin *************** *** 435,452 **** -- These are the possible parameters for a bucket -- ! -- subject 1 if should do subject modification for message classified -- to this bucket -- xtc 1 if should add X-Text-Classification header -- xpl 1 if should add X-POPFile-Link header ! -- fncount Number of messages that were incorrectly classified, and -- meant to go into this bucket but did not ! -- fpcount Number of messages that were incorrectly classified into -- this bucket ! -- quarantine 1 if should quaratine (i.e. RFC822 wrap) messages in this -- bucket -- count Total number of messages classified into this bucket -- color The color used for this bucket in the UI ! insert into bucket_template ( name, def ) values ( 'subject', '1' ); insert into bucket_template ( name, def ) values ( 'xtc', '1' ); insert into bucket_template ( name, def ) values ( 'xpl', '1' ); --- 435,452 ---- -- These are the possible parameters for a bucket -- ! -- subject 1 if should do subject modification for message classified -- to this bucket -- xtc 1 if should add X-Text-Classification header -- xpl 1 if should add X-POPFile-Link header ! -- fncount Number of messages that were incorrectly classified, and -- meant to go into this bucket but did not ! -- fpcount Number of messages that were incorrectly classified into -- this bucket ! -- quarantine 1 if should quaratine (i.e. RFC822 wrap) messages in this -- bucket -- count Total number of messages classified into this bucket -- color The color used for this bucket in the UI ! insert into bucket_template ( name, def ) values ( 'subject', '1' ); insert into bucket_template ( name, def ) values ( 'xtc', '1' ); insert into bucket_template ( name, def ) values ( 'xpl', '1' ); *************** *** 564,567 **** --- 564,568 ---- insert into user_template ( name, def, form ) values ( 'imap_use_ssl', 0, '%d' ); insert into user_template ( name, def, form ) values ( 'imap_watched_folders', 'INBOX', '%s' ); + insert into user_template ( name, def, form ) values ( 'imap_use_multiple_connections', '0', '%d' ); -- Show the config bar at the bottom of each page defaults to on |
From: Manni H. <man...@us...> - 2007-12-01 22:24:17
|
Update of /cvsroot/popfile/engine/Classifier In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9330/Classifier Modified Files: Bayes.pm Log Message: Log at least some of the things that we are doing. Index: Bayes.pm =================================================================== RCS file: /cvsroot/popfile/engine/Classifier/Bayes.pm,v retrieving revision 1.354 retrieving revision 1.355 diff -C2 -d -r1.354 -r1.355 *** Bayes.pm 27 Nov 2007 14:44:56 -0000 1.354 --- Bayes.pm 1 Dec 2007 22:24:20 -0000 1.355 *************** *** 222,226 **** $self->config_( 'hostname', $self->{hostname__} ); ! # This parameter is used when the UI is operating in Stealth Mode. # If left blank (the default setting) the X-POPFile-Link will use 127.0.0.1 --- 222,226 ---- $self->config_( 'hostname', $self->{hostname__} ); ! # This parameter is used when the UI is operating in Stealth Mode. # If left blank (the default setting) the X-POPFile-Link will use 127.0.0.1 *************** *** 329,338 **** # Windows and using the fork. ! if ( ( $nihongo_parser eq 'kakasi' ) && ( $^O eq 'MSWin32' ) && ! ( ( ( $self->user_module_config_( 1, 'pop3', 'enabled' ) ) && ! ( $self->user_module_config_( 1, 'pop3', 'force_fork' ) ) ) || ! ( ( $self->user_module_config_( 1, 'nntp', 'enabled' ) ) && ! ( $self->user_module_config_( 1, 'nntp', 'force_fork' ) ) ) || ! ( ( $self->user_module_config_( 1, 'smtp', 'enabled' ) ) && ( $self->user_module_config_( 1, 'smtp', 'force_fork' ) ) ) ) ) { --- 329,338 ---- # Windows and using the fork. ! if ( ( $nihongo_parser eq 'kakasi' ) && ( $^O eq 'MSWin32' ) && ! ( ( ( $self->user_module_config_( 1, 'pop3', 'enabled' ) ) && ! ( $self->user_module_config_( 1, 'pop3', 'force_fork' ) ) ) || ! ( ( $self->user_module_config_( 1, 'nntp', 'enabled' ) ) && ! ( $self->user_module_config_( 1, 'nntp', 'force_fork' ) ) ) || ! ( ( $self->user_module_config_( 1, 'smtp', 'enabled' ) ) && ( $self->user_module_config_( 1, 'smtp', 'force_fork' ) ) ) ) ) { *************** *** 1504,1508 **** my $random = Crypt::Random::makerandom_octet( Length => 128, ! Strength => 1 ); my $now = time; return sha256_hex( "$$" . "$random$now" ); --- 1504,1508 ---- my $random = Crypt::Random::makerandom_octet( Length => 128, ! Strength => 0 ); my $now = time; return sha256_hex( "$$" . "$random$now" ); *************** *** 1814,1817 **** --- 1814,1818 ---- { my ( $self, $session, $file, $templ, $matrix, $idmap ) = @_; + $self->log_( 1, "Starting classify" ); my $msg_total = 0; *************** *** 1837,1840 **** --- 1838,1842 ---- for my $type ($self->get_magnet_types_in_bucket( $session, $bucket )) { if ( $self->magnet_match__( $session, $self->{parser__}->get_header($type), $bucket, $type ) ) { + $self->log_( 1, "Matched message to magnet. Bucket is $bucket." ); return $bucket; } *************** *** 2298,2301 **** --- 2300,2304 ---- } } + $self->log_( 1, "Leaving classify. Class is $class." ); return $class; *************** *** 2333,2336 **** --- 2336,2341 ---- my ( $self, $session, $mail, $client, $nosave, $class, $slot, $echo, $crlf ) = @_; + $self->log_( 1, "Starting classify_and_modify" ); + $echo = 1 unless (defined $echo); $crlf = $eol unless (defined $crlf); *************** *** 2387,2390 **** --- 2392,2396 ---- open MSG, ">$msg_file" unless $nosave; + $self->log_( 1, "Reading mail message." ); while ( my $line = $self->slurp_( $mail ) ) { my $fileline; *************** *** 2709,2712 **** --- 2715,2719 ---- } } + $self->log_( 1, "classify_and_modify done. Classification is $classification" ); return ( $classification, $slot, $self->{magnet_used__} ); *************** *** 3769,3772 **** --- 3776,3780 ---- my $default = 0; + $self->{db_get_user_parameter_default__}->execute( $utid ); my $result = $self->{db_get_user_parameter_default__}->fetchrow_arrayref; |
From: Manni H. <man...@us...> - 2007-12-01 22:22:17
|
Update of /cvsroot/popfile/engine/POPFile In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8618/POPFile Modified Files: History.pm Log Message: Fix nasty little bug that would put release_slot into an endless loop Index: History.pm =================================================================== RCS file: /cvsroot/popfile/engine/POPFile/History.pm,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** History.pm 27 Nov 2007 00:05:07 -0000 1.43 --- History.pm 1 Dec 2007 22:22:20 -0000 1.44 *************** *** 320,323 **** --- 320,328 ---- $depth--; } + else { + # We either aren't allowed to delete the + # directory or it wasn't empty + last; + } } } |
From: Manni H. <man...@us...> - 2007-12-01 21:11:35
|
Update of /cvsroot/popfile/engine/Services In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15626/Services Modified Files: Tag: b0_22_2 IMAP.pm Log Message: fix a little typo Index: IMAP.pm =================================================================== RCS file: /cvsroot/popfile/engine/Services/IMAP.pm,v retrieving revision 1.9.4.16 retrieving revision 1.9.4.17 diff -C2 -d -r1.9.4.16 -r1.9.4.17 *** IMAP.pm 1 Dec 2007 11:19:06 -0000 1.9.4.16 --- IMAP.pm 1 Dec 2007 21:11:27 -0000 1.9.4.17 *************** *** 786,790 **** if ( $magnet_used ) { ! $self->log_( 0, "Message was with slot $slot classified as $class using a magnet." ); syswrite $pseudo_mailer, "\nThis message was classified based on a magnet.\nThe body of the message was not retrieved from the server.\n"; } --- 786,790 ---- if ( $magnet_used ) { ! $self->log_( 0, "Message with slot $slot was classified as $class using a magnet." ); syswrite $pseudo_mailer, "\nThis message was classified based on a magnet.\nThe body of the message was not retrieved from the server.\n"; } *************** *** 1504,1508 **** my $something_changed = undef; ! if ( $form->{imap_hostname} ) { $templ->param( IMAP_connection_if_hostname_error => 0 ); if ( $self->config_( 'hostname' ) ne $form->{imap_hostname} ) { --- 1504,1508 ---- my $something_changed = undef; ! if ( $form->{imap_hostname} && $form->{imap_hostname} =~ /^\S+/ ) { $templ->param( IMAP_connection_if_hostname_error => 0 ); if ( $self->config_( 'hostname' ) ne $form->{imap_hostname} ) { |
From: Manni H. <man...@us...> - 2007-12-01 20:58:29
|
Update of /cvsroot/popfile/engine/Services/IMAP In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10943/Services/IMAP Modified Files: Tag: b0_22_2 Client.pm Log Message: Make the IMAP-Client module ready for POPFile v2.0 Index: Client.pm =================================================================== RCS file: /cvsroot/popfile/engine/Services/IMAP/Client.pm,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -C2 -d -r1.1.2.4 -r1.1.2.5 *** Client.pm 30 Nov 2007 21:13:40 -0000 1.1.2.4 --- Client.pm 1 Dec 2007 20:58:32 -0000 1.1.2.5 *************** *** 60,64 **** --- 60,68 ---- my $self = bless {}, $class; + # This is needed when the client module is run in POPFile 0.22.2 context $self->{logger__} = $log or return; + # And this one is for the 0.23 (aka 2.0) context: + $self->{modules__}{logger} = $log; + $self->{config__} = $config or return; $self->{global_config__} = $global_config or return; |
From: Manni H. <man...@us...> - 2007-12-01 18:02:16
|
Update of /cvsroot/popfile/engine/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13604/tests Modified Files: Tag: b0_22_2 TestIMAP.tst Makefile Log Message: Add a new target for the Makefile: cover This will use Devel::Cover to produce the coverage report which is a bit more helpful than our TestCoverage. Fix a bug in the IMAP tests I would never have found without Devel::Cover. Index: TestIMAP.tst =================================================================== RCS file: /cvsroot/popfile/engine/tests/TestIMAP.tst,v retrieving revision 1.3.4.11 retrieving revision 1.3.4.12 diff -C2 -d -r1.3.4.11 -r1.3.4.12 *** TestIMAP.tst 30 Nov 2007 21:13:39 -0000 1.3.4.11 --- TestIMAP.tst 1 Dec 2007 18:02:19 -0000 1.3.4.12 *************** *** 93,96 **** --- 93,104 ---- test_assert( $im->start() ); + # The module is not supposed to do anything when the update + # interval hasn't elapsed yet: + my $last_update = time - 2; + $im->{last_update__} = $last_update; + $im->service(); + test_assert_equal( $im->{last_update__}, $last_update ); + $im->{last_update__} = 0; + # Login. The server doesn't have any messages for us yet $im->log_( 0, "---- testing login to empty server (uidnext and uidvalidity)" ); *************** *** 98,101 **** --- 106,111 ---- $im->service(); + test_assert_equal( $im->{last_update__}, time ); + foreach my $folder (qw/ INBOX personal spam other / ) { my $client = $im->{folders__}{$folder}{imap}; *************** *** 692,696 **** $im->config_( 'hostname', '127.0.0.1' ); $im->config_( 'password', 'password' ); ! $im->config_( 'username', 'someone' ); $im->config_( 'port', '1143' ); $im->config_( 'update_interval', 10 ); --- 702,706 ---- $im->config_( 'hostname', '127.0.0.1' ); $im->config_( 'password', 'password' ); ! $im->config_( 'login', 'someone' ); $im->config_( 'port', '1143' ); $im->config_( 'update_interval', 10 ); *************** *** 700,704 **** --- 710,716 ---- test_assert( ! $tmpl->param( 'IMAP_update_list_failed' ) ); + $im->config_( 'login', 'someone' ); $im->config_( 'hostname', '' ); + $tmpl = HTML::Template->new( filename => '../skins/default/imap-update-mailbox-list.thtml' ); $im->validate_item( 'imap_4_update_mailbox_list', $tmpl, $language, $form ); test_assert( $tmpl->param( 'IMAP_update_list_failed' ) ); *************** *** 706,714 **** $im->config_( 'hostname', '127.0.0.1' ); $im->config_( 'port', '12345' ); $im->validate_item( 'imap_4_update_mailbox_list', $tmpl, $language, $form ); test_assert( $tmpl->param( 'IMAP_update_list_failed' ) ); $im->config_( 'port', 1143 ); ! $im->config_( 'username', 'fail' ); $im->validate_item( 'imap_4_update_mailbox_list', $tmpl, $language, $form ); test_assert( $tmpl->param( 'IMAP_update_list_failed' ) ); --- 718,728 ---- $im->config_( 'hostname', '127.0.0.1' ); $im->config_( 'port', '12345' ); + $tmpl = HTML::Template->new( filename => '../skins/default/imap-update-mailbox-list.thtml' ); $im->validate_item( 'imap_4_update_mailbox_list', $tmpl, $language, $form ); test_assert( $tmpl->param( 'IMAP_update_list_failed' ) ); $im->config_( 'port', 1143 ); ! $im->config_( 'login', 'fail' ); ! $tmpl = HTML::Template->new( filename => '../skins/default/imap-update-mailbox-list.thtml' ); $im->validate_item( 'imap_4_update_mailbox_list', $tmpl, $language, $form ); test_assert( $tmpl->param( 'IMAP_update_list_failed' ) ); *************** *** 748,751 **** --- 762,768 ---- $im->history ( $h ); $im->initialize(); + # We should not do anything when we're not enabled: + $im->config_( 'enabled', 0 ); + test_assert_equal( $im->start(), 2 ); $im->config_( 'enabled', 1 ); $im->config_( 'expunge', 1 ); Index: Makefile =================================================================== RCS file: /cvsroot/popfile/engine/tests/Makefile,v retrieving revision 1.11.8.1 retrieving revision 1.11.8.2 diff -C2 -d -r1.11.8.1 -r1.11.8.2 *** Makefile 6 Feb 2006 15:19:10 -0000 1.11.8.1 --- Makefile 1 Dec 2007 18:02:19 -0000 1.11.8.2 *************** *** 29,36 **** runtest: ! @perl -I ../ $(DEBUGARGS) ../tests.pl $(TESTARGS) ifdef DEBUGARGS @perl ../coverage.pl endif @rm -rf corpus @rm -rf messages --- 29,39 ---- runtest: ! @perl -I ../ $(DEBUGARGS) $(COVERARGS) ../tests.pl $(TESTARGS) ifdef DEBUGARGS @perl ../coverage.pl endif + ifdef COVERARGS + cover -report html cover_db + endif @rm -rf corpus @rm -rf messages |
From: Manni H. <man...@us...> - 2007-12-01 18:02:16
|
Update of /cvsroot/popfile/engine In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13604 Modified Files: Tag: b0_22_2 Makefile Log Message: Add a new target for the Makefile: cover This will use Devel::Cover to produce the coverage report which is a bit more helpful than our TestCoverage. Fix a bug in the IMAP tests I would never have found without Devel::Cover. Index: Makefile =================================================================== RCS file: /cvsroot/popfile/engine/Makefile,v retrieving revision 1.41.4.3 retrieving revision 1.41.4.4 diff -C2 -d -r1.41.4.3 -r1.41.4.4 *** Makefile 27 Nov 2007 07:54:36 -0000 1.41.4.3 --- Makefile 1 Dec 2007 18:02:19 -0000 1.41.4.4 *************** *** 14,17 **** --- 14,18 ---- @echo @echo "coverage - Run POPFile test suite with coverage information" + @echo "cover - Run POPFile test suite with coverage information provided by Devel::Cover" @echo "test - Run POPFile test suite" @echo "eachtest - Run POPFile tests one by one" *************** *** 37,40 **** --- 38,48 ---- @$(MAKE) --no-print-directory -C tests runtest TESTARGS=$(TESTARGS) DEBUGARGS=-d:TestCoverage + cover: + @echo Running test suite with code coverage by Devel::Cover + ifdef TESTARGS + @echo with arguments '$(TESTARGS)' + endif + @$(MAKE) --no-print-directory -C tests runtest TESTARGS=$(TESTARGS) COVERARGS=-MDevel::Cover=-db,cover_db,-coverage,statement,branch,condition,path,subroutine,-silent,ON,-summary,ON + test: @echo Running test suite |
From: Brian S. <xue...@us...> - 2007-12-01 15:18:28
|
Update of /cvsroot/popfile/windows In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19290 Modified Files: Tag: b0_22_2 installer-SecMinPerl-body.nsh installer-Uninstall.nsh Log Message: Update the minimal Perl to take into account a new dependency introduced in the 5.8.8 Build 822 release. Index: installer-SecMinPerl-body.nsh =================================================================== RCS file: /cvsroot/popfile/windows/installer-SecMinPerl-body.nsh,v retrieving revision 1.2.2.9 retrieving revision 1.2.2.10 diff -C2 -d -r1.2.2.9 -r1.2.2.10 *** installer-SecMinPerl-body.nsh 12 May 2007 17:12:30 -0000 1.2.2.9 --- installer-SecMinPerl-body.nsh 1 Dec 2007 15:18:30 -0000 1.2.2.10 *************** *** 38,43 **** ; This section installs the "core" version of the minimal Perl. Some of the optional ! ; POPFile components, such as the Kakasi package and POPFile's XMLRPC module, require ! ; extra Perl components which are added when the optional POPFile components are installed. !insertmacro SECTIONLOG_ENTER "Minimal Perl" --- 38,44 ---- ; This section installs the "core" version of the minimal Perl. Some of the optional ! ; POPFile components, such as the Nihongo (Japanese) parser and POPFile's XMLRPC ! ; module, require extra Perl components which are added when the optional POPFile ! ; components are installed. !insertmacro SECTIONLOG_ENTER "Minimal Perl" *************** *** 49,54 **** SetDetailsPrint listonly ! ; Install the minimal Perl "core" based upon ActivePerl 5.8.8 Build 820 ! ; (extra Perl files are added by the "Kakasi", "SOCKS" & "XMLRPC" sections in installer.nsi) SetOutPath "$G_ROOTDIR" --- 50,57 ---- SetDetailsPrint listonly ! ; Install the minimal Perl "core" based upon ActivePerl 5.8.8 Build 822 ! ; (extra Perl files are added by the "SOCKS" & "XMLRPC" sections in installer.nsi ! ; and by the macro-based "Kakasi", "MeCab" and "InternalParser" sections defined ! ; in getparser.nsh) SetOutPath "$G_ROOTDIR" *************** *** 119,123 **** SetOutPath "$G_MPLIBDIR\List" File "${C_PERL_DIR}\lib\List\Util.pm" ! SetOutPath "$G_MPLIBDIR\MIME" File "${C_PERL_DIR}\lib\MIME\*" --- 122,126 ---- SetOutPath "$G_MPLIBDIR\List" File "${C_PERL_DIR}\lib\List\Util.pm" ! SetOutPath "$G_MPLIBDIR\MIME" File "${C_PERL_DIR}\lib\MIME\*" *************** *** 132,135 **** --- 135,141 ---- File "${C_PERL_DIR}\lib\Text\ParseWords.pm" + SetOutPath "$G_MPLIBDIR\Tie" + File "${C_PERL_DIR}\lib\Tie\Hash.pm" + SetOutPath "$G_MPLIBDIR\Time" File "${C_PERL_DIR}\site\lib\Time\Local.pm" *************** *** 205,209 **** File "${C_PERL_DIR}\lib\auto\DBI\DBI.lib" ! ; Install SQLite2 support. The 0.22.5 release is based upon ActivePerl 5.8.8 Build 820 ; which includes the 3.x flavour of the DBD::SQLite module so we now default to using ; DBD::SQLite2 since POPFile 0.22.x is not compatible with SQLite 3.x. The 0.23.0 release --- 211,215 ---- File "${C_PERL_DIR}\lib\auto\DBI\DBI.lib" ! ; Install SQLite2 support. The 0.22.5 release was based upon ActivePerl 5.8.8 Build 820 ; which includes the 3.x flavour of the DBD::SQLite module so we now default to using ; DBD::SQLite2 since POPFile 0.22.x is not compatible with SQLite 3.x. The 0.23.0 release Index: installer-Uninstall.nsh =================================================================== RCS file: /cvsroot/popfile/windows/installer-Uninstall.nsh,v retrieving revision 1.4.2.17 retrieving revision 1.4.2.18 diff -C2 -d -r1.4.2.17 -r1.4.2.18 *** installer-Uninstall.nsh 24 Nov 2007 00:11:34 -0000 1.4.2.17 --- installer-Uninstall.nsh 1 Dec 2007 15:18:30 -0000 1.4.2.18 *************** *** 1152,1155 **** --- 1152,1156 ---- RMDir /r "$G_MPLIBDIR\Sys" RMDir /r "$G_MPLIBDIR\Text" + RMDir /r "$G_MPLIBDIR\Tie" RMDir /r "$G_MPLIBDIR\Time" RMDir /r "$G_MPLIBDIR\warnings" |
From: Manni H. <man...@us...> - 2007-12-01 11:22:42
|
Update of /cvsroot/popfile/engine/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1321/tests Modified Files: IMAP_test_server.pl Log Message: Use latest version of test server. Index: IMAP_test_server.pl =================================================================== RCS file: /cvsroot/popfile/engine/tests/IMAP_test_server.pl,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** IMAP_test_server.pl 20 Feb 2006 02:20:57 -0000 1.4 --- IMAP_test_server.pl 1 Dec 2007 11:22:41 -0000 1.5 *************** *** 3,7 **** # Tests for IMAP.pm # ! # Copyright (c) 2003-2006 John Graham-Cumming # # This file is part of POPFile --- 3,7 ---- # Tests for IMAP.pm # ! # Copyright (c) 2003-2007 John Graham-Cumming # # This file is part of POPFile *************** *** 41,44 **** --- 41,45 ---- use IO::Select; use File::Copy; + use Date::Format; use strict; use warnings; *************** *** 49,65 **** my $lf = "\012"; my $eol = "$cr$lf"; ! my $debug = 0; ! if ( $ARGV[0] && $ARGV[0] eq 'debug' ) { ! $debug = 1; ! } my $spool = "imap.spool"; my @mailboxes = qw/INBOX spam personal other unclassified/; ! # This is where we store all the folders' UIDNEXT values my %uidnext; ! foreach ( @mailboxes ) { ! $uidnext{ $_ } = 1; } --- 50,67 ---- my $lf = "\012"; my $eol = "$cr$lf"; ! my $debug = 1; my $spool = "imap.spool"; + # if nothing happens with in $idle_timeout seconds + # we call exit. + my $idle_timeout = 6; + my @mailboxes = qw/INBOX spam personal other unclassified/; ! # This is where we store all the folders' UIDNEXT values my %uidnext; ! foreach my $box ( @mailboxes ) { ! uid_next( $box, 1 ); } *************** *** 85,89 **** } chdir ".."; ! --- 87,91 ---- } chdir ".."; ! *************** *** 97,107 **** die "Socket could not be created. Reason: $!\n" unless ($main_sock); # The endless loop that accepts incoming connections. while ( 1 ) { my $new_sock = $main_sock->accept(); - # We set up a pipe that lets the child tell the parent that it # no longer needs to wait for new connections. --- 99,126 ---- die "Socket could not be created. Reason: $!\n" unless ($main_sock); + local $SIG{ALRM} + = sub { + $main_sock->shutdown(2); + debug( "Exiting due to idle time-out." ); + die "IMAP-Test-Server timed out. Did your tests just crash?"; + }; + # The endless loop that accepts incoming connections. + # It's not really endless. There are two ways to exit + # that loop: + # 1. The regular way: A client tries to login with the user + # name 'shutdown'. In that case, we shut down the socket + # and exit. + # 2. If the tests didn't run the way they should and the + # testing parent dies or does something otherwise silly, + # we keep an eye on the clock and exit if nothing happened + # in the last $idle_timeout seconds. while ( 1 ) { + alarm $idle_timeout if $debug; + debug ( "Waiting for a new client to connect." ); my $new_sock = $main_sock->accept(); # We set up a pipe that lets the child tell the parent that it # no longer needs to wait for new connections. *************** *** 109,112 **** --- 128,132 ---- pipe my $reader, my $writer; + debug( "Trying to fork..." ); my $pid = fork(); die "Cannot fork: $!" unless defined( $pid ); *************** *** 115,118 **** --- 135,139 ---- if ( $pid == 0 ) { close $reader; + close $main_sock; $writer->autoflush( 1 ); *************** *** 124,128 **** while ( my $buf = <$new_sock> ) { ! debug( "Received a command: $buf" ); # Look out for the shutdown signal and tell the parent # that it's time to go home when we get it. Tell the --- 145,149 ---- while ( my $buf = <$new_sock> ) { ! debug( "client said: $buf" ); # Look out for the shutdown signal and tell the parent # that it's time to go home when we get it. Tell the *************** *** 141,145 **** if ( $time_out_at == $command_no ) { ! sleep 300; } --- 162,175 ---- if ( $time_out_at == $command_no ) { ! alarm 0 if $debug; ! debug( "Going to sleep for $idle_timeout seconds" ); ! sleep $idle_timeout; ! #alarm $idle_timeout if $debug; ! # The client is supposed to drop its connection ! # at that point. So we are going to do the same thing ! # here: ! debug( "Child is exiting after time out" ); ! $new_sock->shutdown( 2 ); ! exit 0; } *************** *** 147,160 **** if ( $command_no == $drop_connection_at ) { $new_sock->shutdown( 2 ); } - # else we handle the command else { handle_command( $new_sock, $buf ); } - $command_no++; } ! exit 0; } --- 177,189 ---- if ( $command_no == $drop_connection_at ) { $new_sock->shutdown( 2 ); + alarm 0 if $debug; } # else we handle the command else { handle_command( $new_sock, $buf ); } $command_no++; } ! debug( "Child is exiting: EOF from socket" ); exit 0; } *************** *** 166,169 **** --- 195,199 ---- my $line = <$reader>; + debug ( "child said $line" ); if ( $line =~ /shutdown/ ) { close $reader; *************** *** 174,178 **** close $main_sock; ! # handle_command --- 204,208 ---- close $main_sock; ! print "\nThe IMAP_test_server is exiting.\n"; # handle_command *************** *** 189,193 **** # LOGIN - # This section is of special importance because the user name given # at login determines which stones we throw at IMAP.pm --- 219,222 ---- *************** *** 207,214 **** # New messages in one of the incoming mailboxes if ( $user =~ /^new_/ ) { ! $user =~ /_(\w+)_/; my $mailbox = $1; while ( $user =~ /_(\d+)/g ) { ! file_message ( $mailbox, $1 ); } } --- 236,243 ---- # New messages in one of the incoming mailboxes if ( $user =~ /^new_/ ) { ! $user =~ /_([a-zA-Z]+)_/; my $mailbox = $1; while ( $user =~ /_(\d+)/g ) { ! file_message( $mailbox, $1 ); } } *************** *** 235,239 **** # LIST - if ( $command =~ /^LIST "" "\*"/ && $state ne 'Not Authenticated' ) { foreach ( @mailboxes ) { --- 264,267 ---- *************** *** 252,256 **** # LOGOUT - if ( $command =~ /^LOGOUT/ ) { print $client "* BYE bye$eol"; --- 280,283 ---- *************** *** 262,271 **** } - # SELECT - if ( $command =~ /^SELECT "(.+)"$/ && ( $state eq 'Authenticated' || $state eq 'Selected' ) ) { my $mailbox = $1; if ( exists $uidnext{ $mailbox } ) { $state = 'Selected'; --- 289,297 ---- } # SELECT if ( $command =~ /^SELECT "(.+)"$/ && ( $state eq 'Authenticated' || $state eq 'Selected' ) ) { my $mailbox = $1; + uid_next ( $mailbox ); if ( exists $uidnext{ $mailbox } ) { $state = 'Selected'; *************** *** 283,295 **** # NOOP ! # (we check for Selected state here because we do not want the ! # IMAP module to do a NOOP unless we are Selected ! ! if ( $command =~ /^NOOP/ && $state eq 'Selected' ) { print $client "$tag OK NOOP complete.$eol"; return; } - # EXPUNGE if ( $command =~ /^EXPUNGE/ && $state eq 'Selected' ) { --- 309,317 ---- # NOOP ! if ( $command =~ /^NOOP/ ) { print $client "$tag OK NOOP complete.$eol"; return; } # EXPUNGE if ( $command =~ /^EXPUNGE/ && $state eq 'Selected' ) { *************** *** 300,311 **** # STATUS (we only need to handle STATUS commands asking for the UIDNEXT value because # IMAP.pm won't use any other STATUS commands) ! ! if ( $command =~ /^STATUS "(.+?)" \(UIDNEXT\)$/ && $state eq "Selected" ) { my $mailbox = $1; if ( exists $uidnext{ $mailbox } ) { my $number_of_messages = $uidnext{ $mailbox }; ! print $client "* STATUS $mailbox (UIDNEXT ", $uidnext{ $mailbox } , ")$eol"; print $client "$tag OK STATUS complete.$eol"; } --- 322,333 ---- # STATUS (we only need to handle STATUS commands asking for the UIDNEXT value because # IMAP.pm won't use any other STATUS commands) ! if ( $command =~ /^STATUS "(.+?)" \(UIDNEXT UIDVALIDITY\)$/ ) { my $mailbox = $1; + uid_next( $mailbox ); if ( exists $uidnext{ $mailbox } ) { my $number_of_messages = $uidnext{ $mailbox }; ! print $client "* STATUS $mailbox (UIDNEXT $uidnext{ $mailbox } UIDVALIDITY $uidvalidity)$eol"; print $client "$tag OK STATUS complete.$eol"; } *************** *** 322,326 **** my $uid = $1; my $part = $2; ! my $response; --- 344,348 ---- my $uid = $1; my $part = $2; ! my $response; *************** *** 372,376 **** print $client "$tag NO no such message$eol"; } ! return; } --- 394,398 ---- print $client "$tag NO no such message$eol"; } ! return; } *************** *** 389,394 **** } - - # If we get here, we don't know the command and say so --- 411,414 ---- *************** *** 406,416 **** ! sub select_mailbox ! { my ( $client, $mailbox ) = @_; local $\ = "$eol"; ! my @msgs = glob "$spool/$mailbox/*"; print $client "* ", scalar @msgs, " EXISTS"; --- 426,436 ---- ! sub select_mailbox { my ( $client, $mailbox ) = @_; local $\ = "$eol"; ! my @msgs = glob "$spool/$mailbox/*"; + uid_next( $mailbox ); print $client "* ", scalar @msgs, " EXISTS"; *************** *** 423,457 **** ! sub debug ! { return unless $debug; my @messages = @_; ! open LOG, ">>IMAPdebug.log"; foreach ( @messages ) { s/[\r\n]//g; ! print LOG "$_\n"; } ! close LOG; } ! ! sub file_message ! { my ( $folder, $msg ) = @_; ! my $new_uid = $uidnext{ $folder }; ! $uidnext{ $folder }++; ! copy "TestMailParse$msg.msg", "$spool/$folder/$new_uid"; } ! sub copy_message ! { my ( $uid, $from, $to ) = @_; ! if ( -e "$spool/$from/$uid" ) { if ( exists $uidnext{ $to } ) { my $new_uid = $uidnext{ $to }; ! $uidnext{ $to }++; copy "$spool/$from/$uid", "$spool/$to/$new_uid"; return 'OK Completed'; --- 443,477 ---- ! sub debug { return unless $debug; my @messages = @_; ! open my $LOG, '>>', 'IMAPdebug.log'; foreach ( @messages ) { s/[\r\n]//g; ! my $time = time2str( "%H:%M:%S", time ); ! print $LOG "$time: $_\n"; } ! close $LOG; } ! ! sub file_message { my ( $folder, $msg ) = @_; ! ! uid_next( $folder ); my $new_uid = $uidnext{ $folder }; ! uid_next( $folder, $uidnext{ $folder }+1 ); ! debug( "Trying to copy TestMailParse$msg.msg to $spool/$folder/$new_uid" ); copy "TestMailParse$msg.msg", "$spool/$folder/$new_uid"; } ! sub copy_message { my ( $uid, $from, $to ) = @_; ! if ( -e "$spool/$from/$uid" ) { + uid_next( $to ); if ( exists $uidnext{ $to } ) { my $new_uid = $uidnext{ $to }; ! uid_next( $to, $uidnext{ $to }+1 ); copy "$spool/$from/$uid", "$spool/$to/$new_uid"; return 'OK Completed'; *************** *** 459,472 **** return 'NO [TRYCREATE] Mailbox does not exist'; } ! } else { ! return 'NO Message does not exist'; } } ! ! ! sub delete_message ! { my ( $folder, $uid ) = @_; ! if ( -e "$spool/$folder/$uid" ) { unlink "$spool/$folder/$uid"; --- 479,492 ---- return 'NO [TRYCREATE] Mailbox does not exist'; } ! } ! else { ! return "NO Message '$spool/$from/$uid' does not exist"; } } ! ! ! sub delete_message { my ( $folder, $uid ) = @_; ! if ( -e "$spool/$folder/$uid" ) { unlink "$spool/$folder/$uid"; *************** *** 479,489 **** ! ! sub search_messages_ge ! { my ( $folder, $uid ) = @_; ! chdir "$spool/$folder/"; ! my @list; foreach ( glob "*" ) { --- 499,507 ---- ! sub search_messages_ge { my ( $folder, $uid ) = @_; ! chdir "$spool/$folder/"; ! my @list; foreach ( glob "*" ) { *************** *** 494,507 **** $flat .= " $_"; } ! chdir "../.."; ! return $flat; } ! sub get_header_fields ! { my ( $folder, $uid ) = @_; ! if ( -e "$spool/$folder/$uid" ) { open MSG, "$spool/$folder/$uid"; --- 512,524 ---- $flat .= " $_"; } ! chdir "../.."; ! return $flat; } ! sub get_header_fields { my ( $folder, $uid ) = @_; ! if ( -e "$spool/$folder/$uid" ) { open MSG, "$spool/$folder/$uid"; *************** *** 523,538 **** close MSG; my @headers = qw/message-id date subject received/; ! my $response = ''; ! foreach ( @headers ) { if ( exists $header{ $_ } ) { $response .= "\u$_: ${$header{ $_ }}[0]$eol"; ! } } ! return $response; } else { return; } --- 540,560 ---- close MSG; my @headers = qw/message-id date subject received/; ! my $response = ''; ! foreach ( @headers ) { if ( exists $header{ $_ } ) { $response .= "\u$_: ${$header{ $_ }}[0]$eol"; ! } } ! ! unless ( $response ) { ! warn "Server couldn't find any header fields in message '$spool/$folder/$uid'\n"; ! } ! return $response; } else { + warn "Server could not find file '$spool/$folder/$uid'\n"; return; } *************** *** 540,548 **** ! ! sub get_message ! { my ( $folder, $uid ) = @_; ! if ( -e "$spool/$folder/$uid" ) { open MSG, "$spool/$folder/$uid"; --- 562,568 ---- ! sub get_message { my ( $folder, $uid ) = @_; ! if ( -e "$spool/$folder/$uid" ) { open MSG, "$spool/$folder/$uid"; *************** *** 562,569 **** ! sub get_message_header ! { my ( $folder, $uid ) = @_; ! if ( -e "$spool/$folder/$uid" ) { my $response = ''; --- 582,588 ---- ! sub get_message_header { my ( $folder, $uid ) = @_; ! if ( -e "$spool/$folder/$uid" ) { my $response = ''; *************** *** 575,579 **** } close MSG; ! return "$response$eol"; } --- 594,598 ---- } close MSG; ! return "$response$eol"; } *************** *** 583,590 **** } ! sub get_message_text ! { my ( $folder, $uid ) = @_; ! if ( -e "$spool/$folder/$uid" ) { my $response = ''; --- 602,608 ---- } ! sub get_message_text { my ( $folder, $uid ) = @_; ! if ( -e "$spool/$folder/$uid" ) { my $response = ''; *************** *** 604,605 **** --- 622,655 ---- } + + sub uid_next { + my $folder = shift; + my $uidnext = shift; + + if ( open my $UIDS, '<', 'imap.uids' ) { + while ( <$UIDS> ) { + /(.+):(.+)[\r\n]/; + $uidnext{ $1 } = $2; + } + } + # else { + # die "IMAP-test-server has a problem: cannot open file 'imap.uids'"; + # } + + if ( defined $uidnext ) { + $uidnext{ $folder } = $uidnext; + if ( open my $UIDS, '>', 'imap.uids' ) { + foreach ( keys %uidnext ) { + print $UIDS "$_:$uidnext{ $_ }\n"; + } + } + else { + die "IMAP-test-server has a problem: cannot open file 'imap.uids'"; + } + } + + return $uidnext{ $folder }; + } + + + |
From: Manni H. <man...@us...> - 2007-12-01 11:19:04
|
Update of /cvsroot/popfile/engine/Services In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32445/Services Modified Files: Tag: b0_22_2 IMAP.pm Log Message: Implement some best-practice advice: use modern open don't rebless the module Index: IMAP.pm =================================================================== RCS file: /cvsroot/popfile/engine/Services/IMAP.pm,v retrieving revision 1.9.4.15 retrieving revision 1.9.4.16 diff -C2 -d -r1.9.4.15 -r1.9.4.16 *** IMAP.pm 30 Nov 2007 21:13:40 -0000 1.9.4.15 --- IMAP.pm 1 Dec 2007 11:19:06 -0000 1.9.4.16 *************** *** 55,61 **** sub new { my $type = shift; ! my $self = POPFile::Module->new(); ! ! bless $self, $type; $self->name( 'imap' ); --- 55,59 ---- sub new { my $type = shift; ! my $self = $type->SUPER::new(); $self->name( 'imap' ); *************** *** 875,896 **** my $file = $self->get_user_path_( 'imap.tmp' ); ! unless ( open TMP, ">$file" ) { ! $self->log_( 0, "Cannot open temp file $file" ); ! return; ! }; ! ! foreach ( @lines ) { ! print TMP $_; ! } ! close TMP; ! my $slot = $self->history()->get_slot_from_hash( $hash ); ! $self->classifier()->add_message_to_bucket( $self->api_session(), $new_bucket, $file ); ! $self->classifier()->reclassified( $self->api_session(), $old_bucket, $new_bucket, 0 ); ! $self->history()->change_slot_classification( $slot, $new_bucket, $self->api_session(), 0); ! $self->log_( 0, "Reclassified the message with UID $msg from bucket $old_bucket to bucket $new_bucket." ); ! unlink $file; } --- 873,895 ---- my $file = $self->get_user_path_( 'imap.tmp' ); ! if ( open my $TMP, '>', $file ) { ! foreach ( @lines ) { ! print $TMP $_; ! } ! close $TMP; ! my $slot = $self->history()->get_slot_from_hash( $hash ); ! $self->classifier()->add_message_to_bucket( $self->api_session(), $new_bucket, $file ); ! $self->classifier()->reclassified( $self->api_session(), $old_bucket, $new_bucket, 0 ); ! $self->history()->change_slot_classification( $slot, $new_bucket, $self->api_session(), 0); ! $self->log_( 0, "Reclassified the message with UID $msg from bucket $old_bucket to bucket $new_bucket." ); ! unlink $file; ! } ! else { ! $self->log_( 0, "Cannot open temp file $file" ); ! return; ! } } |
From: Manni H. <man...@us...> - 2007-11-30 21:21:51
|
Update of /cvsroot/popfile/engine/skins/default In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28213/skins/default Modified Files: Tag: b0_22_2 imap-options.thtml Log Message: Omit ugly <hr> Index: imap-options.thtml =================================================================== RCS file: /cvsroot/popfile/engine/skins/default/imap-options.thtml,v retrieving revision 1.6 retrieving revision 1.6.6.1 diff -C2 -d -r1.6 -r1.6.6.1 *** imap-options.thtml 23 Aug 2004 12:18:58 -0000 1.6 --- imap-options.thtml 30 Nov 2007 21:21:54 -0000 1.6.6.1 *************** *** 29,34 **** <input type="submit" class="submit" name="update_imap_5_options" value="<TMPL_VAR NAME="Localize_Apply">" /> <input type="hidden" name="session" value="<TMPL_VAR NAME="Session_Key">" /> - <hr width="60%" align="center" /> </form> - <!-- End of template imap-options.thtml --> --- 29,32 ---- |
From: Manni H. <man...@us...> - 2007-11-30 21:13:37
|
Update of /cvsroot/popfile/engine/Services In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25319/Services Modified Files: Tag: b0_22_2 IMAP.pm Log Message: Sanity-check our configuration values and add tests for this. Index: IMAP.pm =================================================================== RCS file: /cvsroot/popfile/engine/Services/IMAP.pm,v retrieving revision 1.9.4.14 retrieving revision 1.9.4.15 diff -C2 -d -r1.9.4.14 -r1.9.4.15 *** IMAP.pm 26 Nov 2007 11:07:37 -0000 1.9.4.14 --- IMAP.pm 30 Nov 2007 21:13:40 -0000 1.9.4.15 *************** *** 535,542 **** # If we already have a UIDVALIDITY value stored, # we compare the old and the new value. - if ( defined $imap->uid_validity( $folder ) ) { if ( $imap->check_uidvalidity( $folder, $uidvalidity ) ) { ! # That's the nice case. We simply do nothing. } else { --- 535,546 ---- # If we already have a UIDVALIDITY value stored, # we compare the old and the new value. if ( defined $imap->uid_validity( $folder ) ) { if ( $imap->check_uidvalidity( $folder, $uidvalidity ) ) { ! # That's the nice case. ! # But let's make sure that our UIDNEXT value is also valid ! unless ( defined $imap->uid_next( $folder ) ) { ! $self->log_( 0, "Detected invalid UIDNEXT configuration value for folder $folder. Some new messages might have been skipped." ); ! $imap->uid_next( $folder, $uidnext ); ! } } else { |
From: Manni H. <man...@us...> - 2007-11-30 21:13:37
|
Update of /cvsroot/popfile/engine/Services/IMAP In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25319/Services/IMAP Modified Files: Tag: b0_22_2 Client.pm Log Message: Sanity-check our configuration values and add tests for this. Index: Client.pm =================================================================== RCS file: /cvsroot/popfile/engine/Services/IMAP/Client.pm,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** Client.pm 26 Nov 2007 11:12:39 -0000 1.1.2.3 --- Client.pm 30 Nov 2007 21:13:40 -0000 1.1.2.4 *************** *** 653,657 **** if ( $result != 1 ) { ! $self->log_( 0, "SEARCH command failed (return value: $result)!" ); } --- 653,657 ---- if ( $result != 1 ) { ! $self->log_( 0, "SEARCH command failed (return value: $result, used UID was [$uid])!" ); } *************** *** 881,885 **** # get else { ! if ( exists $hash{$folder} ) { return $hash{$folder}; } --- 881,885 ---- # get else { ! if ( exists $hash{$folder} && $hash{$folder} =~ /^\d+$/ ) { return $hash{$folder}; } *************** *** 926,930 **** # get else { ! if ( exists $hash{$folder} ) { return $hash{$folder}; } --- 926,930 ---- # get else { ! if ( exists $hash{$folder} && $hash{$folder} =~ /^\d+$/ ) { return $hash{$folder}; } |
From: Manni H. <man...@us...> - 2007-11-30 21:13:37
|
Update of /cvsroot/popfile/engine/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25319/tests Modified Files: Tag: b0_22_2 TestIMAP.tst Log Message: Sanity-check our configuration values and add tests for this. Index: TestIMAP.tst =================================================================== RCS file: /cvsroot/popfile/engine/tests/TestIMAP.tst,v retrieving revision 1.3.4.10 retrieving revision 1.3.4.11 diff -C2 -d -r1.3.4.10 -r1.3.4.11 *** TestIMAP.tst 26 Nov 2007 11:07:37 -0000 1.3.4.10 --- TestIMAP.tst 30 Nov 2007 21:13:39 -0000 1.3.4.11 *************** *** 230,233 **** --- 230,234 ---- # The module is supposed to retrieve the list of mailboxes if it # hasn't got any yet. + $im->log_( 0, '---- using invalid uidvalidities' ); $im->{mailboxes__} = []; $im->{last_update__} = 0; *************** *** 236,239 **** --- 237,248 ---- $im->disconnect_folders__(); + # Give an invalid configuration string for uidnexts and uidvalidities + # and see whether we react in a graceful manner + $newvalis = $uidvalis; + $newvalis =~ s/-->(\d+)-->/-->-->/; + $im->config_( 'uidvalidities', $newvalis ); + $im->{last_update__} = 0; + $im->service(); + test_assert_equal( $im->config_('uidvalidities'), $uidvalis ); # Check what happens when we time out |
From: John Graham-C. <jgr...@us...> - 2007-11-30 14:59:39
|
Update of /cvsroot/popfile/windows In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10839 Modified Files: Tag: b0_22_2 installer.nsi Log Message: Update to build 822 of Perl Index: installer.nsi =================================================================== RCS file: /cvsroot/popfile/windows/installer.nsi,v retrieving revision 1.242.4.19 retrieving revision 1.242.4.20 diff -C2 -d -r1.242.4.19 -r1.242.4.20 *** installer.nsi 24 Nov 2007 00:11:34 -0000 1.242.4.19 --- installer.nsi 30 Nov 2007 14:59:41 -0000 1.242.4.20 *************** *** 284,288 **** !define C_PERL_DIR "C:\Perl" !define C_PERL_VERSION "5.8.8" ! !define C_PERL_BUILD "820" ;---------------------------------------------------------------------- --- 284,288 ---- !define C_PERL_DIR "C:\Perl" !define C_PERL_VERSION "5.8.8" ! !define C_PERL_BUILD "822" ;---------------------------------------------------------------------- |
From: John Graham-C. <jgr...@us...> - 2007-11-30 14:50:03
|
Update of /cvsroot/popfile/engine In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7193 Modified Files: Tag: b0_22_2 popfile.pck Log Message: Clean up the packing list so the the IMAP::Client module is optional and only needed for IMAP support, add a reason for the MeCab module Index: popfile.pck =================================================================== RCS file: /cvsroot/popfile/engine/popfile.pck,v retrieving revision 1.4.4.2 retrieving revision 1.4.4.3 diff -C2 -d -r1.4.4.2 -r1.4.4.3 *** popfile.pck 27 Nov 2007 07:54:36 -0000 1.4.4.2 --- popfile.pck 30 Nov 2007 14:49:52 -0000 1.4.4.3 *************** *** 20,26 **** REQUIRED 0.0.0 MIME::Base64 REQUIRED 0.0.0 MIME::QuotedPrint ! OPTIONAL- 0.0.0 MeCab REQUIRED 0.0.0 POSIX ! REQUIRED 0.0.0 Services::IMAP::Client REQUIRED 0.0.0 Sys::Hostname OPTIONAL-Japanese Language Support 0.0.0 Text::Kakasi --- 20,26 ---- REQUIRED 0.0.0 MIME::Base64 REQUIRED 0.0.0 MIME::QuotedPrint ! OPTIONAL-Japanese Language Support 0.0.0 MeCab REQUIRED 0.0.0 POSIX ! OPTIONAL-IMAP Support 0.0.0 Services::IMAP::Client REQUIRED 0.0.0 Sys::Hostname OPTIONAL-Japanese Language Support 0.0.0 Text::Kakasi |
From: naoki i. <am...@us...> - 2007-11-27 14:46:45
|
Update of /cvsroot/popfile/engine/UI In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27683/UI Modified Files: HTML.pm Log Message: Fixed the downloading message link in the single message view. Index: HTML.pm =================================================================== RCS file: /cvsroot/popfile/engine/UI/HTML.pm,v retrieving revision 1.376 retrieving revision 1.377 diff -C2 -d -r1.376 -r1.377 *** HTML.pm 26 Nov 2007 15:22:48 -0000 1.376 --- HTML.pm 27 Nov 2007 14:46:49 -0000 1.377 *************** *** 3185,3189 **** if ( defined( $self->{form_}{text} ) ) { ! $self->http_file_( $client, $self->{history__}->get_slot_file( $self->{form_}{view} ), 'text/plain' ); return 1; } --- 3185,3189 ---- if ( defined( $self->{form_}{text} ) ) { ! $self->http_file_( $client, $self->history_()->get_slot_file( $self->{form_}{view} ), 'text/plain' ); return 1; } |