Set-OPS-Public/roles/serveur_postfix/templates/setops-postfix-cert-sync.sh.j2
Daniel Allaire 9480e585a5 serveur_postfix (Postfix 3.x) : MTA edge-mta — cartes LDAP + LMTP + TLS step_ca
Réception :25, validation des boîtes par carte LDAP (attribut mail),
remise LMTP réseau vers le mail-store Dovecot (virtual_transport lmtp),
TLS via step_ca (pont de cert), aucune boîte locale. main.cf +
ldap-mailboxes.cf, validé par postfix check. Bind LDAP: vault_openldap_admin.

Validé statiquement (ansible-lint, syntax, rendu main.cf) ; déploiement à suivre.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-02 15:34:24 -04:00

19 lines
773 B
Django/Jinja

#!/bin/sh
# Géré par Set-OPS (rôle serveur_postfix). Ne pas éditer à la main.
# Synchronise le certificat step_ca (client_pki, root:root 600) vers Postfix, puis recharge.
# Idempotent ; appelé au déploiement ET au renouvellement (unité path). La clé est lisible
# par le groupe postfix (smtpd tourne sous postfix).
set -eu
SRC_CERT="{{ serveur_postfix_tls_source_cert }}"
SRC_KEY="{{ serveur_postfix_tls_source_cle }}"
DST="{{ serveur_postfix_tls_dir }}"
[ -f "$SRC_CERT" ] && [ -f "$SRC_KEY" ] || exit 0
install -o root -g root -m 0644 "$SRC_CERT" "$DST/cert.pem"
install -o root -g postfix -m 0640 "$SRC_KEY" "$DST/key.pem"
if systemctl --quiet is-active postfix 2>/dev/null; then
systemctl reload postfix 2>/dev/null || systemctl restart postfix
fi