Commit d1e3062f authored by Nolan's avatar Nolan

Add roundcube to email app.

parent 08b6313f
......@@ -13,6 +13,10 @@ postfix:
docker build --build-arg FROM_PREFIX=$(ARCH)/ -t $(ARCH)/email-postfix ./postfix
CONTAINERS += postfix
roundcube:
docker build --build-arg FROM_PREFIX=$(ARCH)/ -t $(ARCH)/email-roundcube ./roundcube
CONTAINERS += roundcube
PHONY += $(CONTAINERS)
PHONY += all
......
......@@ -15,6 +15,12 @@
"hostname": "imap",
"storagedirs": [ "/home/" ],
"PRIVDNS": [ "imap" ]
},
"roundcube": {
"networks": [ "private" ],
"hostname": "webmail",
"storagedirs": [ "/var/lib/dbconfig-common/sqlite3/roundcube/" ],
"PRIVDNS": [ "webmail" ]
}
}
}
ARG FROM_PREFIX
FROM ${FROM_PREFIX}python3
#XXX Switch to nginx. May not be easy thanks for debian's deps.
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y roundcube roundcube-sqlite3 \
&& sed -i 's|/var/www/html|/var/lib/roundcube|g' /etc/apache2/sites-enabled/000-default.conf \
&& rm -rf /var/lib/apt/lists/*
COPY config.inc.php /etc/roundcube/
COPY php.ini /etc/php/7.0/apache2/conf.d/99-local.ini
RUN dpkg-reconfigure -f noninteractive roundcube-core \
&& cat /var/lib/dbconfig-common/sqlite3/roundcube/roundcube | gzip > /rcdb.gz \
&& rm /var/lib/dbconfig-common/sqlite3/roundcube/roundcube
COPY start.sh /
CMD ["bash", "/start.sh"]
<?php
/*
+-----------------------------------------------------------------------+
| Local configuration for the Roundcube Webmail installation. |
| |
| This is a sample configuration file only containing the minimum |
| setup required for a functional installation. Copy more options |
| from defaults.inc.php to this file to override the defaults. |
| |
| This file is part of the Roundcube Webmail client |
| Copyright (C) 2005-2013, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
| See the README file for a full license statement. |
+-----------------------------------------------------------------------+
*/
$config = array();
/* Do not set db_dsnw here, use dpkg-reconfigure roundcube-core to configure database ! */
include_once("/etc/roundcube/debian-db-roundcube.php");
// The mail host chosen to perform the log-in.
// Leave blank to show a textbox at login, give a list of hosts
// to display a pulldown menu or set one host as string.
// To use SSL/TLS connection, enter hostname with prefix ssl:// or tls://
// Supported replacement variables:
// %n - hostname ($_SERVER['SERVER_NAME'])
// %t - hostname without the first part
// %d - domain (http hostname $_SERVER['HTTP_HOST'] without the first part)
// %s - domain name after the '@' from e-mail address provided at login screen
// For example %n = mail.domain.tld, %t = domain.tld
$config['default_host'] = 'ssl://email-dovecot';
$config['default_port'] = 993;
// SMTP server host (for sending mails).
// To use SSL/TLS connection, enter hostname with prefix ssl:// or tls://
// If left blank, the PHP mail() function is used
// Supported replacement variables:
// %h - user's IMAP hostname
// %n - hostname ($_SERVER['SERVER_NAME'])
// %t - hostname without the first part
// %d - domain (http hostname $_SERVER['HTTP_HOST'] without the first part)
// %z - IMAP domain (IMAP hostname without the first part)
// For example %n = mail.domain.tld, %t = domain.tld
$config['smtp_server'] = '';
// SMTP port (default is 25; use 587 for STARTTLS or 465 for the
// deprecated SSL over SMTP (aka SMTPS))
$config['smtp_port'] = 587;
// SMTP username (if required) if you use %u as the username Roundcube
// will use the current username for login
$config['smtp_user'] = '';
// SMTP password (if required) if you use %p as the password Roundcube
// will use the current user's password for login
$config['smtp_pass'] = '';
// provide an URL where a user can get support for this Roundcube installation
// PLEASE DO NOT LINK TO THE ROUNDCUBE.NET WEBSITE HERE!
$config['support_url'] = '';
// Name your service. This is displayed on the login screen and in the window title
$config['product_name'] = 'Roundcube Webmail';
// this key is used to encrypt the users imap password which is stored
// in the session record (and the client cookie if remember password is enabled).
// please provide a string of exactly 24 chars.
// YOUR KEY MUST BE DIFFERENT THAN THE SAMPLE VALUE FOR SECURITY REASONS
$config['des_key'] = 'XXXDESKEYXXX';
// List of active plugins (in plugins/ directory)
// Debian: install roundcube-plugins first to have any
$config['plugins'] = array(
);
// skin name: folder from skins/
$config['skin'] = 'larry';
// Disable spellchecking
// Debian: spellshecking needs additional packages to be installed, or calling external APIs
// see defaults.inc.php for additional informations
$config['enable_spellcheck'] = false;
//XXX Hopefully we can get rid of this later.
// We access the IMAP and SMTP servers locally with internal names, SSL
// will obviously fail but this sounds better than allowing insecure login
// from the outter world
$ssl_no_check = array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
'ciphers' => 'ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES128:DH+AES:ECDH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5',
),
);
$config['imap_conn_options'] = $ssl_no_check;
$config['smtp_conn_options'] = $ssl_no_check;
$config['managesieve_conn_options'] = $ssl_no_check;
date.timezone=UTC
upload_max_filesize = 40M
post_max_size = 40M
#!/bin/sh
useradd -m $USERNAME
echo $USERNAME:prjx321 | chpasswd
if [ ! -f /var/lib/dbconfig-common/sqlite3/roundcube/roundcube ]; then
zcat /rcdb.gz > /var/lib/dbconfig-common/sqlite3/roundcube/roundcube
chown www-data.www-data /var/lib/dbconfig-common/sqlite3/roundcube
chmod ug+rwx /var/lib/dbconfig-common/sqlite3/roundcube
chmod o+rx /var/lib/dbconfig-common/sqlite3/roundcube
chown www-data.www-data /var/lib/dbconfig-common/sqlite3/roundcube/roundcube
chmod ug+rw /var/lib/dbconfig-common/sqlite3/roundcube/roundcube
fi
if grep -q XXXDESKEYXXX /etc/roundcube/config.inc.php; then
KEY=`dd if=/dev/urandom bs=1024 count=1 | base64 -w 0 | tr -d '=' | cut -c1-24`
sed -i "s/XXXDESKEYXXX/$KEY/g" /etc/roundcube/config.inc.php
fi
exec apache2ctl -DFOREGROUND
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment