This is exactly what I was looking for but I ran into some issues that I believe is due to interesting setup and I’m not really sure where to locate the issue but my assumption is it has to do with port 25 since I’m unable to send or receive emails at this time.
Here’s my setup:
VPS(Server A) setup running Netmaker as a means of tunneling to my home server (Server B) behind CGNAT and for ACL purposes.
Mailcow is installed on my Home server (Server B) which is an Ubuntu implementation running in Virtual Box. I have other services that are running without issue at the moment.
My Caddyfile is on my VPS and I have a declaration in it that points to Mailcow:
# Mail Server
https://mail.mydomain.com {
reverse_proxy serverB:8008
}
I know this is working properly for I’m able to access it publicly through my domain.
I successfully created the necessary DNS records for my domain except for the DKIM which for some reason is not working when searching my domain on dmarcian.com. - However, that’s not my main concern and I have a feeling that will fix itself when I locate the root problem.
When I attempt to send an email through the Webmail SOGo interface, it fails with “Not allowed in state 1”.
I have all the necessary ports open on my VPS but when I run:netstat -tulpn | grep -E -w '25|80|110|143|443|465|587|993|995|4190'
on my home server (ServerB)
I get the following and don’t see port 25:
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 77424/docker-proxy
tcp 0 0 0.0.0.0:4190 0.0.0.0:* LISTEN 80220/docker-proxy
tcp 0 0 0.0.0.0:110 0.0.0.0:* LISTEN 80300/docker-proxy
tcp 0 0 0.0.0.0:143 0.0.0.0:* LISTEN 80280/docker-proxy
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 77352/docker-proxy
tcp 0 0 0.0.0.0:993 0.0.0.0:* LISTEN 80260/docker-proxy
tcp 0 0 0.0.0.0:995 0.0.0.0:* LISTEN 80240/docker-proxy
tcp6 0 0 :::80 :::* LISTEN 77436/docker-proxy
tcp6 0 0 :::4190 :::* LISTEN 80227/docker-proxy
tcp6 0 0 :::110 :::* LISTEN 80307/docker-proxy
tcp6 0 0 :::143 :::* LISTEN 80285/docker-proxy
tcp6 0 0 :::443 :::* LISTEN 77357/docker-proxy
tcp6 0 0 :::993 :::* LISTEN 80265/docker-proxy
tcp6 0 0 :::995 :::* LISTEN 80245/docker-proxy
I tried to look through the SOGo logs and I found this:
[67]: [ERROR] <0x0x55f93bb37640[SOGoMailer]> Could not connect to the SMTP server smtp://172.16.1.253:588/?tls=NO&tlsVerifyMode=none
I had to change the Mailcow network for it was clashing with another service and maybe that’s where my issue lies… I’m not really sure at this point. My first initial guess is that the other ports aren’t binding from my VPS to my Home Server. Not sure how to set that up in my Caddyfile if it should just be the same as I have it above but for each port that is used by Caddy?
The other issue also might be that NGINX is running in the Mailcow container and I also have an instance of NGINX Proxy Manager running on my home server to direct traffic to the proper services… Very complicated I know but fun?
Lastly, I cant seem to locate where my SSL certs are being stored so that I can move them to mailcow as you mentioned. Caddy is running in a docker compose that Netmaker automatically setups and looks like this:
caddy:
image: caddy:2.6.2
container_name: caddy
env_file: ./netmaker.env
restart: unless-stopped
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
- caddy_data:/data
- caddy_conf:/config
- /root/www:/var/www/mydomain.com
ports:
- "80:80"
- "443:443"
volumes:
caddy_data: { } # runtime data for caddy
caddy_conf: { } # configuration file for Caddy
sqldata: { }
dnsconfig: { } # storage for coredns
mosquitto_logs: { } # storage for mqtt logs
mosquitto_data: { } # storage for mqtt data
I’m pretty sure the caddy_data { }
contains the lets encrypt certs but I can’t figure out where that volume is. Or maybe it’s not persisted and just runs in the container? Which would be fun to figure out how to copy the certs in there to mailcow but I digress.
Not asking for complete support but maybe something sticks out to someone and I can slap my head and buy a beer 😃.
Thanks in advanced to any help or direction provided!