Captain's Universe Home
Captain's Universe Home
Cosmic Ray Muon DetectorTeleGarden Pages
Time on MarsBryophyllum Plants
Jupiter Radio AstronomyAncient Pages
Salzburg Tourist GuideEarth Magnetometer
  H O M E     AJAX & MORE     LINUX & MORE     RTAI     XENOMAI     ADEOS IPIPE      
    JAVA & BROWSERS     *NIX     ELECTRONICS     REVIEWS     ARTEMIA     FAIRY SHRIMP      


Thunderbird Mailbox Checker V0.2.1 - perl script for checking for lost mails in Thunderbird

UPDATE: Resent-Message-ID is actually ignored by Thunderbird. This page has been updated to reflect this change.

There is a serious bug in Thunderbird 1.5.0.8, which causes the email client to hide certain emails with special headers:
https://bugzilla.mozilla.org/show_bug.cgi?id=360409

Basically all emails with equal header values of "Message-ID" and "References" are hidden.

DO NOT COMPACT YOUR FOLDERS AS SUGGESTED IN THE MOZILLA FORUMS OR THOSE EMAILS WILL BE LOST FOREVER!!!!





Here is a quickly hacked perl script to check for equal header values of "Message-ID" and "References".
This script is only to check mailboxes for mails with problematic headers. It is Thunderbird-version independent. You can run the script on any MBOX, whether it is a TB mailbox or not. The script just shows basic information about emails with equal "Message-ID" and "References" headers.

Usage:
./check.pl mailboxfilename
-or for Windows-
perl check.pl mailboxfilename

Use at your own risk!!! I do not guarantee that all hidden emails in your Thunderbird will be detected, nor do I guarantee for anything else!!!

#!/usr/bin/perl
use strict;

if (@ARGV[0] eq "") {
   print "Usage: ./check.pl mailboxfilename\n";
   exit;
}

my $MAILBOX = @ARGV[0];

=cut
Thunderbird Mailbox Checker V0.2.1 (C) 2006 www.captain.at
This script checks if there are emails with equal Message-ID AND References
values in a mailbox file.
If so, this causes serious problems in Thunderbird 1.5.0.8:
https://bugzilla.mozilla.org/show_bug.cgi?id=360409

License: GPL
Use at your own risk!

Message-ID: <CRID_bd349d3405b04bc086c5f46f73b59de2@centercode.com>
References: <CRID_bd349d3405b04bc086c5f46f73b59de2@centercode.com>
=cut

open(MAILBOX, $MAILBOX) or die("Could not open mailbox file");
my $emailstarts = 0;
my %header = ();
my $headertest = '';
foreach my $line (<MAILBOX>) {
   # check for mail start or header end
   $headertest = $line;
   $headertest =~ s/(\r|\n)//g;
   if (substr($line, 0, 7) eq "From - ") {
      $emailstarts = 1;
   }
   if ( ($headertest eq "") && ($emailstarts == 1) ) {
      $emailstarts = 0;
      checkhash(%header);
      # reset header hash
      %header = ();
   }
   # check if one of the interesting mail header values match and
   #   if so, put into hash for later use
   if (substr($line, 0, 12) eq "Message-ID: ") {
      $header{messageid} = substr($line, 12, length($line));
   }
   if (substr($line, 0, 12) eq "References: ") {
      $header{references} = substr($line, 12, length($line));
   }
   if (substr($line, 0, 9) eq "Subject: ") {
      $header{subject} = substr($line, 9, length($line));
   }
   if (substr($line, 0, 6) eq "From: ") {
      $header{from} = substr($line, 6, length($line));
   }
   if (substr($line, 0, 6) eq "Date: ") {
      $header{date} = substr($line, 6, length($line));
   }

}
# check last mail in MBOX file
checkhash(%header);
close(MAILBOX);

sub checkhash {
   my %header = @_;
   # check if Message-ID AND References are equal
   if ( ($header{messageid} eq $header{references}) && 
       ($header{messageid} ne "") ) {
      $header{messageid} =~ s/(\r|\n)//g;
      $header{date} =~ s/(\r|\n)//g;
      $header{from} =~ s/(\r|\n)//g;
      $header{subject} =~ s/(\r|\n)//g;
      print "FATAL: Message-ID=References: ".$header{messageid}."\n";
      print "   Date: ".$header{date}."\n";
      print "   From: ".$header{from}."\n";
      print "   Subject: ".$header{subject}."\n";
   }
}

Changelog:
V0.2.1: removed BASEPATH AND MAILBOX variables. New usage: ./check.pl mailboxfilename
V0.2: removed check for Resent-Message-ID since it is ignored by TB. Added detection of end of header to avoid false detections at i.e. "return receipts" where the header of the original email is attached.
V0.1: release



Last-Modified: Fri, 22 Dec 2006 08:18:45 GMT

Google
 
Web www.captain.at
go to top
© 1996-2010 . All rights reserved.
No reproduction, distribution, publishing or transmission of the copyrighted materials at this site is permitted. Policy
go to top