/[mws]/trunk/MWS.pm
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/MWS.pm

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

revision 42 by dpavlin, Mon May 10 22:04:01 2004 UTC revision 50 by dpavlin, Sun May 16 22:22:27 2004 UTC
# Line 150  sub open_folder { Line 150  sub open_folder {
150    
151                  print STDERR "about to open_folder($mbox)\n" if ($debug == 2);                  print STDERR "about to open_folder($mbox)\n" if ($debug == 2);
152    
153                  $self->{folder}->{$mbox} = $self->{mgr}->open($mbox_path) || croak "can't open folder $mbox at '$mbox_path': $!";                  my $folder;
154    
155                    # is this maildir (no locking anyway)
156                    if (-d $mbox_path) {
157                            $folder = $self->{mgr}->open($mbox_path);
158                    } else {
159                            $folder = $self->{mgr}->open($mbox_path, lock_type=>'none' );
160                    }
161    
162                    $self->{folder}->{$mbox} = $folder || croak "can't open folder $mbox at '$mbox_path': $!";
163    
164                  print STDERR "open_folder($mbox) ok\n" if ($debug);                  print STDERR "open_folder($mbox) ok\n" if ($debug);
165          }          }
# Line 245  sub decode_qp($) { Line 254  sub decode_qp($) {
254    
255                  print STDERR "$qp\n" if ($debug == 2);                  print STDERR "$qp\n" if ($debug == 2);
256    
257                  my $iconv = Text::Iconv->new($cp,'ISO-8859-2');                  my $iconv;
258                  return $iconv->convert($qp) || '';                  eval '$iconv = Text::Iconv->new($cp,"ISO-8859-2")';
259                    if ($iconv) {
260                            return $iconv->convert($qp) || '';
261                    } else {
262                            return $qp;
263                    }
264          }          }
265    
266          $tmp =~ s/=\?([^\?]+)\?([QB])\?(.+?)\?=/decode($1,$2,$3)/ige;          $tmp =~ s/=\?([^\?]+)\?([QB])\?(.+?)\?=/decode($1,$2,$3)/ige;
# Line 333  sub plain_text_body { Line 347  sub plain_text_body {
347          # reformat with Text::Autoformat          # reformat with Text::Autoformat
348          my $wrap = $self->{wrap_margin};          my $wrap = $self->{wrap_margin};
349          if ($wrap && $body && $body =~ m/^.{$wrap}..*$/m) {          if ($wrap && $body && $body =~ m/^.{$wrap}..*$/m) {
350                  $body = autoformat($body, {right=>$wrap, all=>1});                  eval '$body = autoformat($body, {right=>$wrap, all=>1});';
351                  $body .="\n[reformated using autoformat, margin at $wrap]" if ($debug == 2);                  $body .="\n[reformated using autoformat, margin at $wrap]" if ($debug == 2);
352          }          }
353    

Legend:
Removed from v.42  
changed lines
  Added in v.50

  ViewVC Help
Powered by ViewVC 1.1.26