1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2026-03-16 17:47:23 +01:00

Compare commits

..

4 Commits

Author SHA1 Message Date
Joshua Tauberer
837d327c1e v0.09
=====

May 8, 2015

Mail:

* Spam checking is now performed on messages larger than the previous limit of 64KB.
* POP3S is now enabled (port 995).
* Roundcube is updated to version 1.1.1.
* Minor security improvements (more mail headers with user agent info are anonymized; crypto settings were tightened).

ownCloud:

* Downloading files you uploaded to ownCloud broke because of a change in ownCloud 8.

DNS:

* Internationalized Domain Names (IDNs) should now work in email. If you had custom DNS or custom web settings for internationalized domains, check that they are still working.
* It is now possible to set multiple TXT and other types of records on the same domain in the control panel.
* The custom DNS API was completely rewritten to support setting multiple records of the same type on a domain. Any existing client code using the DNS API will have to be rewritten. (Existing code will just get 404s back.)
* On some systems the `nsd` service failed to start if network inferfaces were not ready.

System / Control Panel:

* In order to guard against misconfiguration that can lead to domain control validation hijacking, email addresses that begin with admin, administrator, postmaster, hostmaster, and webmaster can no longer be used for (new) mail user accounts, and aliases for these addresses may direct mail only to the box's administrator(s).
* Backups now use duplicity's built-in gpg symmetric AES256 encryption rather than my home-brewed encryption. Old backups will be incorporated inside the first backup after this update but then deleted from disk (i.e. your backups from the previous few days will be backed up).
* There was a race condition between backups and the new nightly status checks.
* The control panel would sometimes lock up with an unnecessary loading indicator.
* You can no longer delete your own account from the control panel.

Setup:

* All Mail-in-a-Box release tags are now signed on github, instructions for verifying the signature are added to the README, and the integrity of some packages downloaded during setup is now verified against a SHA1 hash stored in the tag itself.
* Bugs in first user account creation were fixed.
2015-05-08 08:10:39 -04:00
Joshua Tauberer
e39b777abc require TLS on SMTP submission (port 587) to prevent accidental client misconfiguration, although this has no other practical consequences since without TLS clients couldn't authenticate anyway 2015-05-06 00:25:03 +00:00
Joshua Tauberer
7ca42489ae drop legacy, export-grade, and anonymous ciphers from SMTP (port 25, opportunistic)
Even though SMTP (on port 25) is typically opportunistic and a MitM attack can't be prevented, we may as well only offer ciphers that provide some level of security. If a client is so old or misconfigured that it doesn't support newer ciphers, it should hopefully fall back to a non-TLS connection.

Postfix's default was basically anything goes (anonymous and 40-bit ciphers!). Google's MTA's only offer ciphers at 112 bits at greater, and this change approximates that with Postfix's "medium" setting.

Fixes #371
2015-05-05 23:50:07 +00:00
Joshua Tauberer
8c6363f792 bad ciphers were allowed in smtp submssion
This disallows aNULL and other bad ciphers in the Postfix submission server.

I missed an option in 45e93f7dcc recommended by the blog post I was reading.

Fixes #389.
2015-05-05 23:14:59 +00:00
6 changed files with 29 additions and 134 deletions

View File

@@ -1,15 +1,15 @@
CHANGELOG CHANGELOG
========= =========
In Development v0.09 (May 8, 2015)
-------------- -------------------
Mail: Mail:
* Spam checking is now performed on messages larger than the previous limit of 64KB. * Spam checking is now performed on messages larger than the previous limit of 64KB.
* POP3S is now enabled (port 995). * POP3S is now enabled (port 995).
* Roundcube updated to version 1.1.1. * Roundcube is updated to version 1.1.1.
* More mail headers with user agent info are anonymized. * Minor security improvements (more mail headers with user agent info are anonymized; crypto settings were tightened).
ownCloud: ownCloud:
@@ -20,6 +20,7 @@ DNS:
* Internationalized Domain Names (IDNs) should now work in email. If you had custom DNS or custom web settings for internationalized domains, check that they are still working. * Internationalized Domain Names (IDNs) should now work in email. If you had custom DNS or custom web settings for internationalized domains, check that they are still working.
* It is now possible to set multiple TXT and other types of records on the same domain in the control panel. * It is now possible to set multiple TXT and other types of records on the same domain in the control panel.
* The custom DNS API was completely rewritten to support setting multiple records of the same type on a domain. Any existing client code using the DNS API will have to be rewritten. (Existing code will just get 404s back.) * The custom DNS API was completely rewritten to support setting multiple records of the same type on a domain. Any existing client code using the DNS API will have to be rewritten. (Existing code will just get 404s back.)
* On some systems the `nsd` service failed to start if network inferfaces were not ready.
System / Control Panel: System / Control Panel:

View File

@@ -1,30 +0,0 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1
mQENBFN+hN4BCADARMfTK/kDWNz5tFVXXrLfY0QSF9CBO4+vor3MVUmq5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6w/30J25swadeuDYZFckXjVv7
HPLtvyzuNdf7pI0A9rnlGF5rNt6yKSqeiQARAQABiQEfBBgBAgAJBQJTfoTeAhsM
AAoJELkgQfTBC92B0rAH/0hSoHcB5WIn4GLTz0D0wWQ6Y2wKDixOBGvH+S9aroSc
0bKud7VphpFm/4CKWOZ0sphsnmRZ2Dsk/3996pXjLL5T1HWgAkltYmTdWEg9BiEj
PlbcImF95tILJ7GC0QrXipUx+ktLayiT5LjcbZiYCGaWVdJM2hVdOLdHhh84dqNX
xautvI8RDFI1lN0RdyFA5CQAvIWOSTLC1QdLAgkCf7+uQGwUo2ubgapPWptRJYk8
rZuw6+Vi3NETYO0ExDxTFmVKRlMidsE0azMeY6JYpKb9jewKngfxa6oUSaygrhxQ
9gESPA2XZUvx/3PWBAMskBZxjOH/Lhabls0AUxaOYf0=
=SHsx
-----END PGP PUBLIC KEY BLOCK-----

View File

@@ -1,16 +1,13 @@
#!/bin/bash #!/bin/bash
################################################################ #########################################################
# # This script is intended to be run like this:
# This script is posted on HTTPS to make first-time installation
# super simple. Download and pipe to bash, e.g.:
# #
# curl https://.../bootstrap.sh | sudo bash # curl https://.../bootstrap.sh | sudo bash
# #
################################################################ #########################################################
# What is the current version?
if [ -z "$TAG" ]; then if [ -z "$TAG" ]; then
TAG=v0.08 TAG=v0.09
fi fi
# Are we running as root? # Are we running as root?
@@ -38,6 +35,17 @@ fi
# Change directory to it. # Change directory to it.
cd $HOME/mailinabox cd $HOME/mailinabox
# Run the upgrade script, which in turn runs the setup script. # Update it.
setup/upgrade.sh $TAG if [ "$TAG" != `git describe` ]; then
echo Updating Mail-in-a-Box to $TAG . . .
git fetch --depth 1 --force --prune origin tag $TAG
if ! git checkout -q $TAG; then
echo "Update failed. Did you modify something in `pwd`?"
exit
fi
echo
fi
# Start setup script.
setup/start.sh

View File

@@ -65,6 +65,8 @@ tools/editconf.py /etc/postfix/main.cf \
# * Do not add the OpenDMAC Authentication-Results header. That should only be added # * Do not add the OpenDMAC Authentication-Results header. That should only be added
# on incoming mail. Omit the OpenDMARC milter by re-setting smtpd_milters to the # on incoming mail. Omit the OpenDMARC milter by re-setting smtpd_milters to the
# OpenDKIM milter only. See dkim.sh. # OpenDKIM milter only. See dkim.sh.
# * Even though we dont allow auth over non-TLS connections (smtpd_tls_auth_only below, and without auth the client cant
# send outbound mail), don't allow non-TLS mail submission on this port anyway to prevent accidental misconfiguration.
# * Require the best ciphers for incoming connections per http://baldric.net/2013/12/07/tls-ciphers-in-postfix-and-dovecot/. # * Require the best ciphers for incoming connections per http://baldric.net/2013/12/07/tls-ciphers-in-postfix-and-dovecot/.
# By putting this setting here we leave opportunistic TLS on incoming mail at default cipher settings (any cipher is better than none). # By putting this setting here we leave opportunistic TLS on incoming mail at default cipher settings (any cipher is better than none).
# * Give it a different name in syslog to distinguish it from the port 25 smtpd server. # * Give it a different name in syslog to distinguish it from the port 25 smtpd server.
@@ -75,7 +77,8 @@ tools/editconf.py /etc/postfix/master.cf -s -w \
"submission=inet n - - - - smtpd "submission=inet n - - - - smtpd
-o syslog_name=postfix/submission -o syslog_name=postfix/submission
-o smtpd_milters=inet:127.0.0.1:8891 -o smtpd_milters=inet:127.0.0.1:8891
-o smtpd_tls_ciphers=high -o smtpd_tls_protocols=!SSLv2,!SSLv3 -o smtpd_tls_security_level=encrypt
-o smtpd_tls_ciphers=high -o smtpd_tls_exclude_ciphers=aNULL,DES,3DES,MD5,DES+MD5,RC4 -o smtpd_tls_protocols=!SSLv2,!SSLv3
-o cleanup_service_name=authclean" \ -o cleanup_service_name=authclean" \
"authclean=unix n - - - 0 cleanup "authclean=unix n - - - 0 cleanup
-o header_checks=pcre:/etc/postfix/outgoing_mail_header_filters" -o header_checks=pcre:/etc/postfix/outgoing_mail_header_filters"
@@ -94,6 +97,8 @@ tools/editconf.py /etc/postfix/main.cf \
smtpd_tls_cert_file=$STORAGE_ROOT/ssl/ssl_certificate.pem \ smtpd_tls_cert_file=$STORAGE_ROOT/ssl/ssl_certificate.pem \
smtpd_tls_key_file=$STORAGE_ROOT/ssl/ssl_private_key.pem \ smtpd_tls_key_file=$STORAGE_ROOT/ssl/ssl_private_key.pem \
smtpd_tls_dh1024_param_file=$STORAGE_ROOT/ssl/dh2048.pem \ smtpd_tls_dh1024_param_file=$STORAGE_ROOT/ssl/dh2048.pem \
smtpd_tls_ciphers=medium \
smtpd_tls_exclude_ciphers=aNULL \
smtpd_tls_received_header=yes smtpd_tls_received_header=yes
# Prevent non-authenticated users from sending mail that requires being # Prevent non-authenticated users from sending mail that requires being

View File

@@ -20,14 +20,13 @@ apt_get_quiet upgrade
# * cron: Runs background processes periodically. # * cron: Runs background processes periodically.
# * ntp: keeps the system time correct # * ntp: keeps the system time correct
# * fail2ban: scans log files for repeated failed login attempts and blocks the remote IP at the firewall # * fail2ban: scans log files for repeated failed login attempts and blocks the remote IP at the firewall
# * gpg: used by upgrade.sh to verify the Mail-in-a-Box tag signature, also by duplicity to make backups
# * git: we install some things directly from github # * git: we install some things directly from github
# * sudo: allows privileged users to execute commands as root without being root # * sudo: allows privileged users to execute commands as root without being root
# * coreutils: includes `nproc` tool to report number of processors # * coreutils: includes `nproc` tool to report number of processors
# * bc: allows us to do math to compute sane defaults # * bc: allows us to do math to compute sane defaults
apt_install python3 python3-dev python3-pip \ apt_install python3 python3-dev python3-pip \
wget curl gpg git sudo coreutils bc \ wget curl git sudo coreutils bc \
haveged unattended-upgrades cron ntp fail2ban haveged unattended-upgrades cron ntp fail2ban
# Allow apt to install system updates automatically every day. # Allow apt to install system updates automatically every day.

View File

@@ -1,88 +0,0 @@
#!/bin/bash
# Updates an existing Mail-in-a-Box installation to a newer tag.
################################################################
# Are we running as root?
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root. Did you leave out sudo?"
exit
fi
# Was a tag specified on the command line?
TAG=$1
if [ -z "$TAG" ]; then
echo "Usage: setup/upgrade.sh TAGNAME"
exit 1
fi
# Is Mail-in-a-Box already installed?
if [ ! -d $HOME/mailinabox ]; then
echo Could not find your Mail-in-a-Box installation at $HOME/mailinabox.
exit 1
fi
# Change directory to it.
cd $HOME/mailinabox
# Are we on that tag?
if [ "$TAG" == `git describe` ]; then
echo "You already have Mail-in-a-Box $TAG. Run"
echo " sudo setup/start.sh"
echo "if there are any problems."
exit 1
fi
# Fetch that tag.
# bootstrap.sh script makes a shallow clone of our repository,
# which makes the download faster, but it also makes it harder
# to switch to a different tag. This magic combination of options
# to git seems to do the trick.
echo Updating Mail-in-a-Box to $TAG . . .
git fetch --depth 1 --force --prune origin tag $TAG
# Check that the tag exists and we're moving to a later version, not backwards.
CUR_VER_TIMESTAMP=$(git show -s --format="%ct") # commit time of HEAD
NEW_VER_TIMESTAMP=$(git show -s --format="%ct" $TAG^{tag}^{commit}) # commit time of the commit that the tag tags
if [ -z "$NEW_VER_TIMESTAMP" ]; then echo "$TAG is not a version of Mail-in-a-Box."; exit 1; fi
if [ $CUR_VER_TIMESTAMP -gt $NEW_VER_TIMESTAMP ]; then
echo -n "$TAG is older than the version you currently have installed: "
git describe
exit 1
fi
# Set up a temporary GPG keyring specifically for holding the
# Mail-in-a-Box maintainer's signing key. Load the keys found
# in the Mail-in-a-Box installation path. These keys are trusted
# in so far as the user has already gotten them. On first installs,
# we just bootstrap by assuming whatever is in github is good.
KEYRING=/tmp/miab-upgrade-keyring
rm -rf $KEYRING
mkdir -p $KEYRING
for key in `find keys/ -type f`; do
GNUPGHOME=$KEYRING gpg --import $key
done
# Prior to checking out the tag, verify that it was signed by a
# known key. gpg will return a success exit code if the tag is
# signed by any key known to gpg, whether trusted or not, which
# is why we establish a separate keyring for this purpose.
if ! GNUPGHOME=$KEYRING git verify-tag $TAG 2>&1 > /dev/null; then
echo "$TAG was not signed by the Mail-in-a-Box authors. This could"
echo "indicate the github repository has been compromised. Check"
echo "https://twitter.com/mailinabox and https://mailinabox.email/"
echo "for further instructions, although keep in mind that those"
echo "resources could be compromised as well."
exit 1
fi
# Clean up.
rm -rf $KEYRING
# Checkout the tag.
if ! git checkout -q $TAG; then
echo "Update failed. Did you modify something in `pwd`?"
exit
fi
# Start setup script.
setup/start.sh