Skip to content

Instantly share code, notes, and snippets.

@tomasmetal23
Created February 6, 2020 16:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tomasmetal23/c31e9bf477dd99963480d02322dd5dd7 to your computer and use it in GitHub Desktop.
Save tomasmetal23/c31e9bf477dd99963480d02322dd5dd7 to your computer and use it in GitHub Desktop.
mail server with posteio container for traefik v1.7
version: '3'
services:
posteio:
image: analogic/poste.io:latest
container_name: poste.io
hostname: example.com
restart: always
ports:
- '25:25' # SMTPS - mostly processing incoming mails
- '465:465' # SMTPS - mostly processing incoming mails
- '81:80' # HTTP - redirect to https (see options) and authentication for Let's encrypt service
- '110:110' # POP3 - standard protocol for accessing mailbox, STARTTLS is required before client auth
- '143:143' # IMAP - standard protocol for accessing mailbox, STARTTLS is required before client auth
- '8443:443' # HTTPS - access to administration or webmail client
- '587:587' # MSA - SMTP port used primarily for email clients after STARTTLS and auth
- '993:993' # IMAPS - alternative port for IMAP encrypted since connection
- '995:995' # POP3S - encrypted POP3 since connections
environment:
- HOSTNAME=mail.example.com
- HTTPS=OFF
#- DISABLE_CLAMAV=TRUE
- LETSENCRYPT_EMAIL=postmaster@example.com
- LETSENCRYPT_HOST=example.com
- VIRTUAL_HOST=mail.example.com
volumes:
- './containers/poste.io/data:/data'
- '/etc/localtime:/etc/localtime:ro'
labels:
- "traefik.leposte.backend=leposte"
- "traefik.leposte.frontend.rule=HostRegexp:example.com,{subdomain:[a-z]*}.example.com;PathPrefix:/.well-known/"
- "traefik.leposte.port=80"
- "traefik.leposte.protocol=http"
- "traefik.leposte.frontend.entryPoints=http"
- "traefik.webmail.backend=webmail"
- "traefik.webmail.frontend.rule=Host:webmail.example.com"
- "traefik.webmail.port=80"
- "traefik.webmail.frontend.headers.SSLRedirect=true"
- "traefik.admin.backend=posteio"
- "traefik.admin.frontend.rule=Host:posteio.example.com"
- "traefik.admin.frontend.redirect.regex=posteio.example.com/webmail"
- "traefik.admin.frontend.redirect.replacement=posteio.example.com/admin/"
- "traefik.admin.port=80"
- "traefik.admin.frontend.headers.SSLRedirect=true"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment