Use FQDN as REPORT_SENDER default value.#2487
Use FQDN as REPORT_SENDER default value.#2487casperklein merged 7 commits intodocker-mailserver:masterfrom
Conversation
| VARS[POSTMASTER_ADDRESS]="${POSTMASTER_ADDRESS:=postmaster@${DOMAINNAME}}" | ||
| VARS[REPORT_RECIPIENT]="${REPORT_RECIPIENT:=${POSTMASTER_ADDRESS}}" | ||
| VARS[REPORT_SENDER]="${REPORT_SENDER:=mailserver-report@${DOMAINNAME}}" | ||
| VARS[REPORT_SENDER]="${REPORT_SENDER:=mailserver-report@$(hostname -f)}" |
There was a problem hiding this comment.
I remember this was HOSTNAME before. I think there also is a test you'll need to adjust.
There was a problem hiding this comment.
You are right, one test failed. I must have done something wrong yesterday, as my local tests passed successful 😕
There was a problem hiding this comment.
With my latest refactorings, _obtain_hostname_and_domainname runs beforehand. With this, we should be able to use DOMAINNAME or HOSTNAME instead of hostname -f, right?
There was a problem hiding this comment.
See my last commit, locally the test now succeed.
There was a problem hiding this comment.
I see, but here in start-mailserver.sh, we could also use the same env variable, right?
There was a problem hiding this comment.
I re-read your comment 😆 $HOSTNAME should also be fine.
PS; I find it very confusing, that we modify system variables. This is bad practice IMO. $HOSTNAME is set by docker.
If I bash into DMS and echo $HOSTNAME, just mail is returned, while in the start-mailserver.sh context $HOSTNAME is a FQDN:
root@mail:/# echo $HOSTNAME
mail
root@mail:/# source ./usr/local/bin/helpers/dns.sh
root@mail:/# _obtain_hostname_and_domainname
root@mail:/# echo $HOSTNAME
mail.example.comMaybe in a future PR we should change that. Instead of modifying $HOSTNAME, we should use $DMS_HOSTNAME or something else to make the difference clear and avoid confusion.
There was a problem hiding this comment.
I agree, this needs some reworking. I think @polarathene has this in his backlog somewhere :D
There was a problem hiding this comment.
PS; I find it very confusing, that we modify system variables. This is bad practice IMO. $HOSTNAME is set by docker.
👍
I've already expressed this concern in the past, and there was talk to change to DMS_HOSTNAME / DMS_FQDN IIRC, but required tests to be adapted for running through some different configs for confidence in proceeding, as I believe dropping DOMAINNAME was also being considered.
|
GitHub has some problems ATM, therefore tests are failing. |
Description
With the merge of #2428, the default sender address was changed.
Let's take our example config:
docker-mailserver/docker-compose.yml
Lines 7 to 8 in b730942
Before: Reports sender address was [email protected]
After: Reports sender address is [email protected]
This is wrong IMO.
The subject line of the reports are
Logwatch for mail.example.com (Linux)andPostfix summary for mail.example.com. They correctly state the FQDN for which the reports are. The sender address should therefore also bemail.example.com.mail.example.comis not necessary the same host asexample.com, which is another reason for this change.This PR uses the FQDN of the mailserver as default sender address.
Fixes #
Type of change
Checklist:
docs/)