Files
org-roamings/20220526105643-roundcube.org
2022-06-04 12:57:39 +02:00

2.0 KiB

Roundcube

Introduction

Installation

Configuration de nginx

cat >/etc/nginx/sites-available/mail <<EOF
server {
    server_name mail.adrien.run;

    access_log /var/log/nginx/mail.access.log;
    error_log  /var/log/nginx/mail.error.log;

    root /var/lib/roundcube;
    index index.php;

    location / {
       try_files $uri $uri/ /index.php?q=$uri&$args;
    }

    location ~ ^/(README.md|INSTALL|LICENSE|CHANGELOG|UPGRADING)$ {
       deny all;
    }

    location ~ ^/(config|temp|logs)/ {
       deny all;
    }

    location ~ /\. {
       deny all;
       access_log off;
       log_not_found off;
    }

    location ~ \.php$ {
       try_files $uri =404;
       fastcgi_pass unix:/var/run/php/php-fpm.sock;
       fastcgi_index index.php;
       fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
       include fastcgi_params;
    }

    add_header Strict-Transport-Security "max-age=31536000";

    listen 443 ssl;
}
server {
    if ($host = mail.adrien.run) {
        return 301 https://$host$request_uri;
    } # managed by Certbot

    server_name mail.adrien.run;
    listen 80;
    return 404; # managed by Certbot
}
	EOF
ln -s /etc/nginx/sites-available/mail /etc/nginx/sites-enabled/mail
certbot --nginx -d mail.adrien.run

Installation et configuration

apt-get install roundcube roundcube-pgsql

Pour reconfigurer roundcube :

dpkg-reconfigure roundcube-core
cat >/etc/roundcube/debian-db.php <<EOF
$dbuser='roundcube';
$dbpass='<password>';
$basepath='';
$dbname='roundcubemail';
$dbserver='localhost';
$dbport='';
$dbtype='pgsql';
EOF

Modifier les lignes suivantes dans le fichier /etc/roundcube/config.inc.php :

$config['default_host'] = array("tls://imap.adrien.run");
$config['smtp_server'] = 'smtp.adrien.run';

Références