I'm not sure if Thunderbird stores the local copies as SQLite databases or the weirdo Mozilla internal format (Mork, more comments by jwz). According to some random comments on the internet, global-messages-db.sqlite in your profile directory is the index into all the (local) messages, so you might get by with running the SQL against that file (DBD::SQLite and/or my DBIx::RunSQL).

If you are lucky, getting the results is merely running the SQL query against the SQLite database in the INBOX file (which might be an SQLite database).

If you are unlucky, you need to read/import the Mork format into SQLite to then run the SQL query against that.

If you are adventurous, you can try to create a converter from SQL to IMAP queries to run the search query directly on the remote IMAP server, but I think that's the approach least likely to be successful.

Update:

Having looked at the .msf files, they seem to contain maybe IMAP queries, but certainly not SQL.

On the other hand, the global-messages-db.sqlite file in your profile contains basically a copy of all mails as a cache for Thunderbird.

I would look at querying that SQLite file. You might want to maybe find out how to make SQLite ignore locks on the sqlite database so that you can read it while Thunderbird is still running.


In reply to Re: Get saved search data out of Thunderbird and into plain-text file by Corion
in thread Get saved search data out of Thunderbird and into plain-text file by jkeenan1

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.