1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2025-04-20 02:52:11 +00:00

Default MTA_STS mode is testing,

saves the state to /etc/mailinabox.conf so during upgrades,
the variable is perserved
This commit is contained in:
A. Schippers 2020-03-02 21:28:04 +01:00
parent 584f621260
commit 3679ec984d
3 changed files with 9 additions and 1 deletions

View File

@ -1,4 +1,4 @@
version: STSv1 version: STSv1
mode: testing mode: MODE
mx: PRIMARY_HOSTNAME mx: PRIMARY_HOSTNAME
max_age: 86400 max_age: 86400

View File

@ -82,6 +82,11 @@ if [ ! -f $STORAGE_ROOT/mailinabox.version ]; then
chown $STORAGE_USER.$STORAGE_USER $STORAGE_ROOT/mailinabox.version chown $STORAGE_USER.$STORAGE_USER $STORAGE_ROOT/mailinabox.version
fi fi
# Default policy (initial) for MTA_STS = testing in the current state of inclusion.
# it can be changed to "none", "testing" or "enforce". With this extention, this is preserved by
# future upgrades
MTA_STS="${DEFAULT_MTA_STS:-testing}"
# Save the global options in /etc/mailinabox.conf so that standalone # Save the global options in /etc/mailinabox.conf so that standalone
# tools know where to look for data. # tools know where to look for data.
@ -93,6 +98,7 @@ PUBLIC_IP=$PUBLIC_IP
PUBLIC_IPV6=$PUBLIC_IPV6 PUBLIC_IPV6=$PUBLIC_IPV6
PRIVATE_IP=$PRIVATE_IP PRIVATE_IP=$PRIVATE_IP
PRIVATE_IPV6=$PRIVATE_IPV6 PRIVATE_IPV6=$PRIVATE_IPV6
MTA_STS=$MTA_STS
EOF EOF
# Start service configuration. # Start service configuration.

View File

@ -126,7 +126,9 @@ chmod a+r /var/lib/mailinabox/mozilla-autoconfig.xml
# nginx configuration at /.well-known/mta-sts.txt # nginx configuration at /.well-known/mta-sts.txt
# more documentation is available on: # more documentation is available on:
# https://www.uriports.com/blog/mta-sts-explained/ # https://www.uriports.com/blog/mta-sts-explained/
cat conf/mta-sts.txt \ cat conf/mta-sts.txt \
| sed "s/MODE/$MTA_STS/" \
| sed "s/PRIMARY_HOSTNAME/$PRIMARY_HOSTNAME/" \ | sed "s/PRIMARY_HOSTNAME/$PRIMARY_HOSTNAME/" \
> /var/lib/mailinabox/mta-sts.txt > /var/lib/mailinabox/mta-sts.txt
chmod a+r /var/lib/mailinabox/mta-sts.txt chmod a+r /var/lib/mailinabox/mta-sts.txt