Namazu-devel-en(old)


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

attachment names in mailnews.pl [patch]



Hi,

I'am using namazu for indexing my maildir style mailboxes and it works
great. To be able to find attachments (by their name), I changed 
the mailnews.pl filter a little (see patch below).
Perhaps this is useful for other as well.

Thanks,
Johannes

diff -u -r namazu-2.0.12.orig/filter/mailnews.pl namazu-2.0.12/filter/mailnews.pl
--- namazu-2.0.12.orig/filter/mailnews.pl	Fri Jun  6 17:39:16 2003
+++ namazu-2.0.12/filter/mailnews.pl	Fri Jun  6 17:39:45 2003
@@ -159,7 +159,9 @@
  	for $_ (@parts){
  	    if (s/^(.*?\n\n)//s){
  		my ($head) = $1;
- 		$$contref .= $_ if $head =~ m!^content-type:.*text/plain!mi;
+ 		my ($body) = $_;
+ 		$$contref .= $1 if $head =~ /name=\"([^\"]*)\"/;
+ 		$$contref .= $body if $head =~ m!^content-type:.*text/plain!mi;
  	    }
  	}
     }