1 { env, roundcubemail, apacheHttpd, config }:
3 varDir = "/var/lib/roundcubemail";
7 install -m 0755 -o ${apache.user} -g ${apache.group} -d ${varDir} \
8 ${varDir}/cache ${varDir}/logs
9 install -m 0750 -o ${apache.user} -g ${apache.group} -d ${varDir}/phpSessions
12 keys."webapps/tools-roundcube" = {
18 psql_url = with env.postgresql; "pgsql://${user}:${password}@unix(${socket}:${port})/${database}";
21 $config['db_dsnw'] = '${psql_url}';
22 $config['default_host'] = 'ssl://imap.immae.eu';
23 $config['username_domain'] = array(
24 "imap.immae.eu" => "mail.immae.eu"
26 $config['imap_conn_options'] = array("ssl" => array("verify_peer" => false));
27 $config['smtp_server'] = 'tls://smtp.immae.eu';
28 $config['smtp_port'] = '587';
29 $config['managesieve_host'] = 'imap.immae.eu';
30 $config['managesieve_port'] = '4190';
31 $config['managesieve_usetls'] = true;
32 $config['managesieve_conn_options'] = array("ssl" => array("verify_peer" => false));
34 $config['imap_cache'] = 'db';
35 $config['messages_cache'] = 'db';
37 $config['support_url'] = ''';
39 $config['des_key'] = '${env.secret}';
41 $config['skin'] = 'elastic';
42 $config['plugins'] = array(
43 'attachment_reminder',
45 'filesystem_attachments',
56 'automatic_addressbook',
59 // Ne marche pas ?: 'ident_switch',
60 // Ne marche pas ?: 'thunderbird_labels',
63 $config['language'] = 'fr_FR';
65 $config['drafts_mbox'] = 'Drafts';
66 $config['junk_mbox'] = 'Junk';
67 $config['sent_mbox'] = 'Sent';
68 $config['trash_mbox'] = 'Trash';
69 $config['default_folders'] = array('INBOX', 'Drafts', 'Sent', 'Junk', 'Trash');
70 $config['draft_autosave'] = 60;
71 $config['enable_installer'] = false;
72 $config['log_driver'] = 'file';
73 $config['temp_dir'] = '${varDir}/cache';
74 $config['mime_types'] = '${apacheHttpd}/conf/mime.types';
77 webRoot = (roundcubemail.override { roundcube_config = config.secrets.fullPaths."webapps/tools-roundcube"; }).withPlugins (p: [ p.automatic_addressbook p.carddav p.contextmenu p.contextmenu_folder p.html5_notifier p.ident_switch p.message_highlight p.thunderbird_labels ]);
81 modules = [ "proxy_fcgi" ];
82 webappName = "tools_roundcubemail";
83 root = "/run/current-system/webapps/${webappName}";
84 vhostConf = socket: ''
85 Alias /roundcube "${root}"
87 DirectoryIndex index.php
89 Options FollowSymlinks
93 SetHandler "proxy:unix:${socket}|fcgi://localhost"
99 serviceDeps = [ "postgresql.service" ];
100 basedir = builtins.concatStringsSep ":" (
101 [ webRoot config.secrets.fullPaths."webapps/tools-roundcube" varDir ]
105 "listen.owner" = apache.user;
106 "listen.group" = apache.group;
108 "pm.max_children" = "60";
109 "pm.process_idle_timeout" = "60";
111 # Needed to avoid clashes in browser cookies (same domain)
112 "php_value[session.name]" = "RoundcubemailPHPSESSID";
113 "php_admin_value[upload_max_filesize]" = "200M";
114 "php_admin_value[post_max_size]" = "200M";
115 "php_admin_value[open_basedir]" = "${basedir}:${apacheHttpd}/conf/mime.types:/tmp";
116 "php_admin_value[session.save_path]" = "${varDir}/phpSessions";