From 0e62604dd8866fb5ad69492bd5d5c996fd717a8c Mon Sep 17 00:00:00 2001 From: phil Date: Mon, 16 Oct 2023 14:46:47 +0200 Subject: [PATCH] Enable configurarion of header checks --- tasks/postfix.yml | 2 +- .../postfix/conf.d/header_checks.j2 | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) rename files/postfix/conf.d/header_checks => templates/postfix/conf.d/header_checks.j2 (70%) diff --git a/tasks/postfix.yml b/tasks/postfix.yml index caa2097..0b9b4c1 100644 --- a/tasks/postfix.yml +++ b/tasks/postfix.yml @@ -27,7 +27,6 @@ dest: "{{ postfix_conf_dir }}/{{ item }}" mode: "0644" loop: - - header_checks - header_checks_inbound - name: "Postfix | Copy lookup tables from templates" @@ -42,6 +41,7 @@ - name: client_checks - name: destination_limit - name: header_add + - name: header_checks - name: header_treatment - name: helo_checks - name: permit_sasl_login_mismatch diff --git a/files/postfix/conf.d/header_checks b/templates/postfix/conf.d/header_checks.j2 similarity index 70% rename from files/postfix/conf.d/header_checks rename to templates/postfix/conf.d/header_checks.j2 index 771ccc6..e3c1ca3 100644 --- a/files/postfix/conf.d/header_checks +++ b/templates/postfix/conf.d/header_checks.j2 @@ -8,3 +8,9 @@ ops|pcd|pif|prf|reg|sc[frt]|sh[bsm]|swf| vb[esx]?|vxd|ws[cfh]))(\?=)?"?\s*(;|$)/x REJECT Attachment name "$2" may not end with ".$4" + +{% if postfix_header_checks is defined %} +{% for header in postfix_header_checks %} +{{ "%-50s %s" | format(header.header, header.action) }} +{% endfor %} +{% endif %}