From a99736499d68d4ec0b1f1571240150506bb7022c Mon Sep 17 00:00:00 2001 From: Aeris Date: Mon, 26 Nov 2018 23:02:11 +0100 Subject: [PATCH] smtp/imap/webmail fully working tested --- deploy/roles/mailserver/tasks/main.yml | 30 +++++++++++-------- .../config.inc.php.j2} | 4 +++ 2 files changed, 22 insertions(+), 12 deletions(-) rename deploy/roles/mailserver/{files/webmail/config.inc.php => templates/config.inc.php.j2} (67%) diff --git a/deploy/roles/mailserver/tasks/main.yml b/deploy/roles/mailserver/tasks/main.yml index ab52644..024f95d 100644 --- a/deploy/roles/mailserver/tasks/main.yml +++ b/deploy/roles/mailserver/tasks/main.yml @@ -33,12 +33,15 @@ dest: "{{ docker_project_folder }}/mailserver" - name: Copy webmail Add - copy: - src: webmail - dest: "{{ docker_project_folder }}/mailserver" + template: + src: config.inc.php.j2 + dest: "{{ docker_project_folder }}/mailserver/webmail/config.inc.php" -- name: make start executable in traefik - shell: chmod +x "{{ docker_project_folder }}/mailserver/smtp/start.sh" +- name: make start executable smtp + copy: + dest: "{{ docker_project_folder }}/mailserver/smtp/start.sh" + src: smtp/start.sh + mode: '555' - name: Copy imap copy: @@ -46,24 +49,27 @@ dest: "{{ docker_project_folder }}/mailserver" - name: make start executable imap - shell: chmod +x "{{ docker_project_folder }}/mailserver/imap/start.sh" + copy: + dest: "{{ docker_project_folder }}/mailserver/imap/start.sh" + src: imap/start.sh + mode: '555' - name: Copy spam copy: src: spam dest: "{{ docker_project_folder }}/mailserver" -- name: make start executable in spam - shell: chmod +x "{{ docker_project_folder }}/mailserver/spam/start.sh" +- name: make start executable spam + copy: + dest: "{{ docker_project_folder }}/mailserver/spam/start.sh" + src: spam/start.sh + mode: '555' - name: Copy db copy: src: db dest: "{{ docker_project_folder }}/mailserver" -- name: make start executable in db - shell: chmod +x "{{ docker_project_folder }}/mailserver/db/databases.sh" - - name: Copy traefik copy: src: traefik @@ -78,7 +84,7 @@ copy: src: docker-entrypoint.sh dest: "{{ docker_project_folder }}/mailserver/docker-entrypoint.sh" - mode: "+x" + mode: "555" - name: Copy docker-compose template: diff --git a/deploy/roles/mailserver/files/webmail/config.inc.php b/deploy/roles/mailserver/templates/config.inc.php.j2 similarity index 67% rename from deploy/roles/mailserver/files/webmail/config.inc.php rename to deploy/roles/mailserver/templates/config.inc.php.j2 index aff8edd..06b9e1e 100644 --- a/deploy/roles/mailserver/files/webmail/config.inc.php +++ b/deploy/roles/mailserver/templates/config.inc.php.j2 @@ -5,3 +5,7 @@ $config['smtp_conn_options'] = array('ssl' => array( 'verify_peer' $rcmail_config['managesieve_port'] = 4190; $rcmail_config['managesieve_host'] = 'tls://imap'; $config['managesieve_conn_options'] = array( 'ssl' => array( 'verify_peer' => false, 'verify_peer_name' => false ), ); +$config['password_db_dsn'] = 'mysql://mail:{{ DB_PASSWORD }}@db/postfix'; +$config['password_query'] = "UPDATE mailbox SET password=CONCAT('{SHA512-CRYPT}', ENCRYPT (%p, CONCAT('$5$', SUBSTRING(SHA(RAND()), -16)))) WHERE username=%u;"; + +