10 Replies Latest reply: Sep 3, 2009 9:13 AM by Acqua
Acqua Level 1 Level 1 (0 points)
I need to search words within archived mailboxes (.mbox files created with Mail 3.6). Spotlight seems unable to do searches there. Any help or solution will be most welcomed

MacBook Pro, Mac OS X (10.5.8)
  • V.K. Level 9 Level 9 (56,130 points)
    Acqua wrote:
    I need to search words within archived mailboxes (.mbox files created with Mail 3.6). Spotlight seems unable to do searches there.


    that's right and you can't make it search there. the only way to make a searchable archive that I know of is the following.

    put the messages you want to archive in a local mailbox in "On my mac". now go to /users/username/Library/Mail/Mailboxes and copy the mailbox folder corresponding to the mailbox you've just made to a convenient location. You can now delete the mailbox you've made from inside Mail (not from finder) if you like. Spotlight will still search messages in the backup folder in the usual way and you'll be able to open those messages in Mail. also, if you need to you can import the .mbox folder back into Mail.

    Message was edited by: V.K.
  • Acqua Level 1 Level 1 (0 points)
    Thank you very much, V.K., for your prompt reply.

    Since I already have many archived mailboxes in a folder within Documents in the Finder, I made a copy of that folder (named it "Mail archives copy 020909" to make sure that I can locate it easily) and put it in /username/Library/Mail/Mailboxes. I am afraid Spotlight still does not search there; it just searches on mailboxes currently "ON MY MAC".
  • V.K. Level 9 Level 9 (56,130 points)
    don't put it anywhere in your Library folder. regular spotlights searches don't look there. put it somewhere else like your documents folder.
  • Acqua Level 1 Level 1 (0 points)
    This is precisely what I have: within the Documents folder I have a folder named Mail Archives full of .mbox files. It is within these files I need to search words.

    So far, the only way I manage to do searches in archived mailboxes is by importing them all into Mail and keeping them "ON MY MAC". (I hardly see the logic of archiving mailboxes if they are almost unavailable).
  • V.K. Level 9 Level 9 (56,130 points)
    you said that you put it in /username/Library/Mail/Mailboxes. that's not a good place and won't be searched by spotlight by default. do you mean you put it there and ALSO in Documents?
  • Acqua Level 1 Level 1 (0 points)
    Yes. I have all archived mailboxes in a folder within Documents (where Spotlight does not search; this is my problem). When you advised to put the files in /username/Library/Mail/Mailboxes I made a copy of that Documents folder, gave it another name by adding the date, and put it in /username/Library/Mail/Mailboxes. Again Spotlight did not retrieve any words from the archived mailboxes.

    I observed that, while I had that folder in .../Mailboxes, a white folder was present ON MY MAC in Mail with the name of the folder I had placed in .../Mailboxex, but it was empty, no messages could be read (I imagine because I had not imported them correctly in Mail).
  • V.K. Level 9 Level 9 (56,130 points)
    you got it all backwards. I did not tell you to put any files in /username/Library/Mail/Mailboxes. I told you to copy files FROM there. please reread my original post and follow the instructions carefully.
  • Acqua Level 1 Level 1 (0 points)
    Thank you so much, V.K. This time I got it right. Since I had the mailboxes archived I had to import them before following your advice precisely. Now Spotlight does search in the Documents mbox files copied there from the Username/Library/Mail/Mailboxes folder.

    (The odd thing is that now I have two folders in Documents, with lists of .mbox files that look alike and Spotlight just seems to see one of them!)
  • V.K. Level 9 Level 9 (56,130 points)
    (The odd thing is that now I have two folders in Documents, with lists of .mbox files that look alike and Spotlight just seems to see one of them!)

    they are not actually alike. one is a regular text file. the other is a folder not a file containing .emlx files with messages. you can open it and see what's inside. that's the one that spotlight can search.
  • Acqua Level 1 Level 1 (0 points)
    Yes! I had just looked at the .mbox lists; when opening them I saw the differences you mention. Thank you very much again!