GithubHelp home page GithubHelp logo

acromedia / ansible-role-postfix Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 5.0 50 KB

Install postfix so websites (and the server itself) can send out email

License: GNU General Public License v3.0

Jinja 100.00%

ansible-role-postfix's People

Contributors

chithrak07 avatar dale-c-anderson avatar jseniuk avatar

Stargazers

 avatar

Watchers

 avatar  avatar

ansible-role-postfix's Issues

Cron notifications sometimes don't work on ec2 instances

In some (rare) cases, mail for root gets addressed to root@<ec2-instance-private-dns-name> (instead of root@<hostname>, or root@<fqdn>). In those cases, mail bounces to nowhere (and disappears), with a log entry which looks like:

Nov 20 12:00:04 prod-app6 postfix/smtp[27884]: 966FF40321: to=<[email protected]>, relay=none, delay=0.01, delays=0.01/0/0/0, dsn=5.4.6, status=bounced (mail for ip-172-30-0-239.ca-central-1.compute.internal loops back to myself)

Since ansible can detect ec2 facts, this would be easy to resolve by gathering them and then injecting the private dns name into the list of names in the mydestination config line.

Restart postfix if the /etc/resolv.conf file has changes

It is observed that when ever server gets restarted, postfix stops sending emails and logs the following error in the mail log

status=deferred (Host or domain name not found. Name service error for name=nosnch.in type=MX: Host not found, try again)`

This seems to be a bug that is already reported
https://bugs.launchpad.net/ubuntu/+source/postfix/+bug/1519331

The problem appears to be:

  • Postfix is ready before networking is ready
  • Postfix's startup copies the system's /etc/resolv.conf into postfix's own chroot environment.
  • Since that file is dynamic in modern ubuntu, it's not ready when postfix copies it over, so postfix cant resolve names until the service is restarted, at which point, the /etc/resolv.conf file is re-copied.

So the fix for this would be to add a watcher for the /etc/resolv.conf file, so that when it gets modified, the postfix service is restarted, so it can re-copy the file into its own chroot agian.

Change the path to "watch"

Looks like /etc/resolv.conf is a symlink to /run/resolvconf/resolv.conf. Hence it is the later that we have to watch for changes.

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.