repleo.postfix

repleo.postfix - 用于安装支持SSL和垃圾邮件过滤的Postfix SMTP的Ansible角色

构建状态 Ansible Galaxy

一个管理Postfix的Ansible角色。它允许您创建一个支持TLS/SSL和STARTSSL的完整SMTP服务器。还会安装Spamassassin进行垃圾邮件过滤,并附带10年垃圾邮件经验的贝叶斯数据库。

需求

目前仅在Ubuntu和Debian上进行测试。

变量

postfix_enabled: yes # 启用该角色

postfix_smtpd_use_tls: yes
postfix_myhostname: "{{inventory_hostname}}"
postfix_myorigin: $myhostname
postfix_smtp_sasl_auth_enable:
postfix_smtp_tls_cafile: "/etc/ssl/certs/Thawte_Premium_Server_CA.pem"
postfix_smtp_use_tls: yes

postfix_mailbox_size: 0
postfix_message_size: 50240000

# postfix_smtpd_auth_sasl_enable

postfix_relayhost:
postfix_mynetworks: "127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128"
postfix_inet_interfaces: loopback-only
postfix_mydestination: $mydomain, $myhostname, localhost.$mydomain, localhost
postfix_local_recipient_map: ""
postfix_relay_domains:

postfix_generic_maps: ""

# 邮件投递选项
postfix_use_maildrop: no
postfix_use_procmail: no

# 安装postfix_spf并设置postfix使用SPF
postfix_spf: no

# 安装opendkim并设置postfix使用DKIM
postfix_dkim: no
postfix_dkim_domains:
postfix_dkim_key_bits: 2048

# 安装opendmarc并设置postfix使用DMARC
postfix_dmarc: no
postfix_dmarc_host:
postfix_dmarc_domains:

# 将所有发往本地用户(例如root或cron)的邮件转发到另一个邮件地址
postfix_local_user_relay_address: ""

# 如果您使用一个不允许任意发件人地址的SMTP服务器进行转发,则此项很有用。
postfix_rewrite_sender_address: ""

# 当Postfix配置发生更改时,发送测试邮件到此地址
postfix_send_test_mail_to: ""

postfix_smtp_sasl_user: "{{ansible_ssh_user}}"
postfix_smtp_sasl_password: ""

# 队列
bounce_queue_lifetime: 1h
maximal_queue_lifetime: 1h
maximal_backoff_time: 15m
minimal_backoff_time: 5m
queue_run_delay: 5m

postfix_tls_generate: False
postfix_ssl_subject: ""
postfix_tls_cert_file: "/etc/ssl/certs/ssl-cert-snakeoil.pem"
postfix_tls_key_file: "/etc/ssl/private/ssl-cert-snakeoil.key"

用法

repleo.postfix添加到您的角色中,并在您的剧本文件中设置变量。

示例:

- hosts: all

  roles:
    - repleo.postfix

  vars:
    # Gmail的示例配置
    postfix_relayhost: "[smtp.gmail.com]:587"
    postfix_smtp_sasl_user: [email protected]
    postfix_smtp_sasl_password: mypassword
 - { role: repleo.postfix,
     postfix_mydestination: "repleo.nl, $mydomain, $myhostname, localhost.$mydomain, localhost",
     postfix_mynetworks: "127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128",
     postfix_inet_interfaces: all,
     postfix_use_maildrop: yes,
     postfix_smtpd_use_tls: yes,
     postfix_tls_key_file: /etc/postfix/tls/smtp.repleo.nl.key,
     postfix_tls_cert_file: /etc/postfix/tls/smtp.repleo.nl_chain.pem,
     postfix_smtpd_auth_sasl_enable: yes,
     postfix_send_test_mail_to: [email protected]
   }

许可证

根据MIT许可证授权。有关详细信息,请参阅LICENSE文件。

意见反馈、错误报告、请求等...

欢迎您提出反馈!

关于项目

Ansible role for installing postfix SMTP with spamassassin

安装
ansible-galaxy install repleo.postfix
许可证
mit
下载
240
拥有者
Continuous delivery and software development experts