Webmail setup

From Smith family
Jump to: navigation, search
Server setup
← Previous Next →
Mediawiki farm Print server

Installation

This one's easy, once the HTTPS web server is set up.

I'm using Roundcube as a webmail interface.

  • Install the packages:
root@server:~# aptitude install roundcube roundcube-pgsql roundcube-plugins
(Install other aspell- dictionaries as you wish at the same time.)
  • Follow the defaults in the questions asked during installation. However, these questions don't address all the configuration options. Therefore, after installation, reconfigure the packages:
root@server:~# sudo dpkg-reconfigure roundcube-core
  • Roundcube wants to make itself available as domain.tld/roundcube on all sites. The file /etc/apache2/conf-available/roundcube.conf does this with the Alias /roundcube /var/lib/roundcube directive, which is initially commented out. Keep it commented out, and copy the contents of that file into the /etc/apache2/sites-available/webmail.domain.tld.conf, uncommenting the Alias line.
  • Disable the Roundcube configuration, enable the webmail site, and reload Apache:
root@server:~# a2disconf roundcube
root@server:~# a2ensite webmail.domain.tld.conf
root@server:~# systemctl reload apache2.service
  • Visit https://webmail.domain.tld and you should be able to log on.

Installing plugins

Where possible, use the Roundcube plugins installer, working from the /var/lib/roundcube directory.

Mobile skin

Roundcube doesn't work well on mobile devices. The Melanie2 skin seems to be a good alternative. The instructions at the Roundcube inbox are slightly unclear with paths, so here's what I did.

root@server:~# cd /var/lib/roundcube
root@server:/var/lib/roundcube# git clone https://github.com/messagerie-melanie2/Roundcube-Skin-Melanie2-Larry-Mobile.git skins/melanie2_larry_mobile
root@server:/var/lib/roundcube# php composer.phar update
root@server:/var/lib/roundcube# php composer.phar require melanie2/mobile:dev-master
remembering to say "no" to activating the jquery_mobile plugin, but "yes" to activating the mobile plugin.

Enigma

The Enigma plugin comes as part of the Roundcube installation. To enable it, add enigma to the list of enabled plugins in /etc/roundcube/config.inc.php.

(Note that this doesn't seem to work at the moment.)

/etc/apache2/sites-available/webmail.domain.tld.conf

<VirtualHost *:443>
    ServerAdmin webmaster@localhost

    SSLEngine On

    # SSLCertificateChainFile /etc/letsencrypt/live/webmail.domain.tld/chain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/webmail.domain.tld/privkey.pem
    SSLCertificateFile /etc/letsencrypt/live/webmail.domain.tld/fullchain.pem

    DocumentRoot /var/lib/roundcube
    ServerName webmail.domain.tld

    <Directory />
            Options +FollowSymLinks -Indexes
            AllowOverride None
    </Directory>

    <Directory /var/lib/roundcube/>
        Options +FollowSymLinks
        # This is needed to parse /var/lib/roundcube/.htaccess. See its
        # content before setting AllowOverride to None.
        AllowOverride All
        <IfVersion >= 2.3>
            Require all granted
        </IfVersion> 
        <IfVersion < 2.3>
            Order allow,deny
            Allow from all
        </IfVersion>
    </Directory>

    # Protecting basic directories:
    <Directory /var/lib/roundcube/config>
        Options -FollowSymLinks
        AllowOverride None
    </Directory>

    <Directory /var/lib/roundcube/temp>
        Options -FollowSymLinks
        AllowOverride None
        <IfVersion >= 2.3>
            Require all denied
        </IfVersion> 
        <IfVersion < 2.3>
            Order allow,deny
            Deny from all
        </IfVersion>
    </Directory>

    <Directory /var/lib/roundcube/logs>
        Options -FollowSymLinks
        AllowOverride None
        <IfVersion >= 2.3>
            Require all denied
        </IfVersion> 
        <IfVersion < 2.3>
            Order allow,deny
            Deny from all
        </IfVersion>
    </Directory>
 
    ErrorLog /var/log/apache2/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog /var/log/apache2/webmail.domain.tld.access.log combined

    ServerSignature Off

</VirtualHost>

See also