summaryrefslogtreecommitdiffstats
path: root/roles/postfix/templates
diff options
context:
space:
mode:
authorMichael Scherer <misc@zarb.org>2014-12-12 14:28:47 +0100
committerMichael Scherer <misc@zarb.org>2014-12-12 14:28:47 +0100
commitca315bf9c292d4757b67a86117e3182c1b0dd680 (patch)
tree57923818c4e974b2d7f8e16be14ef3d8612b855f /roles/postfix/templates
parentd9e874ece0c162fcba01553fbea0a8b2fd86d249 (diff)
Import postfix/mailman from rad
Diffstat (limited to 'roles/postfix/templates')
-rw-r--r--roles/postfix/templates/aliases.local4
-rw-r--r--roles/postfix/templates/aliases.users5
-rw-r--r--roles/postfix/templates/local_recipient4
-rw-r--r--roles/postfix/templates/main.cf76
-rw-r--r--roles/postfix/templates/virtual_gid1
-rw-r--r--roles/postfix/templates/virtual_mailbox5
-rw-r--r--roles/postfix/templates/virtual_uid2
7 files changed, 97 insertions, 0 deletions
diff --git a/roles/postfix/templates/aliases.local b/roles/postfix/templates/aliases.local
new file mode 100644
index 0000000..9b23aec
--- /dev/null
+++ b/roles/postfix/templates/aliases.local
@@ -0,0 +1,4 @@
+{% for item in local_users %}
+{{ item }}: /var/mail/{{ item }}/
+{% endfor %}
+
diff --git a/roles/postfix/templates/aliases.users b/roles/postfix/templates/aliases.users
new file mode 100644
index 0000000..20ef480
--- /dev/null
+++ b/roles/postfix/templates/aliases.users
@@ -0,0 +1,5 @@
+{% for item in postfix_aliases %}
+{{ item.alias }}: {% if item.mail is string %} {{ item.mail }}
+{% else %} {{ item.mail |join(',') }}
+{% endif %}
+{% endfor %}
diff --git a/roles/postfix/templates/local_recipient b/roles/postfix/templates/local_recipient
new file mode 100644
index 0000000..39d554e
--- /dev/null
+++ b/roles/postfix/templates/local_recipient
@@ -0,0 +1,4 @@
+{% for item in local_users %}
+{{ item }} OK
+{% endfor %}
+
diff --git a/roles/postfix/templates/main.cf b/roles/postfix/templates/main.cf
new file mode 100644
index 0000000..22546d1
--- /dev/null
+++ b/roles/postfix/templates/main.cf
@@ -0,0 +1,76 @@
+queue_directory = /var/spool/postfix
+command_directory = /usr/sbin
+daemon_directory = /usr/libexec/postfix
+data_directory = /var/lib/postfix
+mail_owner = postfix
+
+inet_interfaces = all
+inet_protocols = all
+
+
+mydestination = $myhostname,
+ localhost.$mydomain,
+ localhost,
+ {{ ansible_domain }},
+ {{ mailman_prefix | default('') }}
+
+unknown_local_recipient_reject_code = 550
+
+# ALIAS DATABASE
+#
+# The alias_maps parameter specifies the list of alias databases used
+# by the local delivery agent. The default list is system dependent.
+#
+# On systems with NIS, the default is to search the local alias
+# database, then the NIS alias database. See aliases(5) for syntax
+# details.
+#
+# If you change the alias database, run "postalias /etc/aliases" (or
+# wherever your system stores the mail alias file), or simply run
+# "newaliases" to build the necessary DBM or DB file.
+#
+# It will take a minute or so before changes become visible. Use
+# "postfix reload" to eliminate the delay.
+#
+#alias_maps = dbm:/etc/aliases
+alias_maps = hash:/etc/aliases,
+{% if use_local == True %}
+ hash:/etc/postfix/aliases.local,
+{% endif %}
+ hash:/etc/postfix/aliases.mailman_default,
+ hash:/etc/postfix/aliases.mailman,
+ hash:/etc/postfix/aliases.users
+
+
+{% if use_local == True %}
+local_recipient_maps = hash:/etc/postfix/local_recipient, $alias_maps
+{% endif %}
+
+recipient_delimiter = +
+
+
+debug_peer_level = 2
+debugger_command =
+ PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
+ ddd $daemon_directory/$process_name $process_id & sleep 5
+
+{% if use_tls == True %}
+smtpd_tls_cert_file={{ postfix_cert }}
+smtpd_tls_key_file={{ postfix_key }}
+smtpd_use_tls=yes
+{% endif %}
+
+{% if use_sasl == True %}
+smtpd_tls_auth_only = yes
+smtpd_sasl_auth_enable = yes
+smtpd_sasl_application_name = smtpd
+smtpd_sasl_local_domain = {{ ansible_domain }}
+{% endif %}
+
+smtp_use_tls = yes
+
+sendmail_path = /usr/sbin/sendmail.postfix
+newaliases_path = /usr/bin/newaliases.postfix
+mailq_path = /usr/bin/mailq.postfix
+setgid_group = postdrop
+
diff --git a/roles/postfix/templates/virtual_gid b/roles/postfix/templates/virtual_gid
new file mode 100644
index 0000000..62f452c
--- /dev/null
+++ b/roles/postfix/templates/virtual_gid
@@ -0,0 +1 @@
+@{{ ansible_domain }} {{ mail_group.gid }}
diff --git a/roles/postfix/templates/virtual_mailbox b/roles/postfix/templates/virtual_mailbox
new file mode 100644
index 0000000..ced3f62
--- /dev/null
+++ b/roles/postfix/templates/virtual_mailbox
@@ -0,0 +1,5 @@
+# user@{{ ansible_domain }} user
+{% for item in local_users %}
+{{ item }}@{{ ansible_domain }} {{ item }}
+{% endfor %}
+
diff --git a/roles/postfix/templates/virtual_uid b/roles/postfix/templates/virtual_uid
new file mode 100644
index 0000000..8ac4140
--- /dev/null
+++ b/roles/postfix/templates/virtual_uid
@@ -0,0 +1,2 @@
+# @manageiq.org 97
+@{{ ansible_domain }} {{ dovecot_user.uid }}