Changeset - 776dde4d751e
[Not reviewed]
0 4 0
Branko Majic (branko) - 2 months ago 2024-02-29 21:38:13
branko@majic.rs
MAR-192: Update compatibility-related entries for Postfix main configuration file:

- Default value for append_dot_mydomain has been "no" for a while now,
no need to set it explicitly.
- Prefer the whitelist/blacklist instead of allowlist/denylist
keywords in logs.
4 files changed with 47 insertions and 10 deletions:
0 comments (0 inline, 0 general)
roles/mail_forwarder/molecule/default/tests/test_default.py
Show inline comments
 
import os
 
import re
 

	
 
import testinfra.utils.ansible_runner
 

	
 
@@ -64,6 +65,22 @@ def test_postfix_main_cf_file(host):
 
    assert config.mode == 0o644
 

	
 

	
 
def test_postfix_main_configuration_is_valid(host):
 
    """
 
    Tests if Postfix main configuration is valid and not producing any
 
    warnings.
 
    """
 

	
 
    postconf = host.run('/usr/sbin/postconf')
 

	
 
    # Clean-up the SSH warning from the beginning of stderr if
 
    # present.
 
    stderr = re.sub("^Warning: Permanently added.*?\r\n", "", postconf.stderr)
 

	
 
    assert postconf.rc == 0
 
    assert stderr == ""
 

	
 

	
 
def test_services(host):
 
    """
 
    Tests if all the necessary services are enabled and running.
roles/mail_forwarder/templates/main.cf.j2
Show inline comments
 
@@ -23,10 +23,6 @@ inet_protocols = all
 
# fails. Useful for local overrides of mail servers.
 
smtp_host_lookup = dns, native
 

	
 
# Do not append server's domain to locally sent mail. This is up to
 
# sending MUAs to take care of.
 
append_dot_mydomain = no
 

	
 
# Recipient delimeter for separating user name from its extension.
 
recipient_delimiter = +
 

	
 
@@ -36,9 +32,15 @@ message_size_limit = {{ mail_message_size_limit }}
 
# Disable output of Postfix README file paths when invoking postconf.
 
readme_directory = no
 

	
 
{% if ansible_distribution_release != 'bullseye' %}
 
# Use whitelist/blacklist instead of allowlist/denylist in log
 
# entries.
 
respectful_logging = no
 
{% endif %}
 

	
 
# Compatibility level for default values. For more details, see:
 
#     https://www.postfix.org/COMPATIBILITY_README.html
 
compatibility_level = 2
 
compatibility_level = 3.6
 

	
 

	
 
# Local mailbox delivery
roles/mail_server/molecule/default/tests/test_default.py
Show inline comments
 
@@ -229,6 +229,22 @@ def test_postfix_main_cf_file(host):
 
    assert config.mode == 0o644
 

	
 

	
 
def test_postfix_main_configuration_is_valid(host):
 
    """
 
    Tests if Postfix main configuration is valid and not producing any
 
    warnings.
 
    """
 

	
 
    postconf = host.run('/usr/sbin/postconf')
 

	
 
    # Clean-up the SSH warning from the beginning of stderr if
 
    # present.
 
    stderr = re.sub("^Warning: Permanently added.*?\r\n", "", postconf.stderr)
 

	
 
    assert postconf.rc == 0
 
    assert stderr == ""
 

	
 

	
 
def test_postfix_delivery_to_dovecot(host):
 
    """
 
    Tests if mail received by Postfix is properly delivered to Dovecot.
roles/mail_server/templates/main.cf.j2
Show inline comments
 
@@ -23,10 +23,6 @@ inet_protocols = all
 
# fails. Useful for local overrides of mail servers.
 
smtp_host_lookup = dns, native
 

	
 
# Do not append server's domain to locally sent mail. This is up to
 
# sending MUAs to take care of.
 
append_dot_mydomain = no
 

	
 
# Recipient delimeter for separating user name from its extension.
 
recipient_delimiter = +
 

	
 
@@ -40,9 +36,15 @@ message_size_limit = {{ mail_message_size_limit }}
 
# Disable output of Postfix README file paths when invoking postconf.
 
readme_directory = no
 

	
 
{% if ansible_distribution_release != 'bullseye' %}
 
# Use whitelist/blacklist instead of allowlist/denylist in log
 
# entries.
 
respectful_logging = no
 
{% endif %}
 

	
 
# Compatibility level for default values. For more details, see:
 
#     https://www.postfix.org/COMPATIBILITY_README.html
 
compatibility_level = 2
 
compatibility_level = 3.6
 

	
 

	
 
# Local mailbox delivery
0 comments (0 inline, 0 general)