From cbf8dce4ef1981b4212754cb7331159d375d0e60 Mon Sep 17 00:00:00 2001 From: genofire Date: Fri, 24 Jul 2020 17:07:52 +0200 Subject: [PATCH] cleanup + add roundcubemail --- defaults/main.yml | 3 + tasks/main.yml | 15 ++- tasks/postfixadmin.yml | 2 +- tasks/roundcubemail.yml | 16 ++++ templates/postfix/main.cf | 4 +- ...xadmin.local.php => postfixadmin-conf.php} | 0 templates/roundcubemail-conf.php | 91 +++++++++++++++++++ templates/roundcubemail-local.nginx | 21 +++++ 8 files changed, 147 insertions(+), 5 deletions(-) create mode 100644 tasks/roundcubemail.yml rename templates/{postfixadmin.local.php => postfixadmin-conf.php} (100%) create mode 100644 templates/roundcubemail-conf.php create mode 100644 templates/roundcubemail-local.nginx diff --git a/defaults/main.yml b/defaults/main.yml index c909a11..a980093 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -31,3 +31,6 @@ mailserver_mailman_web: true mailserver_mailman_domains: - mail: "lists.{{ mailserver_mail_domain }}" web: "lists.{{ mailserver_mail_domain }}" + +mailserver_roundcubemail_enabled: true +mailserver_roundcubemail_domain: "" diff --git a/tasks/main.yml b/tasks/main.yml index 323429a..b791562 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -25,23 +25,34 @@ - name: Run userdatabase when: mailserver_dovecot_enabled import_tasks: db.yml + tags: mail-db - name: Run postfixadmin when: mailserver_dovecot_enabled import_tasks: postfixadmin.yml + tags: postfixadmin - name: Run dovecot when: mailserver_dovecot_enabled import_tasks: dovecot.yml + tags: dovecot - name: Run rspamd import_tasks: rspamd.yml when: mailserver_rspamd_enabled - + tags: rspamd + - name: Run mailman when: mailserver_mailman_enabled import_tasks: mailman.yml - + tags: mailman + - name: Run postfix import_tasks: postfix.yml + tags: postfix + +- name: Run roundcubemail + when: mailserver_roundcubemail_enabled + import_tasks: roundcubemail.yml + tags: roundcubemail diff --git a/tasks/postfixadmin.yml b/tasks/postfixadmin.yml index a9d987d..7a44253 100644 --- a/tasks/postfixadmin.yml +++ b/tasks/postfixadmin.yml @@ -19,7 +19,7 @@ - name: postfixadmin - config template: - src: postfixadmin.local.php + src: postfixadmin-conf.php dest: /etc/webapps/postfixadmin/config.local.php - name: postfixadmin - fix config access diff --git a/tasks/roundcubemail.yml b/tasks/roundcubemail.yml new file mode 100644 index 0000000..5ca63a6 --- /dev/null +++ b/tasks/roundcubemail.yml @@ -0,0 +1,16 @@ +- name: roundcubemail - install + package: + name: roundcubemail + state: latest + +- name: roundcubemail - nginx local + notify: reload nginx + when: mailserver_roundcubemail_domain == "" + template: + src: roundcubemail-local.nginx + dest: /etc/nginx/local.d/roundcubemail.act + +- name: roundcubemail - config + template: + src: roundcubemail-conf.php + dest: /etc/webapps/roundcubemail/config/config.inc.php diff --git a/templates/postfix/main.cf b/templates/postfix/main.cf index a3c549e..19893f4 100644 --- a/templates/postfix/main.cf +++ b/templates/postfix/main.cf @@ -91,7 +91,7 @@ smtpd_relay_restrictions = reject_non_fqdn_recipient ### Restrictions for all sending foreign servers ("SMTP clients") smtpd_client_restrictions = permit_mynetworks - check_client_access hash:/etc/postfix/without_ptr +# check_client_access hash:/etc/postfix/without_ptr # reject_unknown_client_hostname @@ -122,7 +122,7 @@ mua_client_restrictions = permit_mynetworks,permit_sasl_authenticated,reject ### Postscreen Whitelist / Blocklist postscreen_access_list = permit_mynetworks - cidr:/etc/postfix/postscreen_access +# cidr:/etc/postfix/postscreen_access postscreen_blacklist_action = drop diff --git a/templates/postfixadmin.local.php b/templates/postfixadmin-conf.php similarity index 100% rename from templates/postfixadmin.local.php rename to templates/postfixadmin-conf.php diff --git a/templates/roundcubemail-conf.php b/templates/roundcubemail-conf.php new file mode 100644 index 0000000..88dd2f6 --- /dev/null +++ b/templates/roundcubemail-conf.php @@ -0,0 +1,91 @@ +