Giter VIP home page Giter VIP logo

stouts.postfix's Introduction

Stouts.postfix

Build Status Galaxy

Ansible role which manage postfix

Requirements

Only tested on ubuntu for now.

Variables

postfix_enabled: yes # The role is enabled

postfix_smtpd_use_tls: yes
postfix_myhostname: "{{inventory_hostname}}"
postfix_myorigin: $myhostname
postfix_smtp_sasl_auth_enable: yes
postfix_smtp_tls_cafile: "/etc/ssl/certs/Thawte_Premium_Server_CA.pem"
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_smtp_sasl_security_options: ""

postfix_generic_maps: ""

# Relay all mail going to local users (e.g. root or cron) to another mail address
postfix_local_user_relay_address: ""

# Useful if you use a SMTP server for relay that doesn't allow
# arbitrary sender addresses.
postfix_rewrite_sender_address: ""

# Send a test mail to this address when Postfix configuration changes
postfix_send_test_mail_to: ""

postfix_smtp_sasl_user: "{{ansible_ssh_user|default('root')}}"
postfix_smtp_sasl_password: ""

Usage

Add Stouts.postfix to your roles and set vars in your playbook file.

Example:

- hosts: all

  roles:
    - Stouts.postfix

  vars:
    # Example configuration for gmail
    postfix_relayhost: "[smtp.gmail.com]:587"
    postfix_smtp_sasl_user: [email protected]
    postfix_smtp_sasl_password: mypassword

License

Licensed under the MIT License. See the LICENSE file for details.

Feedback, bug-reports, requests, ...

Are welcome!

stouts.postfix's People

Contributors

akhon avatar atgreen avatar bussnet avatar denya avatar klen avatar mfrister avatar nemesifier avatar nodje avatar opennomad avatar oskarpearson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

stouts.postfix's Issues

postmap sasl_passwd

I need to execute these command.

chmod 400 /etc/postfix/sasl_passwd
postmap /etc/postfix/sasl_passwd

not automated?

New default variable `postfix_apt_packages`

Hi.

Perfect role, but don't work on AWS SES because we also need to install libsasl2-modules to make it work.
Without this package we having next error at /var/log/mail.log:

warning: SASL authentication failure: No worthy mechs found
SASL authentication failed; cannot authenticate to server email-smtp.us-east-1.amazonaws.com[23.21.91.54]: no mechanism available

So... Right way is to have next variable on defaults/main.yml:

postfix_apt_packages:
  - postfix
  - ca-certificates
  - mailutils

So anyone can override package list like that:

postfix_apt_packages:
  - postfix
  - ca-certificates
  - mailutils
  - libsasl2-modules

As I see this will be useful to others too.

I can prepare PR if you need.

Aliases

That would be great if role will support aliases like implemented here.

Error at configure

TASK [Stouts.postfix : Ensure /etc/postfix directory is owned by root user] ****
fatal: [myhost.local]: FAILED! => {"changed": false, "failed": true, "msg": "file (/etc/postfix) is absent, cannot continue", "path": "/etc/postfix", "state": "absent"}

path(/etc/postfix) is not exist in myhost acutually.

any idea?

Update Ansible galaxy

Hi,

Can you please refresh Ansible Galaxy to be able to download the latest version of this role through ansible-galaxy binary ?

Thanks

The /etc/postfix directory needs to be owned by the postfix user

There's currently a bug in Ubuntu 12.04 TLS where the /etc/postfix directory is owned by root and this causes this error when postfix_smtp_sasl_auth_enable is enabled

Oct 24 23:26:13 ip-10-3-104-208 postfix/smtp[16116]: error: open database /etc/postfix/sasl_passwd.db: No such file or directory
Oct 24 23:26:14 ip-10-3-104-208 postfix/smtp[16116]: warning: hash:/etc/postfix/sasl_passwd is unavailable. open database /etc/postfix/sasl_passwd.db: No such file or directory
Oct 24 23:26:14 ip-10-3-104-208 postfix/smtp[16116]: warning: hash:/etc/postfix/sasl_passwd lookup error for "smtp.mailgun.com"
Oct 24 23:26:14 ip-10-3-104-208 postfix/smtp[16116]: warning: A193728CEB: smtp_sasl_passwd lookup error

Need to change this file:

https://github.com/Stouts/Stouts.postfix/blob/develop/tasks/install.deb.yml#L3-L8

to add a

- name: ensure /etc/postfix directory is owned by postfix user
  file: path=/etc/postfix owner=postfix
  notify: postfix restart

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.