Skip to content

Commit

Permalink
Merge pull request #5777 from freedomofpress/postfix_fix_for_focal
Browse files Browse the repository at this point in the history
Postfix fix for focal
  • Loading branch information
kushaldas committed Feb 10, 2021
2 parents 5cd42af + a578e55 commit 9a0a31f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions install_files/ansible-base/roles/postfix/templates/main.cf
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,7 @@ maximal_queue_lifetime = 14d
# Used to remap outbound from address in emails
smtp_generic_maps = hash:/etc/postfix/generic
{% endif %}
{% if ansible_distribution_release == 'focal' %}
# Restriction for client RCPT TO command, details at http://www.postfix.org/postconf.5.html#smtpd_recipient_restrictions
smtpd_recipient_restrictions = reject_unauth_destination
{% endif %}
6 changes: 6 additions & 0 deletions molecule/testinfra/mon/test_postfix.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ def test_postfix_generic_maps(host):
"""
assert not host.file("/etc/postfix/generic").exists
assert not host.file("/etc/postfix/main.cf").contains("^smtp_generic_maps")
if host.system_info.codename == "focal":
assert host.file("/etc/postfix/main.cf").contains(
"^smtpd_recipient_restrictions = reject_unauth_destination")
if host.system_info.codename == "xenial":
assert not host.file("/etc/postfix/main.cf").contains(
"^smtpd_recipient_restrictions = reject_unauth_destination")


def test_postfix_service(host):
Expand Down

0 comments on commit 9a0a31f

Please sign in to comment.