1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2026-03-05 15:57:23 +01:00

web and roundcube webmail

This commit is contained in:
Joshua Tauberer
2013-09-07 16:53:25 -04:00
parent 43f4ef94b7
commit b770c5370b
6 changed files with 111 additions and 25 deletions

View File

@@ -59,6 +59,8 @@ EOF
. scripts/dkim.sh
. scripts/spamassassin.sh
. scripts/dns_update.sh
. scripts/web.sh
. scripts/webmail.sh
if [ -z `tools/mail.py user` ]; then
# The outut of "tools/mail.py user" is a list of mail users. If there

View File

@@ -1,6 +1,6 @@
# Base system configuration.
apt-get -q update
apt-get -q -q update
apt-get -q -y upgrade
# Turn on basic services:

View File

@@ -1,16 +1,24 @@
# HTTP: Turn on a web server serving static files
#################################################
apt-get install -q -y nginx
apt-get install -q -y \
nginx
rm -f /etc/nginx/sites-enabled/default.conf
rm -f /etc/nginx/sites-enabled/default
STORAGE_ROOT_ESC=$(echo $STORAGE_ROOT|sed 's/[\\\/&]/\\&/g')
PUBLIC_HOSTNAME_ESC=$(echo $PUBLIC_HOSTNAME|sed 's/[\\\/&]/\\&/g')
cat conf/nginx.conf \
| sed "s/\$STORAGE_ROOT/$STORAGE_ROOT/g" \
| sed "s/\$PUBLIC_HOSTNAME/$PUBLIC_HOSTNAME/g" \
> /etc/nginx/sites-enabled/local.conf
| sed "s/\$STORAGE_ROOT/$STORAGE_ROOT_ESC/g" \
| sed "s/\$PUBLIC_HOSTNAME/$PUBLIC_HOSTNAME_ESC/g" \
> /etc/nginx/conf.d/local.conf
service nginx reload
mkdir -p $STORAGE_ROOT/www/static
service nginx restart
conf/php-fcgid start
ufw allow http
ufw allow https

50
scripts/webmail.sh Executable file
View File

@@ -0,0 +1,50 @@
# Webmail: Using roundcube
##########################
DEBIAN_FRONTEND=noninteractive apt-get install -q -y \
roundcube-core php5-sqlite
# The version of roundcube shipped with Ubuntu is really out of date so we'll
# now upgrade the packages. We do it this way so the other dependencies are
# pulled in via apt for us automatically.
mkdir -p externals
pkg_ver=0.9.2-2_all
wget -nc -P externals http://ftp.debian.org/debian/pool/main/r/roundcube/{roundcube,roundcube-core,roundcube-sqlite3,roundcube-plugins}_$pkg_ver.deb
DEBIAN_FRONTEND=noninteractive dpkg -Gi externals/{roundcube,roundcube-core,roundcube-sqlite3,roundcube-plugins}_$pkg_ver.deb
# Buuuut.... the .deb is missing things?
wget -nc -P externals http://downloads.sourceforge.net/project/roundcubemail/roundcubemail/0.9.3/roundcubemail-0.9.3.tar.gz
tar -xzf externals/roundcubemail-0.9.3.tar.gz
if [ ! -d /usr/share/roundcube/SQL ]; then mv roundcubemail-0.9.3/SQL/ /usr/share/roundcube/; fi
rm -rf roundcubemail-0.9.3
# Settings
tools/editconf.py /etc/roundcube/main.inc.php \
"\$rcmail_config['default_host']='ssl://localhost';" \
"\$rcmail_config['default_port']=993;" \
"\$rcmail_config['imap_timeout']=30;" \
"\$rcmail_config['smtp_server']='tls://localhost';"\
"\$rcmail_config['smtp_user']='%u';"\
"\$rcmail_config['smtp_pass']='%p';"\
"\$rcmail_config['smtp_timeout']=30;" \
"\$rcmail_config['use_https']=true;" \
"\$rcmail_config['session_lifetime']=60*24*3;" \
"\$rcmail_config['password_charset']='utf8';" \
"\$rcmail_config['message_sort_col']='arrival';" \
"\$rcmail_config['junk_mbox']='Spam';" \
"\$rcmail_config['default_folders']=array('INBOX', 'Drafts', 'Sent', 'Spam', 'Trash');" \
"\$rcmail_config['draft_autosave']=30;"
# Configure storage of user preferences.
mkdir -p $STORAGE_ROOT/mail/roundcube
cat - > /etc/roundcube/debian-db.php <<EOF;
<?php
\$dbtype = 'sqlite';
\$basepath = '$STORAGE_ROOT/mail/roundcube';
\$dbname = 'roundcube.sqlite';
?>
EOF
chown -R www-data.www-data $STORAGE_ROOT/mail/roundcube