this post was submitted on 19 Jul 2026
59 points (98.4% liked)

Selfhosted

60789 readers
441 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

Detailed Rules Post

  1. Be civil.

  2. No spam.

  3. Posts are to be related to self-hosting.

  4. Don't duplicate the full text of your blog or readme if you're providing a link.

  5. Submission headline should match the article title.

  6. No trolling.

  7. Promotion posts require active participation, with an account that is at least 30 days old. F/LOSS without a paywall has exceptions, with requirements. See the rules link for details. Tags [CBH] or [AIP] are required, see the links in Rule 8 for details.

  8. AI-related discussions and AI-involved promotional posts have additional requirements for tagging, as noted in Rule 7 and the AI & Promotional Post Expanded Rules post, and find example disclosures here.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 3 years ago
MODERATORS
 

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!

top 34 comments
sorted by: hot top controversial new old
[–] diaphragmwp@discuss.tchncs.de 2 points 5 hours ago* (last edited 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 10 points 14 hours ago* (last edited 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.

[–] nixx@lemmy.ca 24 points 19 hours ago (4 children)
[–] gedfromgont@piefed.ca 2 points 9 hours ago

Well this is it! Thanks, didn't find that in my initial search.

[–] rhelawyn@lemmy.world 4 points 18 hours ago* (last edited 18 hours ago)

This looks amazing

Also supports importing .mbox apparently

[–] hellmo_luciferrari@lemmy.zip 2 points 17 hours ago

This looks promising. Saving for later! Thank you

[–] roofuskit@lemmy.world 1 points 18 hours ago

I also use Bichon and its great.

[–] atzanteol@sh.itjust.works 1 points 10 hours ago

You could just install dovecot and search over imap or pop3 from any email client.

[–] irmadlad@lemmy.world 8 points 19 hours ago* (last edited 19 hours ago) (3 children)

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.ca 3 points 9 hours ago (2 children)

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.

[–] irmadlad@lemmy.world 1 points 13 minutes ago

OK That's cool. Didn't know what your set up was like. So, scratch ~~Thunderbird~~. LOL

[–] passenger@sopuli.xyz 1 points 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 6 points 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 4 points 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.

[–] arran4@aussie.zone 1 points 13 hours ago

A friend uses: https://github.com/LogicLabs-OU/OpenArchiver

Also I have been meaning to release the one I've been working on so I won't mention more about that.

[–] Coelacanthus@infosec.pub 2 points 15 hours ago (1 children)
  • 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?
[–] ryannathans@aussie.zone 3 points 12 hours ago (1 children)

if you no longer use email

What

[–] Coelacanthus@infosec.pub 1 points 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.

[–] undefined@lemmy.hogru.ch 1 points 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 4 points 19 hours ago* (last edited 9 hours ago) (2 children)

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.ca 2 points 9 hours ago (1 children)

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 1 points 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 -4 points 19 hours ago (3 children)

(in my case that was proton)

Doesn't that fund Trump?

[–] fatcat@discuss.tchncs.de 1 points 10 hours ago (1 children)

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.

[–] mjr@infosec.pub 1 points 5 hours ago
[–] roofuskit@lemmy.world 5 points 18 hours ago* (last edited 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.world 3 points 20 hours ago (2 children)

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.ca 4 points 19 hours ago (2 children)

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.world 6 points 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 6 points 19 hours ago* (last edited 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).

[–] hperrin@lemmy.ca 2 points 19 hours ago

This is the best solution.

[–] hexagonwin@lemmy.today 1 points 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 1 points 19 hours ago* (last edited 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.

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