Docker-mailserver: postfix seems to not known its own domain

Created on 22 May 2020  路  8Comments  路  Source: tomav/docker-mailserver

Subject

  • [x] Other

Description

Problem in short:

Postfix tries to relay all mail

Maybe the culprit:

  • My system runs on a subdomain: mail.mydomain.de
  • This is my homeserver and I have set up the domain server of mydomain.de to point mail.mydomain.de to a freedns.afraid.org dynamic subdomain name

What works / What doesn't work

Relay disabled:

  • Local delivery OK
  • IN delivery OK
  • OUT delivery NOT working (because of no permission to create SPF records for a freedns.afraid.org subdomain name and a TXT record for mail.mydomain.de seems to not be respected)

Relay enabled:

  • Local delivery NOT working (see below)
  • IN delivery NOT working (see below)
  • OUT delivery OK

Local delivery and IN delivery, when relay is enabled:

postfix/smtp[5508]: warning: smtp_tls_wrappermode requires "smtp_tls_security_level = encrypt" (or stronger)
May 21 22:56:46 enceladus postfix/smtp[3233]: 4F25B80B76: to=<[email protected]>, relay=none, delay=513, delays=513/0.02/0/0, dsn=4.3.0, status=deferred (server unavailable or unable to receive mail)

The configs

.env

HOSTNAME=enceladus
DOMAINNAME=mail.mydomain.de
CONTAINER_NAME=mail

env-mailserver

OVERRIDE_HOSTNAME=enceladus.mail.mydomain.de
RELAY_HOST=relayhost
RELAY_PORT=465
RELAY_USER=myuser
RELAY_PASSWORD=mypwd

config/postfix-main.cf

smtp_tls_wrappermode = yes

postfix-relaymap.cf

@mail.mydomain.de   [relayhost]:465
*           DUNNO

Question

So the question is, did I confuse postfix with my setup/environment somehow in a way that it doesn't know its local domain?
Or did I got this wrong and the relay setup just is not correct?

Thanks for any help! :)

help wanted postfix / dovecot related priority 3 [LOW] question waiting for contributor action

All 8 comments

Well, I'm no expert on configurations with relay, I've never used that part. However, your domain seems weird. Do you send mail to [email protected] or do you actually send mail to [email protected]?

My guess is that the domain should be mydomain.com but of course your mail server (and the MX record) can use somehost.mail.mydomain.com if it wants. If you can't control the DNS enough to use mydomain.com I think you have a problem as most users will send mail to that address?

Yes, mail is sent to [email protected]. mydomain.com has its own mail server (from my hosting provider) and I use this one primarily, including mail addresses like [email protected].

But I want to establish my home server as mail server in parallel, using the subdomain. I can make DNS entries for mydomain.com and mail.mydomain.com with no problems.
DKIM e. g. worked without a problem there, cause the name mail._domainkey.mail.mydomain.com is queried from the nameservers of mydomain.com.

But name translation of records from mail.mydomain.com seems to query the freedns.afraid.org DNS servers, as they follow the CNAME entry that points mail.mydomain.com to me.somedynamic.domain.

There seems to be no problem, as everything is working, except for the relay mechanism.
The fact that the relay, when enabled, works as well and it is just to greedy, makes me think that it should be possible to getting this working somehow.... :)

//Edit:
ah and I forgot to explain: I did this in the past and used the dynamic domain directly. I cannot remember the details, but the dynamic domain was removed from freedns at some times .... this led to my mail service instantly be isolated and there was nothing I could do about it!
Because of this, I try to set up the whole thing, using a subdomain from my main domain in front of the dynamic subdomain. Next times the dynamic domain is deleted, I can easily switch the DNS records to a new one and my mail setup can persist. ;-)

It should be doable, I'll flag it help wanted. Hopefully someone with more experience in relay configuration will notice.

There hasn't happened much here. Any news @nsk7even ?

No, nothing yet, but I will try this again, as soon as I have some spare times! (hopefully not later than in winter)

@nsk7even please report back here when you're done:)

What's the current status here?

What's the current status here?

still no progress here, was quite busy over the last months

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nekrondev picture nekrondev  路  3Comments

landergate picture landergate  路  4Comments

capi picture capi  路  4Comments

xiao1201 picture xiao1201  路  4Comments

42wim picture 42wim  路  4Comments