/[mws]/trunk/mbox2index.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/mbox2index.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 6 by dpavlin, Tue May 4 15:47:14 2004 UTC revision 7 by dpavlin, Wed May 5 15:38:35 2004 UTC
# Line 12  foreach my $mbox ($mws->{config}->Parame Line 12  foreach my $mbox ($mws->{config}->Parame
12    
13          print STDERR "working on $mbox [$mbox_path]\n" if ($debug);          print STDERR "working on $mbox [$mbox_path]\n" if ($debug);
14    
15          my $folder = $mws->{mgr}->open($mbox_path, extract => 'LAZY');          my $folder = $mws->open_folder($mbox);
16    
17          foreach my $message ($folder->messages) {          foreach my $message ($folder->messages) {
18    
19                  my $id = $message->messageId;                  my $id = $message->messageId;
# Line 23  foreach my $mbox ($mws->{config}->Parame Line 24  foreach my $mbox ($mws->{config}->Parame
24                          folder => $mbox,                          folder => $mbox,
25                  };                  };
26    
   
   
27                  foreach my $direction (qw(to from cc bcc)) {                  foreach my $direction (qw(to from cc bcc)) {
28                          foreach my $f ($message->$direction) {                          foreach my $f ($message->$direction) {
29                                  print "$direction: ";                                  print "$direction: ";
# Line 41  foreach my $mbox ($mws->{config}->Parame Line 40  foreach my $mbox ($mws->{config}->Parame
40                  }                  }
41    
42                  $document->{'subject'} = $message->get('Subject') || 'no subject';                  $document->{'subject'} = $message->get('Subject') || 'no subject';
43                    $document->{'body'} = $mws->plain_text_body($message);
44    
45  #               print Dumper($document);  #               print Dumper($document);
46                  $mws->{index}->add("$mbox $id" => $document);                  $mws->{index}->add("$mbox $id" => $document);

Legend:
Removed from v.6  
changed lines
  Added in v.7

  ViewVC Help
Powered by ViewVC 1.1.26