equal
deleted
inserted
replaced
83 |
83 |
84 $| = 1; |
84 $| = 1; |
85 |
85 |
86 for (@{$f}) { |
86 for (@{$f}) { |
87 |
87 |
88 next unless /volke.*2011/; |
|
89 |
|
90 print "Examining $_ ...\n"; |
88 print "Examining $_ ...\n"; |
91 $imap->examine($_) |
89 $imap->examine($_) |
92 or die "Can't examine: " . $imap->LastError . "\n"; |
90 or die "Can't examine: " . $imap->LastError . "\n"; |
93 print "Searching $_ ...\n"; |
91 print "Searching $_ ...\n"; |
94 my $m = $imap->search( $opts->{criteria} ) |
92 if ( my $m = $imap->search( $opts->{criteria} )) { |
95 or die "Can't search: " . $imap->LastError . "\n"; |
93 $mids->{$_} = $m; |
96 $mids->{$_} = $m; |
94 } else { |
|
95 my $e = $imap->LastError; |
|
96 # dovecots fts plugin may just crash and cause the connection to drop |
|
97 # (this happened when searching a mailbox containing just gzipped mail |
|
98 # files and results in log messages like these: |
|
99 # 2011-11-02 14:59:13 IMAP(userid): Panic: file squat-trie.c: line 877 (squat_build_word): assertion failed: (i + bytelen <= size) |
|
100 # 2011-11-02 14:59:13 IMAP(userid): Error: Raw backtrace: imap [0x80f2fd1] -> imap [0x80f3052] -> imap [0x80f29a9] -> /usr/lib/dovecot/modules/imap/lib21_fts_squat_plugin.so [0xb744a50d] -> /usr/lib/dovecot/modules/imap/lib21_fts_squat_plugin.so(squat_trie_build_more+0x151) [0xb744a7a1] -> /usr/lib/dovecot/modules/imap/lib21_fts_squat_plugin.so [0xb7447a54] -> /usr/lib/dovecot/modules/imap/lib20_fts_plugin.so(fts_backend_build_more+0x2e) [0xb7453e7e] -> /usr/lib/dovecot/modules/imap/lib20_fts_plugin.so [0xb7456fb6] -> imap(mailbox_search_next_nonblock+0x2d) [0x80b6e7d] -> imap [0x806e221] -> imap(imap_search_start+0x150) [0x806e700] -> imap(cmd_search+0xff) [0x8064d2f] -> imap [0x8067c6c] -> imap [0x8067d09] -> imap(client_handle_input+0x2d) [0x8067e7d] -> imap(client_input+0x5f) [0x80687df] -> imap(io_loop_handler_run+0xe0) [0x80fbd80] -> imap(io_loop_run+0x20) [0x80fb1f0] -> imap(main+0x5ea) [0x80713ba] -> /lib/i686/cmov/libc.so.6(__libc_start_main+0xe5) [0xb75f1455] -> imap [0x8060351] |
|
101 # 2011-11-02 14:59:13 dovecot: Error: child 7559 (imap) killed with signal 6 (core dumps disabled) |
|
102 if ($e eq 'socket closed while reading data from server') { |
|
103 $imap->connect |
|
104 or die "Could not connect to IMAP server: $@\n"; |
|
105 } else { |
|
106 |
|
107 die "Can't search: $e\n"; |
|
108 |
|
109 } |
|
110 } |
97 |
111 |
98 } |
112 } |
99 |
113 |
100 my @headers = qw(subject from to cc bcc date); |
114 my @headers = qw(subject from to cc bcc date); |
101 for ( sort keys %{$mids} ) { |
115 for ( sort keys %{$mids} ) { |