From cf3b28b73d3290251efa6f76ca72be2a50bd5e76 Mon Sep 17 00:00:00 2001 From: epg <> Date: Sat, 10 Apr 2004 04:00:17 +0000 Subject: [PATCH 1/1] Two optimizations: Don't load .mincspam until it is actually needed, in filter_mail. Print the first status message (the number of messages to process) as soon as we can, in getfiles. --- minc | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/minc b/minc index a8eb94f..f33fddb 100755 --- a/minc +++ b/minc @@ -187,14 +187,6 @@ marked unseen. our @FILTERS; require "$HOME/.mincfilter"; -if (-f "$HOME/.mincspam") { - require "$HOME/.mincspam"; -} else { - eval "sub spam_start_hook { return (); }"; - eval "sub spam_stop_hook { }"; - eval "sub spam_check { return 0; }"; -} - my $mh; my $logfile; @@ -337,6 +329,9 @@ sub getfiles { exit(0); } + STDOUT->autoflush(1); + print(scalar(@result), " messages..."); + closedir(DIR); return @result; @@ -591,10 +586,16 @@ sub filter_mail { my $saved = 0; my %FOLDERS = ('SPAM'=>1); + if (-f "$HOME/.mincspam") { + require "$HOME/.mincspam"; + } else { + eval "sub spam_start_hook { return (); }"; + eval "sub spam_stop_hook { }"; + eval "sub spam_check { return 0; }"; + } + @baton = spam_start_hook(); - STDOUT->autoflush(1); - print("$msgcount messages..."); foreach $msg (@msglist) { if (spam_check($msg, @baton)) { $mhfolder = 'SPAM'; -- 2.56.0