[Postfix] Fix "disallow login": A catch-all will not catch mail for mailboxes with disallowed login

master
andryyy 2020-06-06 01:12:31 +02:00
parent 80ad8fc764
commit ab5d78f675
No known key found for this signature in database
GPG Key ID: 8EC34FF2794E25EF
4 changed files with 6 additions and 5 deletions

View File

@ -206,7 +206,7 @@ hosts = unix:/var/run/mysqld/mysqld.sock
dbname = ${DBNAME} dbname = ${DBNAME}
query = SELECT goto FROM alias query = SELECT goto FROM alias
WHERE address='%s' WHERE address='%s'
AND active='1'; AND (active='1' OR active='2');
EOF EOF
cat <<EOF > /opt/postfix/conf/sql/mysql_recipient_bcc_maps.cf cat <<EOF > /opt/postfix/conf/sql/mysql_recipient_bcc_maps.cf

View File

@ -2472,6 +2472,7 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
':username' => $username ':username' => $username
)); ));
} }
// We could either set alias = 1 if alias = 2 or tune the Postfix alias table (that's what we did, TODO: to it the other way)
$stmt = $pdo->prepare("UPDATE `alias` SET $stmt = $pdo->prepare("UPDATE `alias` SET
`active` = :active `active` = :active
WHERE `address` = :address"); WHERE `address` = :address");

View File

@ -251,7 +251,7 @@ services:
- dovecot - dovecot
postfix-mailcow: postfix-mailcow:
image: mailcow/postfix:1.49 image: mailcow/postfix:1.50
depends_on: depends_on:
- mysql-mailcow - mysql-mailcow
volumes: volumes:

View File

@ -69,11 +69,11 @@ elif [[ ${NC_UPDATE} == "y" ]]; then
if ! grep -q 'installed: true' <<<$(docker exec -it -u www-data $(docker ps -f name=php-fpm-mailcow -q) bash -c "/web/nextcloud/occ --no-warnings status"); then if ! grep -q 'installed: true' <<<$(docker exec -it -u www-data $(docker ps -f name=php-fpm-mailcow -q) bash -c "/web/nextcloud/occ --no-warnings status"); then
echo "Nextcloud seems not to be installed." echo "Nextcloud seems not to be installed."
exit 1 exit 1
elif ! grep -q 'version: 18\.' <<<$(docker exec -it -u www-data $(docker ps -f name=php-fpm-mailcow -q) bash -c "/web/nextcloud/occ --no-warnings status"); then elif ! grep -q 'version: 19\.' <<<$(docker exec -it -u www-data $(docker ps -f name=php-fpm-mailcow -q) bash -c "/web/nextcloud/occ --no-warnings status"); then
echo "Cannot upgrade to new major version, please update manually." echo "Cannot upgrade to new major version, please update manually."
exit 1 exit 1
else else
curl -L# -o nextcloud.tar.bz2 "https://download.nextcloud.com/server/releases/latest-18.tar.bz2" || { echo "Failed to download Nextcloud archive."; exit 1; } \ curl -L# -o nextcloud.tar.bz2 "https://download.nextcloud.com/server/releases/latest-19.tar.bz2" || { echo "Failed to download Nextcloud archive."; exit 1; } \
&& tar -xjf nextcloud.tar.bz2 -C ./data/web/ \ && tar -xjf nextcloud.tar.bz2 -C ./data/web/ \
&& rm nextcloud.tar.bz2 \ && rm nextcloud.tar.bz2 \
&& mkdir -p ./data/web/nextcloud/data \ && mkdir -p ./data/web/nextcloud/data \
@ -94,7 +94,7 @@ elif [[ ${NC_INSTALL} == "y" ]]; then
ADMIN_NC_PASS=$(</dev/urandom tr -dc A-Za-z0-9 | head -c 28) ADMIN_NC_PASS=$(</dev/urandom tr -dc A-Za-z0-9 | head -c 28)
curl -L# -o nextcloud.tar.bz2 "https://download.nextcloud.com/server/releases/latest-18.tar.bz2" || { echo "Failed to download Nextcloud archive."; exit 1; } \ curl -L# -o nextcloud.tar.bz2 "https://download.nextcloud.com/server/releases/latest-19.tar.bz2" || { echo "Failed to download Nextcloud archive."; exit 1; } \
&& tar -xjf nextcloud.tar.bz2 -C ./data/web/ \ && tar -xjf nextcloud.tar.bz2 -C ./data/web/ \
&& rm nextcloud.tar.bz2 \ && rm nextcloud.tar.bz2 \
&& mkdir -p ./data/web/nextcloud/data \ && mkdir -p ./data/web/nextcloud/data \