start dovecot config; generate postfix transport_map; support multiple sender IPs...
[ansible.git] / roles / email / templates / master.cf
1 #
2 # Postfix master process configuration file.  For details on the format
3 # of the file, see the master(5) manual page (command: "man 5 master" or
4 # on-line: http://www.postfix.org/master.5.html).
5 #
6 # Do not forget to execute "postfix reload" after editing this file.
7 #
8 # ==========================================================================
9 # service type  private unpriv  chroot  wakeup  maxproc command + args
10 #               (yes)   (yes)   (no)    (never) (100)
11 # ==========================================================================
12 {% if postfix.postscreen is defined and postfix.postscreen %}
13 smtp       inet  n       -       y       -       1       postscreen
14 smtpd      pass  -       -       y       -       -       smtpd
15 dnsblog    unix  -       -       y       -       0       dnsblog
16 tlsproxy   unix  -       -       y       -       0       tlsproxy
17 {% else %}
18 smtp      inet  n       -       y       -       -       smtpd
19 {% endif %}
20
21 {% if postfix.submission is defined and postfix.submission %}
22 submission inet  n       -       y       -       -       smtpd
23     -o syslog_name=postfix/submission
24     -o smtpd_tls_security_level=encrypt
25     -o smtpd_sasl_auth_enable=yes
26     -o smtpd_tls_ask_ccert=no
27     -o smtpd_relay_restrictions=permit_sasl_authenticated,reject
28     -o smtpd_recipient_restrictions=reject_sender_login_mismatch
29 {% endif %}
30
31 pickup    unix  n       -       y       60      1       pickup
32 cleanup   unix  n       -       y       -       0       cleanup
33 qmgr      unix  n       -       n       300     1       qmgr
34 #qmgr     unix  n       -       n       300     1       oqmgr
35 tlsmgr    unix  -       -       y       1000?   1       tlsmgr
36 rewrite   unix  -       -       y       -       -       trivial-rewrite
37 bounce    unix  -       -       y       -       0       bounce
38 defer     unix  -       -       y       -       0       bounce
39 trace     unix  -       -       y       -       0       bounce
40 verify    unix  -       -       y       -       1       verify
41 flush     unix  n       -       y       1000?   0       flush
42 proxymap  unix  -       -       n       -       -       proxymap
43 proxywrite unix -       -       n       -       1       proxymap
44 {% if postfix.smtp_outgoing is defined %}
45 {% for item in postfix.smtp_outgoing %}
46 {{item.name}} unix  -       -       -       -       -       smtp
47   -o smtp_helo_name={{item.hostname}}
48   -o smtp_bind_address={{item.ip}}
49 {% if item.ip_v6 is defined %}
50   -o smtp_bind_address6={{item.ip_v6}}
51 {% else %}
52   -o inet_protocols=ipv4
53 {% endif %}
54 {% endfor %}
55 {% else %}
56 smtp      unix  -       -       y       -       -       smtp
57 {% endif %}
58 relay     unix  -       -       y       -       -       smtp
59 #       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
60 showq     unix  n       -       y       -       -       showq
61 error     unix  -       -       y       -       -       error
62 retry     unix  -       -       y       -       -       error
63 discard   unix  -       -       y       -       -       discard
64 local     unix  -       n       n       -       -       local
65 #virtual   unix  -       n       n       -       -       virtual
66 lmtp      unix  -       -       y       -       -       lmtp
67 anvil     unix  -       -       y       -       1       anvil
68 scache    unix  -       -       y       -       1       scache
69
70 # ====================================================================
71 # Interfaces to non-Postfix software. Be sure to examine the manual
72 # pages of the non-Postfix software to find out what options it wants.
73 #
74 # Many of the following services use the Postfix pipe(8) delivery
75 # agent.  See the pipe(8) man page for information about ${recipient}
76 # and other message envelope options.
77 # ====================================================================
78 #
79 # maildrop. See the Postfix MAILDROP_README file for details.
80 # Also specify in main.cf: maildrop_destination_recipient_limit=1
81 #
82 #maildrop  unix  -       n       n       -       -       pipe
83 #  flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
84 #
85 # ====================================================================
86 #
87 # Recent Cyrus versions can use the existing "lmtp" master.cf entry.
88 #
89 # Specify in cyrus.conf:
90 #   lmtp    cmd="lmtpd -a" listen="localhost:lmtp" proto=tcp4
91 #
92 # Specify in main.cf one or more of the following:
93 #  mailbox_transport = lmtp:inet:localhost
94 #  virtual_transport = lmtp:inet:localhost
95 #
96 # ====================================================================
97 #
98 # Cyrus 2.1.5 (Amos Gouaux)
99 # Also specify in main.cf: cyrus_destination_recipient_limit=1
100 #
101 #cyrus     unix  -       n       n       -       -       pipe
102 #  user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}
103 #
104 # ====================================================================
105 # Old example of delivery via Cyrus.
106 #
107 #old-cyrus unix  -       n       n       -       -       pipe
108 #  flags=R user=cyrus argv=/cyrus/bin/deliver -e -m ${extension} ${user}
109 #
110 # ====================================================================
111 #
112 # See the Postfix UUCP_README file for configuration details.
113 #
114 #uucp      unix  -       n       n       -       -       pipe
115 #  flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
116 #
117 # Other external delivery methods.
118 #
119 #ifmail    unix  -       n       n       -       -       pipe
120 #  flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
121 #bsmtp     unix  -       n       n       -       -       pipe
122 #  flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
123 #scalemail-backend unix -       n       n       -       2       pipe
124 #  flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
125
126 {% if postfix.mailman is defined and postfix.mailman %}
127 mailman   unix  -       n       n       -       -       pipe
128   flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
129   ${nexthop} ${user}
130 {% endif %}