c345bd553853d14e3897912345036e7093ebf647
We had a stray letter in a configuration field intended to be used for port numbers which resulted in port numbers such as 587c where the letter tripped up Postfix' SMTP client which in turn caused it to exit early. Any e-mail stuck in queue to be sent upstream would remain stuck indefinitely as no connection was possible. We're opting to not implement a config test. A 'postfix check' will not find such issues and a service restart via an Ansible handler will work without issues. Postfix will only complain about such an issue when connecting its client to the upstream server for real mail delivery. Any detection or validation mechanism would require the same real-life test of sending an e-mail. At this time its appears saner to not implement a test rather than implementing an invasive test.
Role Name
role-common-send_only_mta
Description
Configure Postfix on Debian as a send-only Mail Transfer Agent.
Requirements
Your target machines must be Debian.
Role Variables
Per defaults/main.yml this role expects both a recipient e-mail address and login credentials for an SMTP mail submission server to be available in a HashiCorp Vault instance. Feel free to override these variables as needed with host or group vars. If you stick with HashiCorp Vault the default path for SMTP credentials is settings/comms/e-mail/default/sender, the default path for a recipient address is settings/comms/e-mail/default/recipient.
Sender data
addr-spec: Your sender e-mail address rendered as an RFC 2822addr-specstring such asnoreply@example.com.credentials-password-sasl-smtp-auth-login: A password that Postfix will use to log in to the SMTP mail submission server via theAUTH LOGINSMTP SASL authentication mechanism.credentials-username: The SMTP username needed to log in to the SMTP mail submission server.submission-server-fqdn: Your upstream SMTP mail submission server's fully qualified domain name such assmtp.example.com.submission-server-port: The TCP port you want Postfix to use to connect to the SMTP mail submission server.
Recipient data
addr-spec: Same as above, a recipient e-mail address rendered as an RFC 2822addr-specstring such asnoreply@example.com.
Dependencies
None.
Example Playbook
In your playbook.yml call it like so:
- name: 'Awesome playbook'
hosts: all
roles:
- 'role-common-send_only_mta'
License
MIT
Languages
Jinja
100%