Replies: 4 comments 9 replies
|
Needed - ENABLE_SASL_AUTH=1 on the relay server. |
|
I wrote the revised version of these docs, so it would be helpful to get some feedback from you on where it could be improved. I wanted to ensure that I provided as much information on the topic as it can get a bit bewildering to grok for the various configuration different users required. I tried to organize all those details into this structure:
Technical details in particular is useful for me to refresh on a feature we have without hunting all that information down again each time as-needed. Before I rewrote the docs for the page it was less consistent and more vague on details 😅
Just to double check, did you see the end of that document in the "Technical Details" section there is a link to an example I can understand if you didn't see that link, or if it was a bit much to be helpful to you. Perhaps we could add at the top of the docs page a link this The rest of that section also shows what we configure in Postfix for you under the hood. You could technically do this without any of the DMS related config/features for relay host support, by just using our standard You'll also notice a link to our ENV docs page for anything related to Relay Host config there, and EDIT: Oh that minimal They are similar but the official example committed is an improved revision (based on another original GH comment of mine on the topic, which is linked to at the start of the official
This config file is covered in the "Advanced Configuration" section, the docs perhaps could be a bit clearer on this concern but in the earlier "Configuration" section, you are shown the relay credentials with ENV So you can absolutely use that, but just the ENV works too. What you do need to be mindful of is when playing around with the configuration, as annoying as it can be you might not get those changes applied properly unless you do a full container restart ( |
|
Don't get me wrong here, I definitely appreciate the detailed reply, but
My next step now would be to find and setup such a simple smtp relay. There are plenty available but I have yet to find one that allows encrypted authentication - or maybe I am just still fumbling around in the dark. But I realize that is another project, so I don't want to waste your time with this. Thanks again for the detailed reply, appreciated! |
|
I have put this together for you, two NOTE:
Step A - Configure DMS to use a relay hostThis is your homelab instance, adapt the below
services:
dms-homelab:
image: mailserver/docker-mailserver:latest # :15.1
hostname: mail.example.test
environment:
- DEFAULT_RELAY_HOST=[smtp.relay-service.test]:587
- RELAY_USER=relay-user@relay-service.test
- RELAY_PASSWORD=secret
# `configs` is a Docker Compose feature to embed files. I have used this feature to make the example simple.
# You can instead use separate files with `volumes` in your real `compose.yaml` config.
configs:
- source: dms-postfix-overrides
target: /tmp/docker-mailserver/postfix-main.cf
- source: dms-accounts
target: /tmp/docker-mailserver/postfix-accounts.cf
# Using the Docker Compose `configs.content` feature instead of volume mounting separate files.
# NOTE: This feature requires Docker Compose v2.23.1 (Nov 2023) or newer:
# https://github.com/compose-spec/compose-spec/pull/446
configs:
dms-postfix-overrides:
content: |
smtp_tls_security_level=may
# DMS expects an account to be configured to run, this example provides accounts already created.
# Login credentials:
# user: "john.doe@example.test" password: "secret"
dms-accounts:
# NOTE: Any `$` in `compose.yaml` implies a system environment variable to substitute,
# As such any content with `$` needs to be changed to `$$` to opt-out of this Docker Compose feature.
content: |
john.doe@example.test|{SHA512-CRYPT}$$6$$sbgFRCmQ.KWS5ryb$$EsWrlYosiadgdUOxCBHY0DQ3qFbeudDhNMqHs6jZt.8gmxUwiLVy738knqkHD4zj4amkb296HFqQ3yDq4UXt8.Extra Info - ENV for relay-hostThis is all you need to know about the required relay DMS ENV settings:
Extra Info - DNSNothing special here to change for relay host support, standard DNS for a typical mailserver. Your mail domain (
Step B - Configure another DMS instance to act as a relay hostYour VPS instance:
services:
dms-relay:
image: mailserver/docker-mailserver:latest # :15.1
hostname: smtp.relay-service.test
# This is optional but skips the default anti-spam service since you don't have a need for it?
environment:
- ENABLE_AMAVIS: 0
# This is the only port that needs to be published so `dms-homelab` can connect
ports:
- 587:587
# Keep everything in `compose.yaml` for convenience
configs:
- source: dms-accounts
target: /tmp/docker-mailserver/postfix-accounts.cf
# NOTE: Change this the `relay-user` content line to your own generated `postfix-accounts.cf` with a more secure password
configs:
# Login credentials:
# user: "relay-user@relay-service.test" password: "secret"
dms-accounts:
content: |
relay-user@relay-service.test|{SHA512-CRYPT}$$6$$o65y1ZXC4ooOPLwZ$$7TF1nYowEtNJpH6BwJBgdj2pPAxaCvhIKQA6ww5zdHm/AA7aemY9eoHC91DOgYNaKj1HLxSeWNDdvrp6mbtUY.Extra info
|



Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I have read the documentation, specifically https://docker-mailserver.github.io/docker-mailserver/latest/config/advanced/mail-forwarding/relay-hosts/ but I am afraid I am probably too dense to understand it. There are so many if's and but's and particular conditions and exceptions that it leaves me completely confused. I have spent hours with the help of chatgpt to try to make heads and tail of it all, but I just can't get it to work. In order to avoid a TL;DR situation I won't go through everything I tried, just, could someone guide me through what I need to do on the two servers.
Both servers generally works. The public server is currently my working server and works fine, when my ISP works, but it is a cheap setup and as a result not very reliable, happens to be down every now and than. My homelab otoh is rock solid, and I'm on FTTH gigabit internet with excellent reliability too, which is why I prefer using my homelab for my mailserver. Only problem is, it's by definition a consumer line, and hence many (most?) mail hosts rejects it for that alone.
Without going into details, I have on my mailserver (in my homelab) I have
on the relay I have tried various things ,but I think perhaps the most essential is a config/postfix-sasl-password.cf with the same details as on the mailserver above:
At this time I'm stuck with this error:
emails and passwords are of course checked and double checked. I'm sure I'm missing something simple but essential, but I just don't know what, and chatgpt just goes in circles...
help ...
All reactions