webmail.sh 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. # Webmail: Using roundcube
  2. ##########################
  3. source /etc/mailinabox.conf # load global vars
  4. DEBIAN_FRONTEND=noninteractive apt-get -q -q -y install \
  5. roundcube-core php5-sqlite
  6. # The version of roundcube shipped with Ubuntu is really out of date so we'll
  7. # now upgrade the packages. We do it this way so the other dependencies are
  8. # pulled in via apt for us automatically.
  9. mkdir -p externals
  10. pkg_ver=0.9.5-4_all
  11. wget -nc -P externals http://ftp.debian.org/debian/pool/main/r/roundcube/{roundcube,roundcube-core,roundcube-sqlite3,roundcube-plugins}_$pkg_ver.deb
  12. DEBIAN_FRONTEND=noninteractive dpkg -Gi externals/{roundcube,roundcube-core,roundcube-sqlite3,roundcube-plugins}_$pkg_ver.deb
  13. # Buuuut.... the .deb is missing things?
  14. src_fn=roundcube_0.9.5.orig.tar.gz
  15. src_dir=roundcubemail-0.9.5-dep
  16. wget -nc -P externals http://ftp.debian.org/debian/pool/main/r/roundcube/$src_fn
  17. tar -C /tmp -xzf $(pwd)/externals/$src_fn
  18. if [ ! -d /var/lib/roundcube/SQL ]; then mv /tmp/$src_dir/SQL/ /var/lib/roundcube/; fi
  19. rm -rf /tmp/$src_dir
  20. # Settings
  21. tools/editconf.py /etc/roundcube/main.inc.php \
  22. "\$rcmail_config['default_host']='ssl://localhost';" \
  23. "\$rcmail_config['default_port']=993;" \
  24. "\$rcmail_config['imap_timeout']=30;" \
  25. "\$rcmail_config['smtp_server']='tls://localhost';"\
  26. "\$rcmail_config['smtp_user']='%u';"\
  27. "\$rcmail_config['smtp_pass']='%p';"\
  28. "\$rcmail_config['smtp_timeout']=30;" \
  29. "\$rcmail_config['use_https']=true;" \
  30. "\$rcmail_config['session_lifetime']=60*24*3;" \
  31. "\$rcmail_config['password_charset']='utf8';" \
  32. "\$rcmail_config['message_sort_col']='arrival';" \
  33. "\$rcmail_config['junk_mbox']='Spam';" \
  34. "\$rcmail_config['default_folders']=array('INBOX', 'Drafts', 'Sent', 'Spam', 'Trash');" \
  35. "\$rcmail_config['draft_autosave']=30;"
  36. # Configure storage of user preferences.
  37. mkdir -p $STORAGE_ROOT/mail/roundcube
  38. cat - > /etc/roundcube/debian-db.php <<EOF;
  39. <?php
  40. \$dbtype = 'sqlite';
  41. \$basepath = '$STORAGE_ROOT/mail/roundcube';
  42. \$dbname = 'roundcube.sqlite';
  43. ?>
  44. EOF
  45. chown -R www-data.www-data $STORAGE_ROOT/mail/roundcube
  46. # Enable PHP modules.
  47. php5enmod mcrypt
  48. service php-fastcgi restart