Compare commits

..
1 Commits
Author SHA1 Message Date
3wordchant 496fd6d5ea Attempt at ARC/DKIM signing for mailman 2023-09-30 21:55:19 +01:00
16 changed files with 49 additions and 119 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ steps:
from_secret: drone_abra-bot_token
fork: true
repositories:
- toolshed/auto-recipes-catalogue-json
- coop-cloud/auto-recipes-catalogue-json
trigger:
event: tag
-3
View File
@@ -31,9 +31,6 @@ TRAEFIK_STACK_NAME=traefik_example_com
# OPTIONAL SETTINGS #
###############################################################################
# Uncomment this to reënable STARTTLS, although beware the health warnings here: https://nostarttls.secvuln.info/
#PORTS=25,80,443,465,993,995,4190,110,143,587
# Name of the instance, displayed in the web UI
SITENAME=mymail
+2 -19
View File
@@ -25,28 +25,11 @@ host.
4. `abra app config YOURAPPDOMAIN` - be sure to change `$WEB_DOMAIN` to something that resolves to
your Docker swarm box
5. `abra app deploy YOURAPPDOMAIN`
6. Create initial user:
9. Create initial user:
```
abra app run YOURDOMAIN admin flask mailu admin admin YOURDOMAIN YOURPASSWORD
abra app YOURAPPDOMAIN run admin flask mailu admin admin YOURDOMAIN YOURPASSWORD
```
## Upgrading the recipe
**NOTE** This section is only intended for [recipe maintainers][maintainers]
Minor/patch updates usually work OK with `abra recipe upgrade` and friends.
For major updates:
1. Go to https://setup.mailu.io/ and generate a new config
2. Download the new config and compare it to `compose.yml`. Pay attention to:
- New / removed services
- Added/removed config options
- Changes to networking
3. Test upgrading from the previous version to the new version
4. `abra recipe sync` / `abra recipe release` as normal
[Mailu]: https://mailu.io/
[abra]: https://git.autonomic.zone/autonomic-cooperative/abra
[compose-traefik]: https://git.autonomic.zone/coop-cloud/traefik
[maintainers]: https://docs.coopcloud.tech/maintainers/
+3 -2
View File
@@ -1,4 +1,5 @@
export CERTDUMPER_POST_VERSION=v1
export POSTFIX_OVERRIDE_VERSION=v17
export POSTFIX_OVERRIDE_VERSION=v15
export SENDER_LOGIN_VERSIONS=v2
export PG_BACKUP_VERSION=v1
export ARC_OVERRIDE_VERSION=v8
export DKIM_IP_MAP_OVERRIDE_VERSION=v2
+23 -1
View File
@@ -10,20 +10,42 @@ services:
- MAILMAN_POSTFIX_OVERRIDES
networks:
- default
- shared_mailman_network
volumes:
- "shared-mailman-core:/opt/mailman/"
configs:
- source: postfix_override
target: /overrides/postfix.cf
antispam:
configs:
- source: arc_conf_override
target: /overrides/arc.conf
- source: dkim_ip_map_override
target: /overrides/dkim_ip.map
volumes:
- "rspam_overrides:/etc/rspamd/override.d"
networks:
shared_mailman_network:
external: true
name: ${MAILMAN_CORE_NETWORK}
volumes:
# https://git.autonomic.zone/coop-cloud/mailman3/src/branch/master/compose.yml
shared-mailman-core:
external: true
name: ${MAILMAN_CORE_VOLUME}
rspam_overrides:
configs:
postfix_override:
name: ${STACK_NAME}_postfix_overrides_${POSTFIX_OVERRIDE_VERSION}
file: postfix.cf.tmpl
file: mailman-postfix.cf.tmpl
template_driver: golang
arc_conf_override:
name: ${STACK_NAME}_arc_conf_override_${ARC_OVERRIDE_VERSION}
file: mailman-arc.conf
dkim_ip_map_override:
name: ${STACK_NAME}_dkim_ip_map_${DKIM_IP_MAP_OVERRIDE_VERSION}
file: mailman-dkim_ip.map.tmpl
template_driver: golang
+9 -27
View File
@@ -51,11 +51,10 @@ x-environment:
- WELCOME_BODY
- WELCOME_SUBJECT
- TZ
- PORTS
services:
app:
image: ghcr.io/mailu/nginx:2024.06.66
image: ghcr.io/mailu/nginx:2.0.23
logging:
driver: json-file
networks:
@@ -96,25 +95,15 @@ services:
- "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`)"
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
- "backupbot.backup=true"
- "coop-cloud.${STACK_NAME}.version=3.2.1+2024.06.66"
- "coop-cloud.${STACK_NAME}.version=1.0.2+2.0.23"
db:
image: redis:8.10.2-alpine
image: redis:7.2.0-alpine
volumes:
- "redis:/data"
deploy:
labels:
backupbot.backup.pre-hook: "/pg_backup.sh backup"
backupbot.backup.volumes.postgres.path: "backup.sql"
backupbot.backup.post-hook: "/pg_backup.sh restore"
configs:
- source: pg_backup
target: /pg_backup.sh
mode: 0555
admin:
image: ghcr.io/mailu/admin:2024.06.66
image: ghcr.io/mailu/admin:2.0.23
environment: *default-env
healthcheck:
disable: true
@@ -125,12 +114,9 @@ services:
- "mailu:/data"
networks:
- default
deploy:
labels:
- "backupbot.backup=true"
imap:
image: ghcr.io/mailu/dovecot:2024.06.66
image: ghcr.io/mailu/dovecot:2.0.23
environment: *default-env
secrets:
- secret_key
@@ -144,7 +130,7 @@ services:
- default
smtp:
image: ghcr.io/mailu/postfix:2024.06.66
image: ghcr.io/mailu/postfix:2.0.23
environment: *default-env
secrets:
- secret_key
@@ -156,7 +142,7 @@ services:
- app
antispam:
image: ghcr.io/mailu/rspamd:2024.06.66
image: ghcr.io/mailu/rspamd:2.0.23
environment: *default-env
secrets:
- secret_key
@@ -167,8 +153,7 @@ services:
disable: true
webmail:
image: ghcr.io/mailu/webmail:2024.06.66
# entrypoint: "tail -f /dev/null"
image: ghcr.io/mailu/webmail:2.0.23
environment: *default-env
networks:
- default
@@ -182,7 +167,7 @@ services:
disable: true
certdumper:
image: ldez/traefik-certs-dumper:v2.11.4
image: ldez/traefik-certs-dumper:v2.8.1
entrypoint: sh -c '
apk add jq
; while ! [ -e /traefik/${ACME_JSON} ]
@@ -234,9 +219,6 @@ configs:
certdumper_post:
name: ${STACK_NAME}_certdumper_post_${CERTDUMPER_POST_VERSION}
file: certdumper_post.sh
pg_backup:
name: ${STACK_NAME}_pg_backup_${PG_BACKUP_VERSION}
file: pg_backup.sh
secrets:
secret_key:
+2
View File
@@ -0,0 +1,2 @@
type=console
debug_modules=dkim
+7
View File
@@ -0,0 +1,7 @@
sign_networks = "/overrides/dkim_ip.map";
path = "/dkim/$domain.$selector.key";
use_domain = "header";
#use_vault = false;
#try_fallback = true;
#selector_map = "/overrides/dkim_selectors.map";
#selector = "dkim";
+1
View File
@@ -0,0 +1 @@
{{ env "RELAYNETS" }}
+1 -1
View File
@@ -10,9 +10,9 @@
unknown_local_recipient_reject_code = 550
owner_request_special = no
virtual_mailbox_maps = regexp:/opt/mailman/var/data/postfix_lmtp, \${podop}mailbox
transport_maps = regexp:/opt/mailman/var/data/postfix_lmtp \${podop}transport
local_recipient_maps = regexp:/opt/mailman/var/data/postfix_lmtp
relay_domains = regexp:/opt/mailman/var/data/postfix_domains \${podop}transport
{{ end }}
{{ if eq (env "SENDER_LOGINS_POSTFIX_OVERRIDES") "1" }}
# https://github.com/Mailu/Mailu/issues/1096
-36
View File
@@ -1,36 +0,0 @@
#!/bin/bash
set -e
BACKUP_FILE='/var/lib/postgresql/data/backup.sql'
# TODO: this recipe doesn't have a db_password secret.
function backup {
export PGPASSWORD=$(cat /run/secrets/db_password)
pg_dump -U ${POSTGRES_USER} ${POSTGRES_DB} > $BACKUP_FILE
}
function restore {
cd /var/lib/postgresql/data/
restore_config(){
# Restore allowed connections
cat pg_hba.conf.bak > pg_hba.conf
su postgres -c 'pg_ctl reload'
}
# Don't allow any other connections than local
cp pg_hba.conf pg_hba.conf.bak
echo "local all all trust" > pg_hba.conf
su postgres -c 'pg_ctl reload'
trap restore_config EXIT INT TERM
# Recreate Database
psql -U ${POSTGRES_USER} -d postgres -c "DROP DATABASE ${POSTGRES_DB} WITH (FORCE);"
createdb -U ${POSTGRES_USER} ${POSTGRES_DB}
psql -U ${POSTGRES_USER} -d ${POSTGRES_DB} -1 -f $BACKUP_FILE
trap - EXIT INT TERM
restore_config
}
$@
-18
View File
@@ -1,18 +0,0 @@
# Secret key
The secret key is now stored as a docker secret instead of a variable in the
env file. You need to insert it by running:
`abra app secret insert <your mailu app> secret_key v1 <SECRETKEYHERE>`
and you can remove `SECRET_KEY` from your config file.
# `DOMAIN` is now `MAIL_DOMAIN`
This is important! If your main e-mail domain is something else than the
domain you are reaching the web interface at, you need to make changes.
I.e. in our setup we have `autonomic.zone` pointing an A record at some server
and `mail.autonomic.zone` is a separate server, and MX records are pointing
to the server at `mail.autonomic.zone`.
In this case:
- `DOMAIN` should be `mail.autonomic.zone` - this is what traefik will use to
provision a certificate
- `MAIL_DOMAIN` should be `autonomic.zone`
-3
View File
@@ -1,3 +0,0 @@
ALERTA! 🚨 Mailu has dropped support for STARTTLS by default – see details here: https://mailu.io/2024.06/releases.html#starttls-ports-disabled-by-default
If you are relying on STARTTLS, e.g. SMTP port 587, please copy the example `PORTS` variable from `~/.abra/recipes/mailu/.env.example` BEFORE deploying.
-1
View File
@@ -1 +0,0 @@
Contains mitigation measures for php2shell
-1
View File
@@ -1 +0,0 @@
Actual mitigation for php2shell pending further alpine image upgrades
-6
View File
@@ -1,6 +0,0 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:recommended"
]
}