Jesus 'n Jim
A mainly PC (some Mac) site w/Software, Computer Repair Info, How-To's on Using Computers
Technical Support 1-360-521-2060 (my business line cell)

tbirdmailsplit (C,win) - thunderbird inbox 2GB limit fix/inbox splitter

 

Autoit3, MinGW compiled executables with sources [auto-it3 32+64bit, windows 32+64-bit]).

can't open your inbox anymore or Thunderbird acting weird or strange because you reached the 2GiB limit? Compacting will not help.

I did google "thunderbird inbox 2GB" and came up with this:

http://www.thejackol.com/2004/10/29/mozilla-thunderbird/  (probably won't help)
http://kb.mozillazine.org/Talk:Limits_-_Thunderbird (mozilla "support" must have had a bad day) (always had a 2GB limit)
http://kb.mozillazine.org/Limits_(Thunderbird)  (helps tremendously)
http://blogostuff.blogspot.com/2005/05/mozilla-thunderbird-inbox-size-limit.html ( how to resolve the problem in the future)

yes, there is a 2GB inbox limit, including folders under inbox, but apparently you can split them out to folders under local folders.

one thing you can do is

1. save C:\Documents and Settings\Jim\Application Data\Thunderbird\Profiles\kbtvp0kd.default\Mail\mymailboxname\Inbox  (substitue your mailbox name)
safe somewhere else when Mozilla gets their bug fixed.  In other words, make a backup in case you make a mistake!
2. edit the Inbox file with Notpad.  it is in mbox format (text).  normal email text format.  you must understand email headers to know where they start and end.  this is where your old programming skills will come in handy. Unfortunately, you will probably run into your limit of virtual memory just opening the file, let alone using the clipboard.
Unlike Outlook Express' .DBX format (and 2GB limit), this Inbox's 2GB limit is fixable!
3. watch those mail boundaries on files with MIME-encoded (long block of garbage) attachments!  they look something like
---------402789db4027a1da402789db4027a1da--
you are told about these boundaries at the top of the email. look for them and write them down or copy them in a separate notepad.
mail will end with at least 1 maybe 2 empty blank line (usually). They start with From - and then a date.
an email can contain headers, boundaries, plain text, blank line separators, attachments *and* html.  study a few to see where they end and start.
4. save 1/2 or minimum possible in C:\Documents and Settings\Jim\Application Data\Thunderbird\Profiles\kbtvp0kd.default\Mail\Local Folders\Inbox

best solution

use tbirdmailsplitGUI.
with thunderbird not running,

1. delete your Inbox file or whatever files are inching at 2GB (if nothing is really that important)
2. delete your Inbox.mpf or whatever .mpf file that is associated with it.

the best thing you can do is

As an alternative to the above steps [which don't work real well] (memory requirements) is this setup file which includes source and .EXE (the zip includes all the source and build batch files). It is under the GPL3 license. lsm file.

Downloads

Download Now
tbirdmailsplit-2.5-setup.exe (version 2.6, 6/4/2011)


Download Now
tbirdmailsplit.zip (version 2.6, 6/4/2011)


06/04/2011  11:30 PM         5,493,534 tbmailsplit-2.6-setup.exe
06/04/2011  11:31 PM        10,687,570 tbirdmailsplit.zip

%%%% HASHDEEP-1.0
%%%% size,md5,sha1,sha256,filename
## Invoked from: C:\prj\tbirdmailsplit
## C : \ >  hashdeep -c md5,sha1,sha256 tbmailsplit-2.6-setup.exe tbirdmailsplit.zip
##
5493534,426f1674d4462a78033dcb23bf99b670,6cd6001347e567911a8798a1b330e20124dc613b,39943a445af4a31321ba87e48b81cdffdea74efba5a5870cadf975bab6b1b46d,C:\prj\tbirdm
ailsplit\tbmailsplit-2.6-setup.exe
10687570,f47144aaf03155d12ee350cdd93ffaba,071d19e78b0fdbf3bdad69db1d1ccbdf1e615a89,2d0f4f526c47b156945c6c016164456e289ad8fbdf10513af3345d899f7ad554,C:\prj\tbird
mailsplit\tbirdmailsplit.zip

It will take a little work, but your inbox is worth it, isn't it?

license

Author: Jim Michaels
Creation date : June 22, 2008
Abstract: split a thunderbird mailbox/Inbox file into 2 parts at a split
point. determine number of emails, examine inbox content.

Copyright(c) 2008 Jim Michaels

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.

Manual

filled up your thunderbird inbox and now tbird won't open it?

This program applies to Sent, Trash, Inbox, Drafts, and any other mail folders which you might have - each must be done separately.


lockups doing the same?
you have probably hit the 2GB mailbox limit.

This program is written as an alternative to manual file editing with a programmer's editor. essentially, you need to move your mail into a Local Folder (not a folder underneath Inbox).

I think someone must have been praying for a solution. so here it is. with an update that made it much easier to use.

This should work with Thunderbird 2.x. I have not tested with Thunderbird 3.x, but I don't think Thunderbird is going to change the format of their mailbox any time soon. I did base the reading of the profile.ini off of 3.x.

GUI version

see help. make a copy of your inbox first. split operation is non-reverseable. you basically only need the infile and the number of splits you want. the program has been greaqtly simplified and updated. it now automatically deletes the .msf file for you, so you don't have to think about it.

tip: if you want to make sure the 2GB limit doesn't happen anytime soon, you should break it up into numbers like 50-200. you can even number the filenames if you want. you can always rename them later. each split, your input file will be the last output file you made. make sense? what you are doing is splitting off small chunks from one big main file into multiple files.

command-shell version

tbirdmailsplit - split a Thunderbird mailbox folder/Inbox file in 2-n pieces.
usage:
   tbirdmailsplit [-o[ut[put]]|/o[ut[put]] filepath] [/?|-[-]?|-[-]h[elp]|/h[elp]] [-[-]v[er[sion]]|/v[er[sion]]]
   tbirdmailsplit [-o[ut[put]]|/o[ut[put]] filepath] [-[-]]head infilepath
   tbirdmailsplit [-o[ut[put]]|/o[ut[put]] filepath] [-[-]]count infilepath
   tbirdmailsplit [-o[ut[put]]|/o[ut[put]] filepath] [-[-]]split infilepath integer64NumSplits
-?, -h, -help, --help gives this help.
-v, -version, gives the version number.
--output must precede everything else if you use it. 
it redirects output from screen to the file filepath.
--head shows the first 10 lines of infilepath, 
which must be in Thunderbird readable mbox format.
--count shows a count of the number of emails in infilepath,
 which must be in Thunderbird readable mbox format.
--split splits the file infilepath into integer64NumSplits pieces
 and deletes your associated infilepath.msf file after the split
  so Thunderbird can rebuild its summaries file, according to a
   Thunderbird KB article (.msf). infilepath must be in
    Thunderbird readable mbox format.
Integer64 splitpoint number is case insensitive.  it can be
 hexadecimal (start with 0x), decimal (plain number or start with
  0d), octal (start with 0, 0q, 0o), binary (start with 0b), and
   can be appended with SI units (_B _D _DB _H _HB _K _KB _M _MB
    _G _GB _T _TB _P _PB _E _EB) or computer units (_Ki _KiB _Mi
     _MiB _Gi _GiB _Ti _TiB _Pi _PiB _Ei _EiB)  as a multiplier
      suffix.
This program applies to Sent, Trash, Inbox, Drafts, and any other
 mail folders which you might have - each must be done separately.
Example:   tbirdmailsplit --count infile
    counts the number of emails in the file infile.
Example:   tbirdmailsplit --split "C:\Documents and Settings\JimApplication Data\Thunderbird\Profiles\kbtvp0kd.default\Mail\comcast\Inbox" 200
    splits Inbox into 200 pieces.
Example:   tbirdmailsplit --split c:    infile 200
    moves the emails starting with message number 1_M (1 Meg or million) splitting c:\t\infile.
Example:   tbirdmailsplit --output f --split infile 20_K
    moves the emails starting with message number 20_k splitting infile into 20,000 pieces. screen output is redirected to file f.
Copyright 2008 Jim Michaels. Under GPL3 License.

The *first* thing you should do is make a backup of your questionable
mailbox file. if something goes wrong, you can always copy it back in place.

start with a CMD shell. (Start|Run|cmd) if you are on win98/me, run command.

C:\Documents and Settings\Jim>cd "C:\Documents and Settings\Jim\Application Data\Thunderbird\Profiles\kbtvp0kd.default\Mail\mail.copper.net"

[your mail folder is going to be in a different directory because you
probably don't have the username Jim and you won't have the same unique
kbtvp0kd.default folder as mine]

C:\Documents and Settings\Jim\Application Data\Thunderbird\Profiles\kbtvp0kd.def
ault\Mail\mail.copper.net>mkdir c:\mail.copper.net.backup

C:\Documents and Settings\Jim\Application Data\Thunderbird\Profiles\kbtvp0kd.def
ault\Mail\mail.copper.net>copy Inbox c:\mail.copper.net.backup

[now we have a backup of our questionable mailbox folder. let's see if
it is in a format we can process.]

C:\Documents and Settings\Jim\Application Data\Thunderbird\Profiles\kbtvp0kd.def
ault\Mail\mail.copper.net>tbirdmailsplit head Inbox
From - Thu Nov 09 13:36:06 2006
X-Account-Key: account5
X-UIDL: 20061109213549m1100brtfde000001
X-Mozilla-Status: 0009
X-Mozilla-Status2: 00000000
Received: from [127.0.0.1] (c-24-20-110-103.hsd1.wa.comcast.net[24.20.110.103])
by comcast.net (rwcrmhc11) with ESMTP
id <20061109213549m1100ne9v1e>; Thu, 9 Nov 2006 21:35:49 +0000
Message-ID: <45539F2C.9070803@comcast.net>
Date: Thu, 09 Nov 2006 13:35:40 -0800

[this is just like using the head command in UNIX. gives you the first
10 lines of the file. except in this case, the first argument is the
filename and the next argument is the command "head".
If the output of the head command looks like what you see above, then
it should be safe to run tbirdmailsplit on your mailbox with your newer
version of thunderbird (but I am not going to guarantee anything because
I don't write the thunderbird standards - the only time they might
change is if they go to version 3.0 - maybe - I still don't think they
are going to change the majority of their codebase).]

bring up a cmd shell. [windows-logo-flag-key]-R cmd [Enter]
cd "c:\program files\ThunderbirdMailSplit"
tbirdmailsplit --head "C:\Documents and Settings\Jim\Application Data\Thunderbird\Profiles\kbtvp0kd.default\Mail\Local Folders\Inbox"
[if you get mail headers, it is OK.  find out how many messages are in it.]

tbirdmailsplit --split "C:\Documents and Settings\Jim\Application Data\Thunderbird\Profiles\kbtvp0kd.default\Mail\mail.copper.net\Inbox" 50
please wait for count (can be up to 30 minutes)...
1062 emails
please wait for split...
"C:\Documents and Settings\Jim\Application Data\Thunderbird\Profiles\kbtvp0kd.default\Mail\mail.copper.net\Inbox.msf" deleted.  This is a required step, so that thunderbird will rebuild its indexes, or summaries will not work right. deleting the .msf file will allow Thunderbird to rebuild the summaries (according to a Thunderbird KB article).
done.

To be honest, I really recommend you prune your email much further back, especially if you get a lot of big emails like .wmv or .mpg videos or powerpoints. those can be about 5MB each.

Performance statistics

Performance Testing was performed using a 2,382,611,584 byte inbox, which is exactly 128 times the original size of the original 18MB file. the file is about 200MB over the size of the 2.1GB (2GiB) inbox you will probably have.

testing was performed on a Pentium 4 HT (1 core, 2 threads) 2.8GHz with 3GiB RAM and 2TB 7200RPM hard drive running XP Pro SP3 32-bit. doesn't matter about multiple threads, since this is a single-threaded process anyway.

The computer was busy doing other things while it was processing this stuff, I don't let my computer sit around for 5 hours doing nothing, but for the 200 test it sat overnight.

Results:

  • it takes 0 days, 05:35:01.594 (roughly 5 1/2 hours) to split a 2.3GB inbox in 50 pieces, and it found 104064 emails.
  • it takes 0 days, 06:06:30.109 (roughly 6 hours) to split a 2.3GB inbox in 200 pieces, and it found 104064 emails.
  • it takes 0 days, 01:19:42.906 (roughly 1 1/2 hours) to count a 2.3GB inbox, and it found 104064 emails.

The time to execute varied between 3 hours 40 minutes to 5 hours 35 minutes depending on how busy the computer was.

because my emails are personal, I am not going to include them as test files in this package. you can use your own inbox. I have included double.cmd so you can double and re-double your own inbox so it's the size you need to test with. Due to the mbox format, you can do this safely.

Because it takes so long to run, it's best to run this overnight when you are not using the computer. I am sorry it's not faster. I had thought this version would be faster than the others, but it is not. When mingw-w64 starts including the 64-bit stdio functions from Microsoft, then I will see about using those instead of my own functions, maybe they are faster. I can't use the standard 32-bit C library functions because ftell and fseek do not give proper results, however, that was the old version of this program, and now I have newer requirements and I don't think I need ftell and fseek anymore. I would need to look at th4e program again as a whole, which means another 2-4 days.

Programs for other clients (Outlook, Outlook Express)

Outlook 2GB Inbox repair: Outlook pst 2gb repair for earlier versions of outlook (2003)

SplitPST Outlook PST splitter for soving the 2GB inbox problem. $49 personal $129 business

Outlook PST Compress but don't compress corrupt PST files.

Advanced Outlook Express Repair 2.1 $49.95

Recovery Toolbox for Outlook Express 1.1.9 $27. users say well worth it for recovering emails after the 2GB limit.

Windows Mail 2GB limit? no. post, microsoft mvp article

Screenshots

main window
help
how thunderbird looks afterward