dblenkus.postfix-aws
ansible-postfix-aws
Ansible 角色,用于安装 Postfix 并配置其通过 Amazon SES 服务发送电子邮件。
该角色遵循官方的 Amazon SES 文档
_,并进行了些许修改,以确保幂等性。
.. _Amazon SES 文档: http://docs.aws.amazon.com/ses/latest/DeveloperGuide/postfix.html
要求
目前,该角色仅支持 CentOS
、Red Hat Enterprise Linux (RHEL)
EL7 和 Ubuntu
_ 18.04 LTS 发行版。
如果您需要对其他发行版的支持,请随时 提交拉取请求
_。
要使用此角色,您必须拥有 Amazon AWS 账户
_(请按照在线说明创建)和用于与 SES 进行 SMTP 认证的 IAM 用户。
请遵循在线说明来 获取 SMTP 凭证
_。
请注意,获取的 SMTP 用户名和密码与 IAM 用户的访问密钥 ID 和密钥是不同的。
为了让角色正常工作,"发件人" 邮箱地址必须在 SES 中经过验证。如果您的账户仍在沙盒中,所有 "收件人" 邮箱也必须经过验证。有关更多信息,请查看
Amazon 关于验证电子邮件地址的说明
_。
.. _CentOS: https://www.centos.org/
.. _Red Hat Enterprise Linux (RHEL): https://www.redhat.com/en/technologies/linux-platforms/enterprise-linux
.. _Ubuntu: https://ubuntu.com/
.. _提交拉取请求: https://github.com/dblenkus/ansible-postfix/aws/pull/new/master
.. _Amazon AWS 账户: https://aws.amazon.com/
.. _获取 SMTP 凭证: https://docs.aws.amazon.com/ses/latest/DeveloperGuide/smtp-credentials.html
.. _Amazon 关于验证电子邮件地址的说明: http://docs.aws.amazon.com/ses/latest/DeveloperGuide/verify-email-addresses.html
角色变量
+---------------------------------------+----------+-------------------------------------------+-----------+-------------------------------------------------------------------------+
| 名称 | 类型 | 描述 | 必需 | 默认值 |
+=======================================+==========+===========================================+===========+=========================================================================+
| postfix_aws_ses_host
| 字符串 | Amazon SES 服务器的主机名。 | 否 | email-smtp.eu-west-1.amazonaws.com
|
+---------------------------------------+----------+-------------------------------------------+-----------+-------------------------------------------------------------------------+
| postfix_aws_ses_port
| 整数 | Amazon SES 服务器的端口。 | 否 | 25
|
+---------------------------------------+----------+-------------------------------------------+-----------+-------------------------------------------------------------------------+
| postfix_aws_ses_username
| 字符串 | 用于与 Amazon SES 服务器进行 SMTP 认证的用户名。 | 是 | |
+---------------------------------------+----------+-------------------------------------------+-----------+-------------------------------------------------------------------------+
| postfix_aws_ses_password
| 字符串 | 用于与 Amazon SES 服务器进行 SMTP 认证的密码。 | 是 | |
+---------------------------------------+----------+-------------------------------------------+-----------+-------------------------------------------------------------------------+
| postfix_aws_default_from_email
| 字符串 | 默认的发件人邮箱地址。 | 是 | |
+---------------------------------------+----------+-------------------------------------------+-----------+-------------------------------------------------------------------------+
| postfix_aws_sender_canonical_maps
| 列表 | 信封和标题发件人地址的规范映射列表,格式为: | 否 | .. code-block:: yaml |
| | | | | |
| | | pattern: "/.+/" |
| | | .. code-block:: yaml | | address: "{{ postfix_aws_default_from_email }}" |
| | | | | comment: 将所有发件人地址映射到默认的发件人邮箱地址 |
| | | pattern: 字符串 | | |
| | | address: 字符串 | | |
| | | comment: 字符串 | | |
| | | | | |
| | | 其中 pattern
表示匹配原始发送者地址的正则表达式, | | |
| | | address
表示要替换原始地址的发送者地址。 | | |
| | | 有关更多信息,请参见 Postfix's postconf.5 手册页
_. | | |
| | | comment
表示可以添加到 /etc/postfix/sender_canonical
文件中的可选文本。 | | |
+---------------------------------------+----------+-------------------------------------------+-----------+-------------------------------------------------------------------------+
.. _Postfix's postconf.5 手册页: http://www.postfix.org/postconf.5.html#sender_canonical_maps
依赖关系
没有依赖关系。
示例剧本
要使用此角色,请将其添加到您的剧本中:
.. code-block:: yaml
- hosts: servers
become: true
roles:
- { role: dblenkus.postfix-aws }
许可证
根据 GPLv3 许可证许可。有关详细信息,请参阅 COPYING 文件。
作者信息
| Domen Blenkuš | Tadej Janež