Skip to content

kubernetes fix#484

Merged
tomav merged 10 commits intodocker-mailserver:masterfrom
kvncrw:master
Jan 20, 2017
Merged

kubernetes fix#484
tomav merged 10 commits intodocker-mailserver:masterfrom
kvncrw:master

Conversation

@kvncrw
Copy link
Copy Markdown
Contributor

@kvncrw kvncrw commented Jan 19, 2017

This was derived from #390. I'm not trying to step on toes, I just happened to be setting up a mail server on my kubernetes homelab this evening.

I believe amavis should pass integration tests now with the changes I've made. We'll see.

@tomav
Copy link
Copy Markdown
Contributor

tomav commented Jan 19, 2017

Thank you @KCrawley
Could you add integration test on this new ENV?
Once done, I'll merge it.
Thank you.

Copy link
Copy Markdown
Contributor

@tomav tomav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the job to finish this PR.

No major comment on my side except this default value and the missing integration test.

I can provide help on test if needed, but existing example may be helpful.

Comment thread target/start-mailserver.sh Outdated
DEFAULT_VARS["SMTP_ONLY"]="${SMTP_ONLY:="0"}"
DEFAULT_VARS["VIRUSMAILS_DELETE_DELAY"]="${VIRUSMAILS_DELETE_DELAY:="7"}"
DEFAULT_VARS["DMS_DEBUG"]="${DMS_DEBUG:="0"}"
DEFAULT_VARS["OVERRIDE_HOSTNAME"]="${OVERRIDE_HOSTNAME:="false"}"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think "false" is a good default value in that case.
This should remain empty if not provided, no?

Comment thread target/start-mailserver.sh Outdated
notify "task" "Check that hostname/domainname is provided (no default docker hostname) [$FUNCNAME]"
notify "task" "Check that hostname/domainname is provided or overidden (no default docker hostname/kubernetes) [$FUNCNAME]"

if [[ ${DEFAULT_VARS["OVERRIDE_HOSTNAME"]} != "false" ]]; then
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cf. previous comment.

@tyranron
Copy link
Copy Markdown
Contributor

Additionally, I think it will be right to remove this and restore this stuff for OpenDMARC with this PR.

Currently it uses HOSTNAME value in configuration, so according to documentation automatically resolves to container's hostname which is Pod's, not the one we want to specify.

If the string "HOSTNAME" is provided, the name of the host running the filter (as returned by the gethostname(3) function) will be used.

Copy link
Copy Markdown
Contributor

@tomav tomav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're close!

Comment thread Makefile Outdated

run:
# Run containers
docker run -d --name mail_hostoverride \
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you use an existing container like mail_smtponly?
It avoids to launch to many of them consuming CPU and memory.
Otherwise it's ok!
Thanks.

Comment thread test/tests.bats Outdated
}

@test "checking configuration: hostname/domainname override" {
run docker exec mail_hostoverride /bin/bash -c "cat /etc/mailname | grep my-domain.com"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use mail_smtponly

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@tomav
Copy link
Copy Markdown
Contributor

tomav commented Jan 19, 2017

LGTM, waiting for travis (just restarted it)

@tomav
Copy link
Copy Markdown
Contributor

tomav commented Jan 19, 2017

@tyranron this can be merged without your last comment or not?
Perhaps this can be added after?

@kvncrw
Copy link
Copy Markdown
Contributor Author

kvncrw commented Jan 19, 2017

https://github.com/tomav/docker-mailserver/blob/master/target/opendmarc/opendmarc.conf#L11-L12

It's not difficult to sed and replace those values, would current tests cover that change?

@tomav
Copy link
Copy Markdown
Contributor

tomav commented Jan 20, 2017

I'm gonna merge this.
@KCrawley thanks for the job.
@tyranron feel free to open an issue if some works needs to be done on that topic

Thank you guys.

@tomav
Copy link
Copy Markdown
Contributor

tomav commented Jan 20, 2017

And thanks @iMartyn for the initial PR.

@tomav tomav merged commit 16c90fc into docker-mailserver:master Jan 20, 2017
RichardFevrier pushed a commit to RichardFevrier/docker-mailserver that referenced this pull request Aug 26, 2019
* Allow OVERRIDE_HOSTNAME
* Document the new environment variable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants