]> diplodocus.org Git - minc/commitdiff
(filter_mail): Support a post_store_hook, in case someone wants to do
authorepg <>
Thu, 25 Nov 2004 05:09:31 +0000 (05:09 +0000)
committerepg <>
Thu, 25 Nov 2004 05:09:31 +0000 (05:09 +0000)
post-processing for a message.  This is getting out of hand; all these
hooks should be folded into a single .mincrc or something...

minc

diff --git a/minc b/minc
index 85aeadf..277cd52 100755 (executable)
--- a/minc
+++ b/minc
@@ -537,6 +537,7 @@ sub filter_mail {
     my $mhfolder;
     my $spam = 0;
     my $saved = 0;
+    my $msgnum;
     my %FOLDERS = ('SPAM'=>1);
 
     if (-f "$HOME/.mincspam") {
@@ -551,6 +552,12 @@ sub filter_mail {
         require "$HOME/.mincfilter";
     }
 
+    if (-f "$HOME/.minchooks") {
+        require "$HOME/.minchooks";
+    } else {
+        eval "sub post_store_hook { }";
+    }
+
     @baton = spam_start_hook();
 
     foreach $msg (@msglist) {
@@ -568,7 +575,9 @@ sub filter_mail {
             $saved++;
         }
 
-        store_message($msg, $mhfolder);
+        $msgnum = store_message($msg, $mhfolder);
+
+        post_store_hook($mhfolder, $msgnum);
 
         print("\r");
         if (not $FOLDERS{$mhfolder}) {