Start writing postfix configuration
[vagrant-mail.git] / test-vagrant-salt / salt / testvm / postfix / init.sls
1 no-other-mta:
2   pkg.removed:
3     - pkg: exim4
4     - pkg: ssmtp
5
6 postfix-pkg:
7   pkg.installed:
8     - name: postfix
9     - require:
10       - pkg: no-other-mta
11
12 postfix-permissions:
13   # fix all permission issues
14   cmd.run:
15     - name: postfix set-permissions || /bin/true
16     - require :
17       - pkg: postfix-pkg
18
19 postfix-daemon:
20   service.running:
21     - name: postfix
22     - reload: true
23     - enable: true
24     - require :
25       - pkg: postfix-pkg
26
27 /etc/postfix/aliases:
28   file.managed:
29     - source: salt://testvm/postfix/aliases
30     - template: jinja
31     - file_mode: 640
32     - dir_mode: 755
33     - user: root
34     - group: root
35     - watch_in:
36       - service: postfix-daemon
37   cmd.run:
38     - name: postalias /etc/aliases
39     - require:
40       - pkg: postfix-pkg
41       - file: /etc/postfix/aliases
42
43 /etc/postfix/main.cf:
44   file.managed:
45     - source: salt://testvm/postfix/main.cf
46     - template: jinja
47     - watch_in:
48       - service: postfix-daemon
49
50 /etc/postfix/master.cf:
51   file.managed:
52     - source: salt://testvm/postfix/master.cf
53     - template: jinja
54     - watch_in:
55       - service: postfix-daemon