repleo.postfix

repleo.postfix - Ansible Role for Installing Postfix SMTP with SSL and Spam Filter Support

Build Status Ansible Galaxy

This is an Ansible role to manage Postfix. It helps you set up a complete SMTP server with TLS/SSL and STARTSSL support. It also installs SpamAssassin to filter spam, using a proven database built from 10 years of spam experience.

Requirements

Currently, it has only been tested on Ubuntu and Debian.

Variables

postfix_enabled: yes # Enable the role

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_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: ""

# Mail delivery options
postfix_use_maildrop: no
postfix_use_procmail: no

# SPF support
postfix_spf: no

# DKIM support
postfix_dkim: no
postfix_dkim_domains: 
postfix_dkim_key_bits: 2048

# DMARC support
postfix_dmarc: no
postfix_dmarc_host: 
postfix_dmarc_domains: 

# Forward all local user emails to another address
postfix_local_user_relay_address: ""

# Useful for SMTP servers that don't allow random sender addresses
postfix_rewrite_sender_address: ""

# Send a test email when Postfix configuration changes
postfix_send_test_mail_to: ""

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

# Queue settings
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"

Usage

Add repleo.postfix to your roles and set variables in your playbook file.

Example:

- hosts: all

  roles:
    - repleo.postfix

  vars:
    # Example configuration for Gmail
    postfix_relayhost: "[smtp.gmail.com]:587"
    postfix_smtp_sasl_user: myemail@gmail.com
    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: jeroen@repleo.nl
   }

License

This project is licensed under the MIT License. See the LICENSE file for more details.

Feedback, Bug Reports, Requests, ...

Your feedback is welcome!

Informazioni sul progetto

Ansible role for installing postfix SMTP with spamassassin

Installa
ansible-galaxy install repleo.postfix
Licenza
mit
Download
240
Proprietario
Continuous delivery and software development experts