https://github.com/cesnet/ansible-role-postfix
Ansible role cesnet.postfix for installing Postfix MTA
https://github.com/cesnet/ansible-role-postfix
Last synced: about 1 month ago
JSON representation
Ansible role cesnet.postfix for installing Postfix MTA
- Host: GitHub
- URL: https://github.com/cesnet/ansible-role-postfix
- Owner: CESNET
- Created: 2025-07-14T10:09:54.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-08-18T08:16:57.000Z (7 months ago)
- Last Synced: 2025-08-18T08:28:02.823Z (7 months ago)
- Language: Jinja
- Size: 7.81 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
postfix
==========
Ansible role for install MTA Postfix on Debian 11+.
Role vars:
-------------
| Variable | Description |
|--------------------------------------------|-------------|
| `postfix_myhostname` | Fully Qualified Domain Name (FQDN) used by Postfix to identify itself in SMTP communication. |
| `postfix_mydomain` | Domain name of the server; usually the part after the first dot in `myhostname`. |
| `postfix_myorigin` | Domain appended to outgoing mail without a domain; typically `{{ postfix_mydomain }}`. |
| `postfix_relayhost` | Optional SMTP relay through which all outgoing mail is sent (e.g., `[smtp.example.com]:587`). |
| `use_certs` | If `true`, enables TLS certificates for securing SMTP connections. |
| `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_name` | Name used for canonical address mapping (rewriting sender name). |
| `postfix_canonical_email` | Email address used for canonical address mapping (rewriting sender email). |
| `postfix_generic_name` | Name used for generic address mapping (rewriting recipient name). |
| `postfix_generic_email` | Email address used for generic address mapping (rewriting recipient email). |
| `postfix_for_docker_bridge_network_name` | Name of the Docker bridge network Postfix should bind to (if running inside Docker). |
| `postfix_testing_email` | Email for sending testing email. |
## Simple Example Playbook
```yaml
- hosts: all
roles:
- cesnet.postfix
```
## Example of More Complex Playbook
```yaml
- hosts:
- "some-random-name.my-cloud.org"
vars:
postfix_myhostname: "mail.example.com"
postfix_mydomain: "example.com"
postfix_myorigin: "{{ postfix_mydomain }}"
postfix_relayhost: "[smtp.relay.com]:587"
use_certs: true
use_login: true
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_name: "Mail Server"
postfix_canonical_email: "noreply@example.com"
postfix_generic_name: "Postfix Test"
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: testint@email.com
roles:
- cesnet.postfix
```