Commit 666f64d0 authored by Hinrikus Wolf's avatar Hinrikus Wolf
Browse files

postfix: test and fix virtual aliases

parent 5486148d
sqlite postfix-sqlite.so dict_sqlite_open
pcre postfix-pcre.so dict_pcre_open
......@@ -3,3 +3,9 @@
- name: restart postfix
service: name=postfix state=restarted
- name: postmap system
command: postalias cdb:/etc/aliases
- name: postmap virtual
command: postmap cdb:/etc/postfix/virtual
......@@ -5,6 +5,7 @@
with_items:
- postfix
- postfix-pcre
- postfix-cdb
tags:
- postfix
- mail
......@@ -12,7 +13,6 @@
- name: ensure not templated config is present
copy: src=files/{{ item }} dest=/etc/postfix/
with_items:
- dynamicmaps.cf
- login_maps.pcre
- master.cf
- sender_login_map.hash
......@@ -32,6 +32,22 @@
tags:
- postfix
- mail
- name: ensure system alias database is present
template: src=templates/aliases.j2 dest=/etc/aliases
notify:
- postmap system
tags:
- postfix
- mail
- name: ensure virtual alias database is present
template: src=templates/v_aliases.j2 dest=/etc/postfix/virtual
notify:
- postmap virtual
tags:
- postfix
- mail
- meta: flush_handlers
......
{% for alias in system_aliases %}
{{ alias.src }}:{{ alias.dest }}
{% endfor %}
......@@ -39,8 +39,8 @@ smtpd_relay_restrictions =
permit_sasl_authenticated
defer_unauth_destination
myhostname = {{ ansible_fqdn }}
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
alias_maps = cdb:/etc/aliases
alias_database = cdb:/etc/aliases
myorigin = /etc/mailname
mydestination = $myhostname, localhost
relayhost =
......@@ -50,16 +50,13 @@ recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
virtual_mailbox_domains = $mydestination, wolfscloud.de
virtual_mailbox_domains = $mydestination, {{ virtual_domains | join(" ") }}
virtual_mailbox_base = /var/vmail/
virtual_mailbox_limit = 512000000
virtual_minimum_uid = 5000
virtual_transport = lmtp:unix:private/dovecot-lmtp
#virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
#local_transport = virtual
virtual_alias_maps = hash:/etc/postfix/virtual
#smtpd_sender_login_maps = hash:/etc/postfix/sender_login_map
virtual_alias_maps = cdb:/etc/postfix/virtual
smtpd_sender_login_maps = proxy:pcre:/etc/postfix/login_maps.pcre
################################################################################
......
{% for domain in virtual_domains %}
postmaster@{{ domain }} {{ adminaddr }}
hostmaster@{{ domain }} {{ adminaddr }}
abuse@{{ domain }} {{ adminaddr }}
{% endfor %}
{% for alias in virtual_aliases %}
{{ alias.src }} {{ alias.dest }}
{% endfor %}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment