Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/etc/maininabox.conf MTA_STS_MODE value overwritten every start.sh run #1967

Closed
jvolkenant opened this issue Apr 20, 2021 · 0 comments · Fixed by #1970
Closed

/etc/maininabox.conf MTA_STS_MODE value overwritten every start.sh run #1967

jvolkenant opened this issue Apr 20, 2021 · 0 comments · Fixed by #1970

Comments

@jvolkenant
Copy link
Contributor

In testing out #1965, I took another look at how the variables are handled in start.sh in respect to creating /etc/mailinabox.conf. the value for MTA_STS_MODE gets overwritten if you put any value in since...

MTA_STS_MODE=${MTA_STS_MODE-}

by that point in the code MTA_STS_MODE is empty, and it gets initialized to an empty variable every time. Only DEFAULT_... variables are available to carried forward.

In the current code things still work as the variable just gets set to enforce because the mailinabox.conf variable is empty

| sed "s/MODE/${MTA_STS_MODE:-enforce}/" \
.

We should move the initialize to "enforce if empty" for MTA_STS_MODE to start.sh (as we should for all variables), so when you check a /etc/mailinabox.conf config it truely holds the config.

start.sh will need
MTA_STS_MODE=${DEFAULT_MTA_STS_MODE:-enforce}

web.sh
| sed "s/MODE/${MTA_STS_MODE}/" \

or something of the like. When I get some time I'll submit a PR.

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 a pull request may close this issue.

1 participant