Roundcube

De Banane Atomic
Aller à la navigationAller à la recherche

Links

Configuration

/etc/roundcube/config.inc.php
$config['imap_host'] = 'localhost:143';
$config['smtp_host'] = 'localhost:25';

// compose html formatted messages by default
//  4 - always, except when replying to plain text message
$config['htmleditor'] = 4;

// by default: '', the value is asked at login ???
$config['default_host'] = 'domain.fr';
/etc/hosts
127.0.0.1    localhost domain.fr
::1          localhost ip6-localhost ip6-loopback domain.fr

NGINX

/etc/nginx/sites-available/rouncube.conf
server {
    server_name roundcube.localserver;
    listen      80;
    root        /var/www/roundcube;
    index       index.php;

    allow 192.168.0.0/24;
    deny all;

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php-fpm.sock;
    }
}

Apache

conf

L'accès au site se fait via cette url http://[server-name]/roundcube
/etc/apache2/conf-available/roundcube.conf/etc/roundcube/apache.conf
/etc/roundcube/apache.conf
# Those aliases do not work properly with several hosts on your apache server
# Uncomment them to use it or adapt them to your configuration
Alias /roundcube /var/lib/roundcube

<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>

site

Pour utiliser un site plutôt qu'une conf.

Bash.svg
# désactiver la conf roundcube
sudo a2disconf roundcube
# activer le site roundcube
sudo a2ensite roundcube
/etc/apache2/sites-available/roundcube.conf
<VirtualHost *:80>
    ServerName roundcube.domain.fr
    Redirect   / https://roundcube.domain.fr/
</VirtualHost>

<VirtualHost *:443>
    ServerName roundcube.domain.fr
    DocumentRoot /var/lib/roundcube
    
    SSLCertificateFile      /etc/letsencrypt/live/domain.fr/fullchain.pem
    SSLCertificateKeyFile   /etc/letsencrypt/live/domain.fr/privkey.pem
    Include                 /etc/letsencrypt/options-ssl-apache.conf

    <FilesMatch "\.php$">
        SSLOptions +StdEnvVars
    </FilesMatch>

    ErrorLog ${APACHE_LOG_DIR}/roundcube-error.log
    LogLevel warn
    CustomLog ${APACHE_LOG_DIR}/roundcube-access.log combined
    
    <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
        Require all granted
    </Directory>

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

    <Directory /var/lib/roundcube/temp>
        Options -FollowSymLinks
        AllowOverride None
        Require all denied
    </Directory>

    <Directory /var/lib/roundcube/logs>
        Options -FollowSymLinks
        AllowOverride None
        Require all denied
    </Directory>
</VirtualHost>

Installation

GitHub

Bash.svg
wget https://github.com/roundcube/roundcubemail/releases/download/1.6.2/roundcubemail-1.6.2-complete.tar.gz
tar xf roundcubemail-1.6.2-complete.tar.gz
sudo mv roundcubemail-1.6.2 /var/www/roundcube
sudo chown www-data:www-data /var/www/roundcube/temp
Mariadb.svg
create database roundcube;
create user 'roundcube'@'localhost' identified by 'PassWord';
grant all on roundcube.* to 'roundcube'@'localhost';
flush privileges;
Bash.svg
# edit and add 'use roundcube;' at the beginnig of the sql script
sudo mariadb < /var/www/roundcube/SQL/mysql.initial.sql
  • setup the web configuration then go to http://roundcube.localserver/installer

APT

Bash.svg
sudo apt install roundcube roundcube-mysql
Mysql access configuration file /etc/dbconfig-common/roundcube.conf