Skip to content
Snippets Groups Projects
Commit 666f64d0 authored by Hinrikus Wolf's avatar Hinrikus Wolf
Browse files

postfix: test and fix virtual aliases

parent 5486148d
No related branches found
No related tags found
No related merge requests found
sqlite postfix-sqlite.so dict_sqlite_open
pcre postfix-pcre.so dict_pcre_open
...@@ -3,3 +3,9 @@ ...@@ -3,3 +3,9 @@
- name: restart postfix - name: restart postfix
service: name=postfix state=restarted 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 @@ ...@@ -5,6 +5,7 @@
with_items: with_items:
- postfix - postfix
- postfix-pcre - postfix-pcre
- postfix-cdb
tags: tags:
- postfix - postfix
- mail - mail
...@@ -12,7 +13,6 @@ ...@@ -12,7 +13,6 @@
- name: ensure not templated config is present - name: ensure not templated config is present
copy: src=files/{{ item }} dest=/etc/postfix/ copy: src=files/{{ item }} dest=/etc/postfix/
with_items: with_items:
- dynamicmaps.cf
- login_maps.pcre - login_maps.pcre
- master.cf - master.cf
- sender_login_map.hash - sender_login_map.hash
...@@ -33,6 +33,22 @@ ...@@ -33,6 +33,22 @@
- postfix - postfix
- mail - 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 - meta: flush_handlers
......
{% for alias in system_aliases %}
{{ alias.src }}:{{ alias.dest }}
{% endfor %}
...@@ -39,8 +39,8 @@ smtpd_relay_restrictions = ...@@ -39,8 +39,8 @@ smtpd_relay_restrictions =
permit_sasl_authenticated permit_sasl_authenticated
defer_unauth_destination defer_unauth_destination
myhostname = {{ ansible_fqdn }} myhostname = {{ ansible_fqdn }}
alias_maps = hash:/etc/aliases alias_maps = cdb:/etc/aliases
alias_database = hash:/etc/aliases alias_database = cdb:/etc/aliases
myorigin = /etc/mailname myorigin = /etc/mailname
mydestination = $myhostname, localhost mydestination = $myhostname, localhost
relayhost = relayhost =
...@@ -50,16 +50,13 @@ recipient_delimiter = + ...@@ -50,16 +50,13 @@ recipient_delimiter = +
inet_interfaces = all inet_interfaces = all
inet_protocols = all inet_protocols = all
virtual_mailbox_domains = $mydestination, wolfscloud.de virtual_mailbox_domains = $mydestination, {{ virtual_domains | join(" ") }}
virtual_mailbox_base = /var/vmail/ virtual_mailbox_base = /var/vmail/
virtual_mailbox_limit = 512000000 virtual_mailbox_limit = 512000000
virtual_minimum_uid = 5000 virtual_minimum_uid = 5000
virtual_transport = lmtp:unix:private/dovecot-lmtp virtual_transport = lmtp:unix:private/dovecot-lmtp
#virtual_uid_maps = static:5000
virtual_gid_maps = static:5000 virtual_gid_maps = static:5000
#local_transport = virtual virtual_alias_maps = cdb:/etc/postfix/virtual
virtual_alias_maps = hash:/etc/postfix/virtual
#smtpd_sender_login_maps = hash:/etc/postfix/sender_login_map
smtpd_sender_login_maps = proxy:pcre:/etc/postfix/login_maps.pcre 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 %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment