Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: 13.10 - Juno email extractor

  1. #1
    squakie is offline Chocolate-Covered Ubuntu Beans
    Join Date
    Oct 2012
    Beans
    2,238
    Distro
    Ubuntu 14.04 Trusty Tahr

    13.10 - Juno email extractor

    My brother-inlaw has been using Juno email for years and has a LOT of email and attachments stored on his computer via the Juno software in Windows 7. He is having problems with Juno now and would like to just extract all the email, folders, attachments, etc., from his locally stored Juno data so he can bring it into another email client.

    I'm not having much luck finding a Windows based tool for him, so I thought I would post here to see if anyone knows of such a tool for Linux that I might be able to use on my Ubuntu boxes. I think I read somewhere that it might be a "Berkely" database of some sort, but I have NO clue.

    I would like to get him converted to Ubuntu for everything he does on his PC, and such a tool would be a big step forward on that.

    Thanks for any input!

  2. #2
    Join Date
    Oct 2011
    Location
    Galiza
    Beans
    968
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: 13.10 - Juno email extractor

    Someone wrote this https://gist.github.com/endolith/997075
    ... a long time ago. Probably not working if they change the db format meanwhile.
    Galiza Nação!

  3. #3
    squakie is offline Chocolate-Covered Ubuntu Beans
    Join Date
    Oct 2012
    Beans
    2,238
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: 13.10 - Juno email extractor

    Thanks! I don't know about the format either. I'm tempted to try command line SQL and see if it will show the tables just so I can see what's there. I noticed the link is .py - am I correct in thinking that is a python module? If so, I'll have to learn how to do it since I don't know python at all.

    Thanks again!

  4. #4
    Join Date
    Oct 2011
    Location
    Galiza
    Beans
    968
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: 13.10 - Juno email extractor

    Yes, it probably is but then you already know more than I do so... Perhaps some real expert can join the discussion?...

    Meanwhile why don't you try to contact the author? Worse case scenario he/she won't reply...
    Galiza Nação!

  5. #5
    Join Date
    Apr 2005
    Location
    EU - UK
    Beans
    3,303
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: 13.10 - Juno email extractor

    I've made some slight changes, so you can now easily provide the folder path as an argument (where the juno file is in), thus if you save the code in a file as e.g. juno_mail_extractor.py, you can run it like this
    Code:
    python ./juno_mail_extractor.py path_to_folder
    or if you make it executable, just
    Code:
    ./juno_mail_extractor.py path_to_folder
    (or just ./juno_mail_extractor path_to_folder if you remove the .py extension altogether)

    Code:
    #! /usr/bin/python
    # -*- coding: utf-8 -*-
    """
    Created on Sat May 28 09:53:24 2011
     
    @author: endolith@gmail.com
    """
     
    import mailbox
    import OleFileIO_PL
    from collections import defaultdict
    import sys
    import os.path
    
    if len(sys.argv) == 1:
        print >> sys.stderr, "You need to provide the paths to the folder"
        sys.exit(1)
    
    filename = os.path.expanduser(sys.argv[1])
     
    def frm_to_dict(filename):
        source = OleFileIO_PL.OleFileIO(filename + '.frm')
        messages = defaultdict(dict)
        for file in source.listdir():
            if len(file) == 2: # Messages, not 'Directory'
                msg_num = int(file[0])
                msg_type = file[1]
                stream = source.openstream(file).readlines()
                messages[msg_num].update({msg_type: stream})
        return messages
     
    def dict_to_mbox(messages, filename):
        destination = mailbox.mbox(filename + '.mbox')
        for msg_num, streams in messages.iteritems():
            content = streams['Header'] + streams['Body']
            content = ''.join(content)
            message = mailbox.mboxMessage(content)
            destination.add(message)
        destination.close()
     
    messages = frm_to_dict(filename)
    dict_to_mbox(messages, filename)
    print "Operation completed, and it was probably successfull"
    You probably need to download the OleFileIO_PL module from here. You don't need to install it, but you can extract it and then just place your juno_mail_extractor.py file in the same folder as the module files and call it from there.

    Hope that helps.

    EDIT: sorry I meant the folder path, not the file path..
    Last edited by kostkon; February 23rd, 2014 at 09:16 AM.

  6. #6
    squakie is offline Chocolate-Covered Ubuntu Beans
    Join Date
    Oct 2012
    Beans
    2,238
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: 13.10 - Juno email extractor

    Thank you very much! I'm going to copy the folder that has the email and bring the copy to one of my Ubuntu boxes and test it out. If things work out like I hope it will be great!!

  7. #7
    Join Date
    Apr 2005
    Location
    EU - UK
    Beans
    3,303
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: 13.10 - Juno email extractor

    Sorry, it's not gonna work, that's what happens when you add stuff without checking what the rest of the code is doing; here is the fixed version:
    Code:
    #! /usr/bin/python
    # -*- coding: utf-8 -*-
    """
    Created on Sat May 28 09:53:24 2011
     
    @author: endolith@gmail.com
    """
     
    import mailbox
    import OleFileIO_PL
    from collections import defaultdict
    import sys
    import os.path
    
    if len(sys.argv) < 3:
        print >> sys.stderr, "You need to provide the input and output file paths"
        sys.exit(1)
    
    input_file = os.path.expanduser(sys.argv[1])
    out_file = os.path.expanduser(sys.argv[2])
     
    def frm_to_dict(filename):
        source = OleFileIO_PL.OleFileIO(filename)
        messages = defaultdict(dict)
        for file in source.listdir():
            if len(file) == 2: # Messages, not 'Directory'
                msg_num = int(file[0])
                msg_type = file[1]
                stream = source.openstream(file).readlines()
                messages[msg_num].update({msg_type: stream})
        return messages
     
    def dict_to_mbox(messages, filename):
        destination = mailbox.mbox(filename + '.mbox')
        for msg_num, streams in messages.iteritems():
            content = streams['Header'] + streams['Body']
            content = ''.join(content)
            message = mailbox.mboxMessage(content)
            destination.add(message)
        destination.close()
     
    messages = frm_to_dict(input_file)
    dict_to_mbox(messages, out_file)
    print "Operation completed, and it was probably successfull"
    You can run it like this:
    Code:
    ./juno_mail_extractor.py path_to_my_juno_mbox.frm_file path_to_output_mbox_file
    Sorry about that

  8. #8
    squakie is offline Chocolate-Covered Ubuntu Beans
    Join Date
    Oct 2012
    Beans
    2,238
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: 13.10 - Juno email extractor

    Not a problem! And thanks again! I won't be getting to it until later tonight. One question - does it handle the attachments?

    Thanks!!!
    Dave

  9. #9
    squakie is offline Chocolate-Covered Ubuntu Beans
    Join Date
    Oct 2012
    Beans
    2,238
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: 13.10 - Juno email extractor

    Well, I tried this tonight. It ran very quickly and there is nothing in the output.

    I tried another Windows based tool that seemed to work, however it appears that the desktop item he is using to start his Juno is running from a folder where I don't see any mail at all. The mail I picked up was from another folder and nothing there is newer than 2011.

    Not sure where to go from here. Right now he can't get on the net via Juno because of this, and if you rty to use internet explorer it comes up with some error saying it can't open some page - and that page name is part of what I see being removed from the Windows registry when you remove a backup tool/virus that he somehow managed to load. I removed the program itself and have a complete McAfee scan running (the thing is EXTREMELY SLOW!!). Sites on the net recommend a five-tier approach to getting rid of it all! A little hard to do when you can't get on the net in the first place to download some of the tools.

    So, a side question: can I download a full version of Firefox for Windows and also Thunderbird on one of my Linux boxes then copy to the Windows box (probably using a flash drive)? Seems like that should be possible, but I don't know if the install for Firefox would be a small file that then downloads the entire thing or if it is complete.

    Any ideas on both of these issues is greatly appreciated!

  10. #10
    squakie is offline Chocolate-Covered Ubuntu Beans
    Join Date
    Oct 2012
    Beans
    2,238
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: 13.10 - Juno email extractor

    Well, ended up using a Windows-based tool to extract the mail and attachments from the database files. Was able to load them to Thunderbird as local folders, then drag them to the gmail online and it seems to work. One last, and kind of a pita, is trying to convert the dang address book. Might be easy (or perhaps easier?) if I could get Juno to start on the PC, but it still gets stuck in the mail problem, so I can't get into it. So far my brother in-law prefers using Windows so at least the other parts are working in Internet Explorer and gmail. Now if I can just figure out how to convert the .nv file that is the address book. I hope it doesn't come down to me writing a program, but it could be worse - at least I can read the thing!

    Going to mark this as solved - no Linux tool to get into the Berkely Database that is the mail, at I couldn't get it to extract any email.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •