Skip to content

About

Ansible role cesnet.postfix for installing Postfix MTA

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

30 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

postfix

Ansible role for installation of Postfix on Debian 11+.

For dockerized environment be sure to set postfix_with_docker: true and set name of your docker network in postfix_docker_bridge_network_name.

Set alias for root account in postfix_root_email_address.

Role vars:

Variable Description
postfix_myhostname FQDN of server, used by Postfix to identify itself in SMTP communication, eg: smtp.example.com
postfix_mydomain Domain name of server, usually the part after the first dot in postfix_myhostname; default {{ postfix_myhostname }}
postfix_myorigin Domain appended to outgoing mails with "To:" without a domain; default {{ postfix_mydomain }}.
postfix_relayhost Optional SMTP relay through which all outgoing mails are sent (e.g., [smtp.example.com]:587).
postfix_use_certs If true, enables TLS certificates for securing SMTP connections.
postfix_use_login If true, enables SMTP authentication with username and password.
postfix_smtp_tls_cert_file Path to the TLS certificate file used by Postfix.
postfix_smtp_tls_key_file Path to the private key file used by Postfix.
postfix_smtp_tls_security_level TLS security mode for SMTP connections (e.g., encrypt, may).
postfix_smtp_password Password for SMTP authentication.
postfix_smtp_username Username for SMTP authentication.
postfix_sasl_passwd SASL credentials for relay host in format: relayhost username:password. Built automatically as {{ postfix_relayhost }} {{ postfix_smtp_username }}:{{ postfix_smtp_password }}.
postfix_canonical_email Address replacing "From/To" for local senders/recipients root and perun (even /etc/aliases is ignored).
postfix_generic_email Address replacing "From" for local senders root and perun (eg. root@fqdn -> support@example.com). Usefull when your host FQDN doesn't have valid SPF, DKIM and you want to replace it with a correct email address (eg. real address acceptable by another relay)
postfix_docker_bridge_network_name Name of the Docker bridge network Postfix should bind to (if running along side Docker and apps in docker should send emails).
postfix_testing_email Address for sending testing email to.
postfix_root_email_address Comma-separated list of addresses used as alias for local root account

Simple Example Playbook

- hosts: all
  roles:
    - cesnet.postfix

Example of More Complex Playbook

- hosts:
    - "some-random-name.example.com"
  vars:
    postfix_myhostname: "mail.example.com"
    postfix_mydomain: "example.com"
    postfix_myorigin: "{{ postfix_mydomain }}"
    postfix_relayhost: "[smtp.relay.com]:587"
    postfix_use_certs: false
    postfix_use_login: false
    postfix_smtp_tls_cert_file: "/etc/ssl/certs/mail.crt"
    postfix_smtp_tls_key_file: "/etc/ssl/private/mail.key"
    postfix_smtp_tls_security_level: "encrypt"
    postfix_smtp_username: "relayuser_example"
    postfix_smtp_password: "supersecret"
    postfix_canonical_email: "noreply@example.com"
    postfix_generic_email: "test@example.com"
    postfix_for_docker_bridge_network_name: "postfix_network"
    postfix_sasl_passwd: "{{ postfix_relayhost }} {{ postfix_smtp_username }}:{{ postfix_smtp_password }}"   
    postfix_testing_email: testing@email.com
  roles:
    - cesnet.postfix

About

Ansible role cesnet.postfix for installing Postfix MTA

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages