major / ansible-mailgun Goto Github PK
View Code? Open in Web Editor NEWAnsible role for configuring Mailgun SMTP relaying with Postfix
License: Apache License 2.0
Ansible role for configuring Mailgun SMTP relaying with Postfix
License: Apache License 2.0
On Debian Jessie, this role will product the following errors in the mail log when sending emails:
warning: SASL authentication failure: No worthy mechs found
delivery temporarily suspended: SASL authentication failed; cannot authenticate to server smtp.mailgun.org[23.22.131.222]: no mechanism available
This is due to the lack of the relevant sasl2 modules for secure connection to mailgun. To fix manually:
apt-get install libsasl2-modules
/etc/init.d/postfix restart
Or in Ansible after the Mailgun role:
- name: Install SASL modules for Mailgun (bug workaround)
hosts: aws:offsite:legacy
become: true
tasks:
- apt: name=libsasl2-modules state=present
- service: name=postfix state=restarted
Ansible 2.2.0.0
Executing this role gives this error:
failed: [server1] (item=[u'postfix_packages']) => {"failed": true, "item": ["postfix_packages"], "msg": "No package matching 'postfix_packages' is available"}
Ansible 2.2.0.0 depreciation removal list:
with_ 'bare variable' handling, now loop items must always be templated {{ }} or they will be considered as plain strings.
skipping task on 'missing attribute' in loop variable, now in a loop an undefined attribute will return an error instead of skipping the task.
skipping on undefined variables in loop, now loops will have to define a variable or use |default to avoid errors.
Need to change
with_items: postfix_packages
to
with_items: "{{postfix_packages}}"
in /tasks/debian.yml
Hello
Thank you for your job!
The configuration does not work when using Mailgun EU servers because the smtp server is smtp.eu.mailgun.org
.
At this time in mailgun.conf.j2 you have : relayhost = [smtp.mailgun.org]:587
Could you please add this in a variable with default value smtp.mailgun.org
so we would be able to define our own variable if needed to setup for example smtp.eu.mailgun.org
.
If you prefer you can use another solution to set directly the right server, it is up to you. For example by adding in the configuration the region...
At this time there is only two regions used by Mailgun : US and UE.
Thank you :)
TASK [major.mailgun : Install packages (Fedora)] **************************************************************************
[DEPRECATION WARNING]: Invoking "dnf" only once while using a loop via squash_actions is deprecated. Instead of using a
loop to supply multiple items and specifyingname: "{{ item }}"
, please usename: '{{ postfix_packages }}'
and remove
the loop. This feature will be removed in version 2.11. Deprecation warnings can be disabled by setting
deprecation_warnings=False in ansible.cfg.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.