Created
April 4, 2014 16:12
-
-
Save damoun/9977917 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% from "opensmtpd/map.jinja" import opensmtpd with context %} | |
opensmtpd: | |
pkg: | |
- installed | |
- pkgs: {{ opensmtpd.pkgs|json }} | |
service: | |
- running | |
- name: {{ opensmtpd.service }} | |
- require: | |
- pkg: opensmtpd | |
file.managed: | |
- name: {{ opensmtpd.config }}/smtpd.conf | |
- source: salt://opensmtpd/smtpd.conf.jinja | |
- template: jinja | |
- mode: 400 | |
- watch_in: | |
- service: opensmtpd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Secondary mail server config | |
listen on {{ address }} | |
table relayed_domains { {{ domains }} } | |
accept from any for domain <relayed_domains> relay \ | |
backup {{ address }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% from "opensmtpd/map.jinja" import opensmtpd with context %} | |
{% set secrets = pillar.get("opensmtpd_secrets", {}) %} | |
secondary: | |
file.append: | |
- name: {{ opensmtpd.config }}/smtpd.conf | |
- source: salt://opensmtpd/secondary.conf.jinja | |
- template: jinja | |
- context: | |
domains: {{ ", ".join(secrets.get('domains')) }} | |
address: {{ secrets.get('address') }} | |
- watch_in: | |
- service: opensmtpd | |
- require: | |
- file: opensmtpd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Default mail server config | |
listen on localhost | |
accept from local for local deliver to mbox |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment