Replies: 2 comments 3 replies
-
Also, if I remove that binding, I get a different error: Presumably coming from Coolify's proxy configuration:
So if/when the initial issue is solved, I'll still have to deal with this |
Beta Was this translation helpful? Give feedback.
-
Hi, @ktufekcic So i got mailu to work with coolify.v4.0.0beta-373 using traefik but it's a tricky solution... Here is what i did :
networks:
coolify:
external: true
services:
traefik:
container_name: coolify-proxy
image: 'traefik:v3.1'
restart: unless-stopped
extra_hosts:
- 'host.docker.internal:host-gateway'
networks:
- coolify
ports:
- '80:80'
- '443:443'
- '443:443/udp'
# add theses ports for mailu
- "25:25"
- "465:465"
- "993:993"
- "995:995"
- "4190:4190"
healthcheck:
test: 'wget -qO- http://localhost:80/ping || exit 1'
interval: 4s
timeout: 2s
retries: 5
volumes:
- '/var/run/docker.sock:/var/run/docker.sock:ro'
- '/data/coolify/proxy:/traefik'
command:
# - '--log.level=INFO' # uncomment for debuggig
- '--ping=true'
- '--ping.entrypoint=http'
- '--api.dashboard=true'
- '--api.insecure=false'
- '--entrypoints.http.address=:80'
- '--entrypoints.https.address=:443'
# Mailu entrypoints
- "--entrypoints.smtp.address=:smtp"
- "--entrypoints.submissions.address=:submissions"
- "--entrypoints.imaps.address=:imaps"
- "--entrypoints.pop3s.address=:pop3s"
- "--entrypoints.sieve.address=:sieve"
# end mailu entrypoints
- '--entrypoints.http.http.encodequerysemicolons=true'
- '--entryPoints.http.http2.maxConcurrentStreams=50'
- '--entrypoints.https.http.encodequerysemicolons=true'
- '--entryPoints.https.http2.maxConcurrentStreams=50'
- '--entrypoints.https.http3'
# omitted letsencrypt part
- '--providers.docker.exposedbydefault=false'
- '--providers.file.directory=/traefik/dynamic/'
- '--providers.file.watch=true'
- '--providers.docker=true'
labels:
- traefik.enable=true
- traefik.http.routers.traefik.entrypoints=https
- traefik.http.routers.traefik.rule=Host(`dashboard.exemple.com`)
- traefik.http.routers.traefik.service=api@internal
- coolify.managed=true
- coolify.proxy=true
# This service is Important as it'll help you get (easily) the IP of traefik
# You can (and must) remove it afterwards
whoami:
image: traefik/whoami
container_name: traefik-whoami
networks:
- coolify
labels:
- traefik.enable=true
- 'traefik.http.routers.whoami.rule=Host(`dashboard.oksweb.com`) && Path(`/whoami`)'
- traefik.http.routers.whoami.entrypoints=https
front:
image: '${DOCKER_ORG:-ghcr.io/mailu}/${DOCKER_PREFIX:-}nginx:${MAILU_VERSION:-2024.06}'
restart: always
env_file: .env # mailu default env file is "mailu.env" but coolify default env file ".env" so let's switch to the last one
logging:
driver: journald
options:
tag: mailu-front
networks:
- default
- webmail
- coolify # add this network otherwise traefik will not be able to communicate with this container
volumes:
- './mailu/certs:/certs'
- './mailu/overrides/nginx:/overrides:ro'
depends_on:
- resolver
dns:
- '${RESOLVER_IP}' # I had some issues with the resolver so i removed it and switched all the DNS to cloudflare's (added "RESOLVER_IP=1.1.1.1" in the env variables
labels: # here is the beast...
- traefik.enable=true
- traefik.docker.network=coolify
- 'traefik.http.routers.http.rule=Host(`mail.example.com`) || PathPrefix(`/.well-known/acme-challenge/`)'
- traefik.http.routers.http.entrypoints=http
- traefik.http.services.http.loadbalancer.server.port=80
- 'traefik.tcp.routers.https.rule=HostSNI(`mail.example.com`) || HostSNI(`autoconfig.example.com`) || HostSNI(`mta-sts.example.com`)'
- traefik.tcp.routers.https.entrypoints=https
- traefik.tcp.routers.https.tls.passthrough=true
- traefik.tcp.routers.https.service=https
- traefik.tcp.services.https.loadbalancer.server.port=443
- traefik.tcp.services.https.loadbalancer.proxyProtocol.version=2
- 'traefik.tcp.routers.smtp.rule=HostSNI(`*`)'
- traefik.tcp.routers.smtp.entrypoints=smtp
- traefik.tcp.routers.smtp.service=smtp
- traefik.tcp.services.smtp.loadbalancer.server.port=25
- traefik.tcp.services.smtp.loadbalancer.proxyProtocol.version=2
- 'traefik.tcp.routers.submissions.rule=HostSNI(`*`)'
- traefik.tcp.routers.submissions.entrypoints=submissions
- traefik.tcp.routers.submissions.service=submissions
- traefik.tcp.services.submissions.loadbalancer.server.port=465
- traefik.tcp.services.submissions.loadbalancer.proxyProtocol.version=2
- 'traefik.tcp.routers.imaps.rule=HostSNI(`*`)'
- traefik.tcp.routers.imaps.entrypoints=imaps
- traefik.tcp.routers.imaps.service=imaps
- traefik.tcp.services.imaps.loadbalancer.server.port=993
- traefik.tcp.services.imaps.loadbalancer.proxyProtocol.version=2
- 'traefik.tcp.routers.pop3s.rule=HostSNI(`*`)'
- traefik.tcp.routers.pop3s.entrypoints=pop3s
- traefik.tcp.routers.pop3s.service=pop3s
- traefik.tcp.services.pop3s.loadbalancer.server.port=995
- traefik.tcp.services.pop3s.loadbalancer.proxyProtocol.version=2
- 'traefik.tcp.routers.sieve.rule=HostSNI(`*`)'
- traefik.tcp.routers.sieve.entrypoints=sieve
- traefik.tcp.routers.sieve.service=sieve
- traefik.tcp.services.sieve.loadbalancer.server.port=4190
- traefik.tcp.services.sieve.loadbalancer.proxyProtocol.version=2
healthcheck:
test:
- NONE
# [ other services omited]
networks:
default:
driver: bridge
ipam:
driver: default
config:
-
subnet: '${SUBNET}' # i added this and grabbed it from the env file
![]()
redis:
image: 'redis:alpine'
restart: always
volumes:
- '/data/coolify/services/d8cw4swwgwkw8ooo04w44gwk/mailu/redis:/data'
depends_on:
- resolver
dns:
- '${RESOLVER_IP}'
container_name: redis-d8cw4swwgwkw8ooo04w44gwk
labels:
- coolify.managed=true
- coolify.version=4.0.0-beta.373
- coolify.serviceId=1
- coolify.type=service
- coolify.name=redis-d8cw4swwgwkw8ooo04w44gwk
- coolify.pullRequestId=0
- coolify.service.subId=1
- coolify.service.subType=database
networks: # remove this
d8cw4swwgwkw8ooo04w44gwk: null # remove this
environment:
COOLIFY_CONTAINER_NAME: '"redis-d8cw4swwgwkw8ooo04w44gwk"'
The thing here that i spent almost 3 days on is if you do not remove the added subnet "d8cw4swwgwkw8ooo04w44gwk" (like in my example), all mailu will work as desired front, admin, everything will work just fine but you'll end up having a loop while trying to login to the webmail or imap/pop3 or the UI of rspamd but like i said the admin will work just fine and a redirect loop will happen like it's described here Mailu/Mailu#1895 (comment) the issue is when you have more than one network on the services, it'll just fail to authenticate... i'm still trying to debug it but i'm kinda busy this week, i'll post an answer later if i find any. Btw, it'd be interresting to have mailu as a template or coolify app to deploy it quickly ! |
Beta Was this translation helpful? Give feedback.
-
Howdy all;
I've been trying to deploy a MailU server via Coolify for a while now, but no matter what I do I can't quite get it to work. This is the entire docker-compose.yml:
I've generated this from mailu's own docker compose generator, the only change I made was to remove the
env_file: mailu.env
because I was using Coolify's own env variables. However, with this setup I'd get the following error:Error response from daemon: user specified IP address is supported only when connecting to networks with user configured subnets
This seems to be caused by the resolver service having an ipv4 address bound to it.
For some extra context, the server where I'm trying to setup the mail service on is managed by Coolify, but Coolify isn't running directly on it, and it's pretty much a "blank" slate, it's a Hetzner service with that singular purpose running 22.04.
ip a
output:Any help or guidance is highly appreciated, and let me know if any further information is needed
Beta Was this translation helpful? Give feedback.
All reactions