From 0080621c4da7cf4e629b10a0f88bcf0facff5760 Mon Sep 17 00:00:00 2001 From: Pierre Jaury Date: Sun, 21 Feb 2016 16:24:11 +0100 Subject: [PATCH] Enable changing password from the webmail --- Dockerfile | 2 +- config/roundcube.inc.php | 30 +++++++++++++++++++++++------- start.sh | 21 ++++++++++----------- 3 files changed, 34 insertions(+), 19 deletions(-) diff --git a/Dockerfile b/Dockerfile index 86cf8ad4..8f583f91 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ RUN export DEBIAN_FRONTEND=noninteractive \ postfix dovecot-imapd dovecot-sqlite dovecot-lmtpd \ dovecot-sieve dovecot-managesieved \ dovecot-antispam spamassassin spamc clamav \ - php5-fpm php5-mysql php5-imap php5-sqlite \ + php5-fpm php5-mysql php5-imap php5-sqlite php5-mcrypt \ supervisor rsyslog nginx \ && apt-get clean diff --git a/config/roundcube.inc.php b/config/roundcube.inc.php index 674c6b13..c231f472 100644 --- a/config/roundcube.inc.php +++ b/config/roundcube.inc.php @@ -8,19 +8,35 @@ $config['des_key'] = 'rcmail-!24ByteDESkey*Str'; $config['identities_level'] = 3; $config['reply_all_mode'] = 1; +// List of active plugins (in plugins/ directory) +$config['plugins'] = array( + 'archive', + 'zipdownload', + 'managesieve', + 'markasjunk', + 'password' +); + // Mail servers $config['default_host'] = 'localhost'; $config['default_port'] = 143; $config['smtp_server'] = 'localhost'; $config['smtp_port'] = 25; -// List of active plugins (in plugins/ directory) -$config['plugins'] = array( - 'archive', - 'zipdownload', - 'managesieve', - 'markasjunk' -); +// Password management +$config['password_driver'] = 'sql'; +$config['password_confirm_current'] = true; +$config['password_minimum_length'] = 6; +$config['password_db_dsn'] = 'sqlite:////data/freeposte.db'; +$config['password_query'] = ' + UPDATE user SET password=%D + WHERE id IN (SELECT user.id FROM user + INNER JOIN domain ON domain.id=user.domain_id + WHERE domain.name=%d AND user.name=%l + ) +'; +$config['password_dovecotpw'] = 'doveadm pw'; +$confog['password_dovecotpw_method'] = 'SHA512-CRYPT'; // skin name: folder from skins/ $config['skin'] = 'larry'; diff --git a/start.sh b/start.sh index 3d8aecfc..b46fee5b 100755 --- a/start.sh +++ b/start.sh @@ -1,12 +1,12 @@ -#!/bin/sh +#!/bin/bash -cat <<< EOF - __ _ _ - / _| | | (_) +cat << EOF + __ _ _ + / _| | | (_) | |_ _ __ ___ ___ _ __ ___ ___| |_ ___ _ ___ - | _| '__/ _ \/ _ \ '_ \ / _ \/ __| __/ _ \ | |/ _ \ - | | | | | __/ __/ |_) | (_) \__ \ || __/_| | (_) | - |_| |_| \___|\___| .__/ \___/|___/\__\___(_)_|\___/ + | _| '__/ _ \\/ _ \\ '_ \\ / _ \\/ __| __/ _ \\ | |/ _ \\ + | | | | | __/ __/ |_) | (_) \\__ \\ || __/_| | (_)| + |_| |_| \\___|\\___| .__/ \\___/|___/\\__\\___(_)_|\\___/ | | |_| @@ -23,15 +23,14 @@ mkdir -p \ /data/mail \ /data/webmail/tmp \ /data/logs \ + /data/logs/webmail \ /data/ssl # Create the main database if necessary -if [ ! -f /data/freeposte.db ] - sqlite3 /data/freeposte.db .databases > /dev/null -fi +[ -f /data/freeposte.db ] || sqlite3 /data/freeposte.db .databases > /dev/null # Fixing permissions -chown mail:mail /data/freeposte.db +chown mail:www-data /data/freeposte.db chown -R mail:mail /data/mail chown -R www-data:www-data /data/webmail /data/logs/webmail