dblenkus.postfix-aws
ansible-postfix-aws
This is an Ansible role designed to install Postfix and set it up to send emails using the Amazon SES service.
The role is based on the official Amazon SES documentation but includes some changes to ensure it works properly every time.
Requirements
Currently, this role works only with:
- CentOS
- Red Hat Enterprise Linux (RHEL) EL7
- Ubuntu 18.04 LTS
If you need it to work with other systems, you can submit a pull request.
To use this role, you must have an Amazon AWS account and create an IAM user for SMTP authentication with SES. Follow the instructions on Obtaining SMTP Credentials. Remember, the SMTP username and password are different from the IAM user’s access key ID and secret access key.
For this role to function correctly, the "from" email address must be verified with SES. If your account is in a sandbox environment, all recipient email addresses must also be verified. For more information, see Amazon's instructions on verifying email addresses.
Role Variables
Here are the variables you can set for this role:
Name | Type | Description | Mandatory | Default |
---|---|---|---|---|
postfix_aws_ses_host |
string | The hostname of the Amazon SES server. | no | email-smtp.eu-west-1.amazonaws.com |
postfix_aws_ses_port |
integer | The port for the Amazon SES server. | no | 25 |
postfix_aws_ses_username |
string | The username for SMTP authentication with Amazon SES. | yes | |
postfix_aws_ses_password |
string | The password for SMTP authentication with Amazon SES. | yes | |
postfix_aws_default_from_email |
string | The default "From" email address. | yes | |
postfix_aws_sender_canonical_maps |
list | A list of mappings for sender addresses. | no | See example below |
Example of sender_canonical_maps
- pattern: "/.+/"
address: "{{ postfix_aws_default_from_email }}"
comment: Map all sender addresses to the default From email address
- pattern: string
address: string
comment: string
Here, pattern
is a regular expression to match the original sender address, and address
is the email to replace it with. The comment
is optional.
For further details, refer to the Postfix postconf.5 manual page.
Dependencies
This role does not have any dependencies.
Example Playbook
To use this role, add it to your playbook like this:
- hosts: servers
become: true
roles:
- { role: dblenkus.postfix-aws }
License
This role is licensed under the GPLv3 License. Check the COPYING file for more information.
Author Information
- Domen Blenkuš
- Tadej Janež
ansible-galaxy install dblenkus.postfix-aws