I have started moving away from gmail and have started exporting my older e-mails via the takeout option. This generates .mbox files. I don’t really use any e-mail clients on my computer and do most of my e-mailing on my phone, so I don’t have a way of viewing/searching those files.

Therefore I was wondering if there is any selfhosted option for some kind of e-mail archive/viewer with decent search function that anyone can recommend? Specifically something capable of handling those .mbox files. I found a few projects that sounded promising, but they seemed either dead, weren’t setup for selfhosting or could only connect directly to the mailboxes. So I thought I’d ask here if anyone has experience with this, maybe some recommendations?

Also open to alternative approaches what to do with those files. I just would like to delete these mails from gmail entirely, but that requires I can search them with as much ease as I can on gmail with a local option.

Thanks!

  • diaphragmwp@discuss.tchncs.de
    link
    fedilink
    English
    arrow-up
    3
    arrow-down
    1
    ·
    edit-2
    5 hours ago

    “GMail takeout files” aren’t a thing. mbox is a standard file format from Unix. Some Unix-likes provide the mail command and on others you have to install s-nail, after which you can do mail -f {path to mbox} to view all mail inside. If there are multiple files, you can literally just concatenate them like so: cat /somedirectory/*.mbox > theultimate.mbox.

    Apart from that, most GUI mail clients allow viewing mbox. When the mbox file updates, the client says you have new mail. For example, in Claws Mail, skip setup, then go to plugins and enable the mbox plugin (while you are there, may as well enable pgp, s/mime, calendar, dillo to handle all formats). Then, go to create new account, and in the “Basics” tab, select “local mbox file” for "Receive protocol ". It will then ask for a file path.

    Also, if your Google account settings allow, you can literally just login to Google from Claws mail. Set protocol to IMAP, then set Authentication method to Oauth2 in both Receive and Send tabs. Proceed with setup as usual and it will open your default web browser to login. After that, it will download your entire history of mail.

  • apex32@lemmy.world
    link
    fedilink
    English
    arrow-up
    10
    ·
    edit-2
    14 hours ago

    What worked for me was I installed and ran Thunderbird, then I quit and copied the Google Takeout .mbox file to ~/.thunderbird/xxxxxx.default-esr/Mail/Local Folders. When I re-launched Thunderbird, it took a few minutes and then all my Google Takeout emails were browsable/searchable under Local Folders.

    Screenshot

    Also, I think there was a weird step involved, like I needed Thunderbird to connect to some email account, any email account, in order to get past the welcome screen.

  • irmadlad@lemmy.world
    link
    fedilink
    English
    arrow-up
    8
    ·
    19 hours ago

    I don’t really use any e-mail clients on my computer

    Curious as to why. Is it a security issue or is it just not convenient…

    Thunderbird will import .mbox files but you’ll need a plugin called ImportExportTools NG.

    Import:

    • Mbox files (including structure)
    • EML & EMLX files
    • Individual or all directory files
    • gedfromgont@piefed.caOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      9 hours ago

      Not convenient. My computer is actually a docked Steamdeck I only use occasionally in Desktop mode. I know lots of people will frown at that, but I do 99% of anything I do (aside from gaming), on my phone since a long time ago. For work I have a work laptop and I surely wouldn’t want to store my mails there.

      So having Thunderbird on my Steamdeck for browsing old e-mails is just not convenient for me.

      My small homeserver is part of a backup strategy, so putting something on it reachable via a webUI of some sort will also ensure all of that is backed up. Since my Steamdeck is mostly games and many saves are stored in the cloud automatically, I don’t back it up as much, not worth the effort.

      • passenger@sopuli.xyz
        link
        fedilink
        English
        arrow-up
        1
        ·
        8 hours ago

        I would recommend pika for easy backup, steamdeck (or even a windows pc) could have problems with cloud saves. If you want real backups you should set up deduplicated archives. This means you just install pika and click a couple times. You can set it to backup over ssh. The deduplicated compressed backup is often smaller than source data size even if it has years of archives.

    • harmbugler@piefed.social
      link
      fedilink
      English
      arrow-up
      6
      ·
      14 hours ago

      A nice, simple solution of having a file and an app that can read that file. Hard to believe people are suggesting setting up a whole e-mail server to read one file.

    • emb@lemmy.world
      link
      fedilink
      English
      arrow-up
      4
      ·
      18 hours ago

      Was just recently trying to figure out how to browse my mbox backup, and wound up at the same solution.

      I’m stunned that it’s part of a plugin, and not a standard feature. Didn’t see many other actively maintained programs that made it easy either.

  • Coelacanthus@infosec.pub
    link
    fedilink
    English
    arrow-up
    2
    ·
    15 hours ago
    • You can use imapsync to sync all you mails from GMail to your new email provider if you still use email.
    • If you no longer use email, Piler is a bit heavy but well-working solution.
    • Notmuch is much lightweight but has no web UI, but if it require you install a (may be TUI) software, why not just install a mail client like Thunderbird and then just use its local mail feature to index the mbox?
      • Coelacanthus@infosec.pub
        link
        fedilink
        English
        arrow-up
        1
        ·
        4 hours ago

        if you no longer use email

        What

        I indeed have some friends who stop using email to communite with other people (Fortornately, their employer use their own communication software so they won’t lose job because of this.) because some horrible experience like spam, although they still use email for managing online accounts.

  • Cousin Mose@lemmy.hogru.ch
    link
    fedilink
    English
    arrow-up
    1
    ·
    13 hours ago

    I’d just add both Gmail and another email account to a desktop email client, then simply drag the emails from one provider to the other.

  • fatcat@discuss.tchncs.de
    link
    fedilink
    English
    arrow-up
    4
    ·
    edit-2
    10 hours ago

    Alternative approach: I imported the mails to my new mail hoster and just archived the mbox files just in case. Can be done by installing a mail client temporarily to upload or some mail hosters provide an option to import from gmail (in my case that was proton)

    • gedfromgont@piefed.caOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      9 hours ago

      If I had an e-mail provider I’d be confident staying with for the next few decades, sure. But I don’t feel confident about it and it would just move my problem with old gmail e-mails to the next provider.

      And the next provider may not have a “takeout” system. Since Proton has encryption you have to use their client? I remember hearing about Proton bridge to connect to other clients, and it was supposedly clunky.

      • fatcat@discuss.tchncs.de
        link
        fedilink
        English
        arrow-up
        1
        ·
        9 hours ago

        You don’t have to use their client (this is why I choose them over tuta) they provide a imap bridge (separate program to be installed locally). Works fine for me for the last few years. Just have to use their client on mobile but it works well enough.

    • mjr@infosec.pub
      link
      fedilink
      English
      arrow-up
      1
      arrow-down
      4
      ·
      19 hours ago

      (in my case that was proton)

      Doesn’t that fund Trump?

      • fatcat@discuss.tchncs.de
        link
        fedilink
        English
        arrow-up
        1
        ·
        10 hours ago

        I think the post was very naive but not actually a “I endorse everything what trump does” post. No one can know for sure but alternatives to proton are sparse and I didn’t see anything else like that after.

      • roofuskit@lemmy.world
        link
        fedilink
        English
        arrow-up
        5
        ·
        18 hours ago

        No, but the founder naively praised Trump for an executive branch nomination he thought would play out in his favor. I don’t think it was a month later when Trump made it obvious he was just going to sell his entire administration to the big powerful tech bros. The Proton founder should have known better and just looked like an idiot, or worse a supporter, for praising Trump.

  • curbstickle_lw@lemmy.worldM
    link
    fedilink
    English
    arrow-up
    4
    arrow-down
    1
    ·
    20 hours ago

    My suggestion would be to stand up a mail server (that doesn’t really do anything) and bring your mail over there. Then add the account on your phone, and you’ve got email now searchable like any other.

    • gedfromgont@piefed.caOP
      link
      fedilink
      English
      arrow-up
      4
      ·
      19 hours ago

      Would that be simple to do though? Hope I am not starting yet another discussion thread about selfhosting e-mail, I know there are different views how hard/easy it is. I guess here its restricted to just the viewing part, which is maybe the easier bit.

      Downside I see for this, I’d like to also be able to access this on my computer, where I use webmail only. So I got no client set up. Yes, can of course do this just for that use case, but its again something extra I don’t need otherwise. Also, on the phone I use Thunderbird, it seems to have an atrocious search function. So that wouldn’t feel great to use either.

      But definitely a valid idea I didn’t consider, thanks!

      • curbstickle_lw@lemmy.worldM
        link
        fedilink
        English
        arrow-up
        6
        ·
        19 hours ago

        The hard part is making sure your email server works with others.

        Standing up an email server that is otherwise inactive aside from login? Perfectly easy, no send involved.

      • mbirth 🇬🇧@lemmy.ml
        link
        fedilink
        English
        arrow-up
        6
        ·
        edit-2
        17 hours ago

        dovecot/dovecot and solr should do the trick. At least they do for me.

        EDIT: Two advantages of this setup for me: I can easily drag&drop emails from my other email accounts to this “archive” account in Thunderbird. And once I want to “seal” an archive folder, I can gzip the underlying mbox file and make it read-only (dovecot needs to be configured to store mails in mbox files).

  • hexagonwin@lemmy.today
    link
    fedilink
    English
    arrow-up
    1
    ·
    19 hours ago

    there’s few old scripts (mostly for mailing list archive usage) that takes mbox input and outputs html. not pretty but they could work in this case. searching is another issue though

  • adarza@lemmy.ca
    link
    fedilink
    English
    arrow-up
    1
    ·
    19 hours ago

    it’s not FOSS (it is ‘free to use’ at home) or a ‘server’ application (it’s a windows application), but i just use mailstore home to create and update a local archive of a gmail account. its dot.net requirement is minimal (v4.8 or higher) but i have not yet tried to run it with wine, as i have a separate box that runs windows stuff.

    https://www.mailstore.com/de/produkte/mailstore-home/
    https://www.mailstore.com/en/products/mailstore-home/