Just the Dovecot [Solved sorta]

Hi all. I have been struggling trying to get dovecot docker to work as a email storage system. The struggle is really with certs etc.

Essentially this is the Goal:
Have dovecot running on my TrueNas box with copies of all my email in there for easy access. I currently have a Maildir with emails back to the 1990’s (lol i am a data hoarder). There is ZERO need for outside connections or sending emails etc. It is just a dump for old emails.

The Issue:
Ports are up and visible, can telnet in. However connecting via Thunderbird from windows (all in name network) gives a variety of problems. ie. It needs SSL certs etc. I do have swag running on my system to get letsencrypt certs for stuff thats visible to the outside eg. My SearXNG site so all certs work with reverse proxy etc. but nfi how to get it working with internal IP ie. 192.168.1.250

I have tried self-signed and trolled the internet for seting up a mail server, but most come with “complete packs” etc. and not just the basic stuff I need. Eventually I will use my nextcloud email to connect to it for “web access” from outside.

Anybody got some step by step guides for this. I am using the dovecot/dovecot docker image.

version: "3"

services:
  dovecot:
    image: dovecot/dovecot
    container_name: dovecot
    environment:
      - TZ=Asia/Bangkok
    ports:
      - 110:110 #POP3 on 110, SSL 995
      - 995:995 #POP3 on 110, SSL 995
      - 143:143 #IMAP on 143, SSL 993
      - 993:993 #IMAP on 143, SSL 993
      #- 587:587 #Submission on 587
      #- 24:24 #LMTP on 24
      #- 4190:4190 #ManageSieve on 4190
    volumes:
      - /mnt/pond/appdata/dovecot:/etc/dovecot
      - /mnt/lake/cloud/dovecot:/srv/mail
      
    restart: unless-stopped
    network_mode: host
    #networks:
    #  - privatenetwork

#networks:
#  privatenetwork:
#    external: true

Currently at a loss in trying to get this thing working :sob: Any help or direction would be appreciated.

PS. one of the reasons for using Thunderbird is so I can connect to gmail and drag the email accross to archive it. Aslo, dedupe and other fun stuff.

Have you found (and studied) this page before?
http://flurdy.com/docs/postfix/

Haven’t seen that, will look at it… but seems like a lot of EXTRA applications and stuff I don’t want or need. There is the mailclow docker setup and the iRedMail one for all the complete stuff, which I don’t need or want. Just want a simple email storage with no ability to send or receive… just basic IMAP boxes. Security is not even important because it is internal.

Good News! I have it working. Posting for anybody that is interested. No SSL yet, but I can access my Maildir and dump stuff in and out, so that’s the important part.

Messed around with the config to enable plaintext passwords and created a highly suspect and insecure passwd file for it.

dovecot.conf

ail_home=/srv/mail/%Lu
#mail_location=sdbox:~/Mail
mail_location=maildir:~/Maildir

## this is sometimes needed
#first_valid_uid = uid-of-vmail-user

# if you want to use system users
#passdb {
#  driver = pam
#}

listen = *, ::
protocols = imap pop3
log_path = /etc/dovecot/logs/dovecot
disable_plaintext_auth = no


passdb {
  driver = passwd-file
  args = scheme=plain-md5 username_format=%n /etc/dovecot/imap.passwd
}
userdb {
  driver = passwd-file
  args = username_format=%n /etc/dovecot/imap.passwd
  #override_fields = uid=vmail gid=vmail
}

ssl=yes
ssl_cert=</etc/dovecot/cert.pem
ssl_key=</etc/dovecot/key.pem
# if you are using v2.3.0-v2.3.2.1 (or want to support non-ECC DH algorithms)
# since v2.3.3 this setting has been made optional.
#ssl_dh=</path/to/dh.pem

namespace {
  inbox = yes
  separator = /
}

and the highly insecure imap.passwd

talung:{plain}secretyword:1000:1000::/srv/mail/talung:

Also had to run a perl migration script from here. Migration/Courier - Dovecot Wiki but I can now fully access the old Maildir and do stuff with it.

Tried some SSL selfsigned certs etc. but still no luck in getting those working. However, I currently have what I need, an email dump. Time to start archiving those many gmail accounts I have. Fun times