Postfix main.cf Jinja2 Template

ansible-postfix · email, jinja2-template, smtp-config, tls-config, access-restrictions

Generates /etc/postfix/main.cf from role variables. Covers TLS (client and server), SASL auth maps, all canonical/transport/relay maps, restrictions, header checks, and raw options passthrough. Extensible via postfix_raw_options.

{{ ansible_managed | comment }}

# See /usr/share/postfix/main.cf.dist for a commented, more complete version

# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
myorigin = {{ postfix_mailname_file }}

smtpd_banner = {{ postfix_smtpd_banner }}
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no

{% if postfix_compatibility_level is defined %}
compatibility_level = {{ postfix_compatibility_level }}
{% endif %}

# TLS parameters
smtpd_tls_cert_file = {{ postfix_smtpd_tls_cert_file }}
smtpd_tls_key_file = {{ postfix_smtpd_tls_key_file }}
smtpd_use_tls = yes
{% if pos

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search 40K more like it.

Get a free API key