Fix app mail - Add main domain into hosts file #1780
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The problem
Some apps like synapse need to send email but don't have option to allow invalid certificate. In this case the target server defined on the app must match with the certificate provided by postfix (or dovecot in reception case). But currently it's not possible as postfix (and dovecot) are configured to only accept app connexion on local IP (so 127.0.0.1 or ::1).
So for instance we have a server with main domain
yolo.xyz
.In synapse to send email we have mainly 2 solutions:
yolo.xyz
but the SMTP client expect to receive a certificate for the configured domain, solocalhost
in this case.eth0
) and postfix don't allow app connection from external interface.Solution
To solve this I thought about 2 potential solutions:
yolo.xyz
will resolve this to 127.0.0.1 and so the connection will be with a matching certificate to the configured domain. And on postfix side the connection will be on local interface so it will be happy.yolo.xyz
. The provided certificate will match with the configured domain. And if postfix is configured to allow external connection from app there will be no problem.This PR implement the first solution which I think is the best one.
PR Status
Tested on my side and it work well.
How to test
Run regen-conf for dnsmasq and ping main domain and see that ping go directly to
127.0.0.1
.