Not sure if there’s a pre-existing solution to this, so I figured I’d just ask to save myself some trouble. I’m running out of space in my Gmail account and switching email providers isn’t something I’m interested in. I don’t want to pay for Google Drive and I already self-host a ton of other things, so I’m wondering if there is a way to basically offload the storage for the account.

It’s been like 2 decades since I set up an email server, but it’s possible to have an email client download all the messages from Gmail and remove them from the server. I would like to set up a service on my servers to do that and then act as mail server for my clients. Gmail would still be the outgoing relay and the always-on remote mailbox, but emails would eventually be stored locally where I have plenty of space.

All my clients are VPN’d together with Tailscale, so the lack of external access is not an issue. I’m sure I could slap something roughshod together with Linux packages but if there’s a good application for doing this out there already, I’d rather use it and save some time.

Any suggestions? I run all my other stuff in Kubernetes, so if there’s one with a Helm chart already I’d prefer it. Not opposed to rolling my own image if needed though.

  • TCB13@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 month ago

    it’s possible to have an email client download all the messages from Gmail and remove them from the server. I would like to set up a service on my servers to do that and then act as mail server for my clients. Gmail would still be the outgoing relay and the always-on remote mailbox, but emails would eventually be stored locally where I have plenty of space.

    Do you really need this extra server? Why not just configure the account on Thunderbird and move the older / archival mail to a local folder? Or even drag and drop it out of Thunderbird to a folder and store the resulting files somewhere?

    I’m just asking this because most people won’t need regular access to very old email and just storing the files on a NAS or something makes it easier.

  • Darkassassin07@lemmy.ca
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    1 month ago

    Bit of a different solution:

    If Paperless-NGX is one of the things you self-host; it has options to import emails based on your specified criteria, then you could have it delete each piece of mail it imports. You can also just have it move mail to folders on the mail server, or just tag/flag mail instead of deleting it. (for you to then manually delete at your leisure)

    I use this to automatically import receipts, bills, work documents, and any other regular mail instead of dealing with it manually every week/month.

  • Fedditor385@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    1 month ago

    I think there is a possibility to have a local client using Gmail, with a rule set to delete mails on Gmail as soon as they are synced locally. So in this case Gmail would be nothing more than a relay/proxy, while your mails would actually be offline.

    • seaQueue@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 month ago

      You can access Gmail over IMAP and pull down messages locally. If you do this; Back. Up. Your. Mbox.

      Also, fun fact, you can move messages from a local mbox to Gmail while preserving read status and original dates if you want to add old email to Gmail for some reason.