From 997bdf21a54151d6b871927925e988bcf9424392 Mon Sep 17 00:00:00 2001 From: Markus Katharina Brechtel Date: Thu, 14 Sep 2017 16:48:07 +0000 Subject: [PATCH] postfixadmin configuration --- tasks/postfixadmin.yml | 8 +++++-- templates/main.cf.j2 | 21 +++++++++++++++++++ ...l_virtual_alias_domain_catchall_maps.cf.j2 | 0 ...ql_virtual_alias_domain_mailbox_maps.cf.j2 | 0 .../mysql_virtual_alias_domain_maps.cf.j2 | 0 .../{ => sql}/mysql_virtual_alias_maps.cf.j2 | 0 .../mysql_virtual_domains_maps.cf.j2 | 0 .../mysql_virtual_mailbox_limit_maps.cf.j2 | 0 .../mysql_virtual_mailbox_maps.cf.j2 | 0 9 files changed, 27 insertions(+), 2 deletions(-) rename templates/{ => sql}/mysql_virtual_alias_domain_catchall_maps.cf.j2 (100%) rename templates/{ => sql}/mysql_virtual_alias_domain_mailbox_maps.cf.j2 (100%) rename templates/{ => sql}/mysql_virtual_alias_domain_maps.cf.j2 (100%) rename templates/{ => sql}/mysql_virtual_alias_maps.cf.j2 (100%) rename templates/{ => sql}/mysql_virtual_domains_maps.cf.j2 (100%) rename templates/{ => sql}/mysql_virtual_mailbox_limit_maps.cf.j2 (100%) rename templates/{ => sql}/mysql_virtual_mailbox_maps.cf.j2 (100%) diff --git a/tasks/postfixadmin.yml b/tasks/postfixadmin.yml index 21b45c0..d554f25 100644 --- a/tasks/postfixadmin.yml +++ b/tasks/postfixadmin.yml @@ -4,11 +4,15 @@ file: path: /etc/postfix/sql/ state: directory + mode: u=rwx,g=rx,o= + group: postfix -- name: postfix sql map configuration +- name: postfixadmin sql map configuration template: - src: "{{item}}.j2" + src: sql/{{item}}.j2 dest: /etc/postfix/sql/{{item}} + mode: u=rwx,g=rx,o= + group: postfix with_items: - mysql_virtual_alias_domain_catchall_maps.cf - mysql_virtual_alias_domain_maps.cf diff --git a/templates/main.cf.j2 b/templates/main.cf.j2 index 7a9cd9e..10e013f 100644 --- a/templates/main.cf.j2 +++ b/templates/main.cf.j2 @@ -42,3 +42,24 @@ mailbox_size_limit = 0 recipient_delimiter = + inet_interfaces = all inet_protocols = all + +virtual_mailbox_domains = proxy:mysql:/etc/postfix/sql/mysql_virtual_domains_maps.cf +virtual_alias_maps = + proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_maps.cf, + proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_domain_maps.cf, + proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_domain_catchall_maps.cf +virtual_mailbox_maps = + proxy:mysql:/etc/postfix/sql/mysql_virtual_mailbox_maps.cf, + proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_domain_mailbox_maps.cf + +# if you let postfix store your mails directly (without using maildrop, dovecot deliver etc.) +#virtual_mailbox_base = /var/mail/vmail +# or whereever you want to store the mails + +# Additional for quota support +#virtual_create_maildirsize = yes +#virtual_mailbox_extended = yes +#virtual_mailbox_limit_maps = mysql:/etc/postfix/sql/mysql_virtual_mailbox_limit_maps.cf +#virtual_mailbox_limit_override = yes +#virtual_maildir_limit_message = Sorry, the user's maildir has overdrawn his diskspace quota, please try again later. +#virtual_overquota_bounce = yes diff --git a/templates/mysql_virtual_alias_domain_catchall_maps.cf.j2 b/templates/sql/mysql_virtual_alias_domain_catchall_maps.cf.j2 similarity index 100% rename from templates/mysql_virtual_alias_domain_catchall_maps.cf.j2 rename to templates/sql/mysql_virtual_alias_domain_catchall_maps.cf.j2 diff --git a/templates/mysql_virtual_alias_domain_mailbox_maps.cf.j2 b/templates/sql/mysql_virtual_alias_domain_mailbox_maps.cf.j2 similarity index 100% rename from templates/mysql_virtual_alias_domain_mailbox_maps.cf.j2 rename to templates/sql/mysql_virtual_alias_domain_mailbox_maps.cf.j2 diff --git a/templates/mysql_virtual_alias_domain_maps.cf.j2 b/templates/sql/mysql_virtual_alias_domain_maps.cf.j2 similarity index 100% rename from templates/mysql_virtual_alias_domain_maps.cf.j2 rename to templates/sql/mysql_virtual_alias_domain_maps.cf.j2 diff --git a/templates/mysql_virtual_alias_maps.cf.j2 b/templates/sql/mysql_virtual_alias_maps.cf.j2 similarity index 100% rename from templates/mysql_virtual_alias_maps.cf.j2 rename to templates/sql/mysql_virtual_alias_maps.cf.j2 diff --git a/templates/mysql_virtual_domains_maps.cf.j2 b/templates/sql/mysql_virtual_domains_maps.cf.j2 similarity index 100% rename from templates/mysql_virtual_domains_maps.cf.j2 rename to templates/sql/mysql_virtual_domains_maps.cf.j2 diff --git a/templates/mysql_virtual_mailbox_limit_maps.cf.j2 b/templates/sql/mysql_virtual_mailbox_limit_maps.cf.j2 similarity index 100% rename from templates/mysql_virtual_mailbox_limit_maps.cf.j2 rename to templates/sql/mysql_virtual_mailbox_limit_maps.cf.j2 diff --git a/templates/mysql_virtual_mailbox_maps.cf.j2 b/templates/sql/mysql_virtual_mailbox_maps.cf.j2 similarity index 100% rename from templates/mysql_virtual_mailbox_maps.cf.j2 rename to templates/sql/mysql_virtual_mailbox_maps.cf.j2