30
submitted 2 years ago by giddy@aussie.zone to c/selfhosted@lemmy.world

Hey all,

I have given up hope of hosting my own mail server but was hoping for one that would serve as an archive -

  • downloads new emails via IMAP from my mail provider on a regular basis
  • allows my mail clients to connect via IMAP to view and search emails

Any suggestions for a docker solution for this?

Thanks

top 9 comments
sorted by: hot top controversial new old
[-] lnxtx@feddit.nl 6 points 2 years ago

I think imapsync will fulfill your needs.

[-] Dunstabzugshaubitze@feddit.org 5 points 2 years ago

https://github.com/docker-mailserver/docker-mailserver should be able to do it.

if i remember this in 6 weeks i'll check the setup at work.

[-] Diplomjodler3@lemmy.world 1 points 2 years ago

Paperless-ngx might be worth a look. Probably overkill if you just want to store mails but great for general purpose document management.

[-] werefreeatlast@lemmy.world 1 points 2 years ago

This sounds like what I want. Did you make it work or are you still working on your PhD dissertation to qualify for email server setup training like me? 😕

[-] BennyInc@feddit.org 1 points 2 years ago

Piggybacking on this question: any solution that provides really good indexing on those local mails, for fast wildcard searching?

[-] tvcvt@lemmy.ml 4 points 2 years ago

I can’t give direct experience here, but this is exactly the use case I’ve been meaning to spin up mailpiler for: https://www.mailpiler.org/. One of these days that will rise to the top of the priority list.

[-] budric@lemmy.world 2 points 2 years ago

Notmuch indexes and lets you tag things. You usually integrate it with emacs as the front end but its usable on it's own.

https://wiki.archlinux.org/title/Notmuch

[-] conrad82@lemmy.world 1 points 2 years ago

I use dovecot for this. And thunderbird to actually move/archive the emails. I use caddy for many of my services, so I have pointed dovecot to caddys certificates (for "my.domain"), since it manages certificates through let's encrypt. I had a plan to install postfix for sending internal emails from my self-hosted services, but it seemed like a bit of configuration and I got busy with other stuff

I made an excerpt from my docker-compose.yml, but you probably have to figure out some things on your own


version: '3.4'

services:
  dovecot:
    image: dovecot/dovecot:2.3.20
    restart: unless-stopped
    volumes:
      - ./dovecot/:/etc/dovecot
      - /mnt/storage/dovecot/mail:/srv/mail
      - ./caddy/data/caddy/certificates/acme-v02.api.letsencrypt.org-directory/wildcard_.my.domain/wildcard_.my.domain.crt:/etc/ssl/cert.crt
      - ./caddy/data/caddy/certificates/acme-v02.api.letsencrypt.org-directory/wildcard_.my.domain/wildcard_.my.domain.key:/etc/ssl/key.key
    ports:
      - 993:993

contents of ./dovecot folder:

dovecot.conf
passwords

contents of dovecot.conf (I think I searched online to find a good example, I don't remember where from..)

## manage this file

mail_home=/srv/mail/%Lu
mail_location=sdbox:~/Mail
mail_uid=1000
mail_gid=1000

protocols = imap pop3 submission sieve lmtp

first_valid_uid = 1000
last_valid_uid = 1000

passdb {
  driver = passwd-file
  args = scheme=argon2i /etc/dovecot/passwords
}

ssl=yes
ssl_cert=</etc/ssl/cert.crt
ssl_key=</etc/ssl/key.key

namespace {
  inbox = yes
  separator = /

  mailbox Drafts {
    auto = subscribe
    special_use = \Drafts
  }
  mailbox Sent {
    auto = subscribe
    special_use = \Sent
  }
  mailbox Spam {
    auto = subscribe
    special_use = \Junk
  }
  mailbox Trash {
    auto = subscribe
    special_use = \Trash
  }
  mailbox Archive {
    auto = subscribe
    special_use = \Archive
  }
}

service lmtp {
  inet_listener {
    port = 24
  }
}

listen = *

log_path=/dev/stdout
info_log_path=/dev/stdout
debug_log_path=/dev/stdout
[-] vegetaaaaaaa@lemmy.world 1 points 2 years ago* (last edited 2 years ago)

allows my mail clients to connect via IMAP to view and search emails

dovecot will be able to handle this part. This is what I use as a mail archive (once a year, archive all mail from the previous year from various mailboxes to my self-hosted dovecot instance). I wrote this ansible role for it.

downloads new emails via IMAP

As others recommended, imapsync should be able to handle that part.

docker solution

These tools are simple enough to install and manage (one package, one config file), Docker is not needed. If you really need it to fit into your docker-based setup, build and maintain your own images.

this post was submitted on 26 Jun 2024
30 points (100.0% liked)

Selfhosted

61070 readers
977 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