<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.zhouba.cz/index.php?action=history&amp;feed=atom&amp;title=ZhoubaWiki%3AHowToSetupRoundcube</id>
	<title>ZhoubaWiki:HowToSetupRoundcube - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.zhouba.cz/index.php?action=history&amp;feed=atom&amp;title=ZhoubaWiki%3AHowToSetupRoundcube"/>
	<link rel="alternate" type="text/html" href="https://wiki.zhouba.cz/index.php?title=ZhoubaWiki:HowToSetupRoundcube&amp;action=history"/>
	<updated>2026-04-04T06:54:10Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.2</generator>
	<entry>
		<id>https://wiki.zhouba.cz/index.php?title=ZhoubaWiki:HowToSetupRoundcube&amp;diff=13&amp;oldid=prev</id>
		<title>Garak: Created page with &quot;&lt;!-- Category section --&gt; Category:Bugweis &lt;!-- Contents --&gt; {| align=&quot;right&quot;  | __TOC__  |} '''How to set up Roundcube (en)'''&lt;br&gt;&lt;br&gt; The best free webmail interface out...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.zhouba.cz/index.php?title=ZhoubaWiki:HowToSetupRoundcube&amp;diff=13&amp;oldid=prev"/>
		<updated>2021-05-22T16:21:45Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;!-- Category section --&amp;gt; &lt;a href=&quot;/index.php?title=Category:Bugweis&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Category:Bugweis (page does not exist)&quot;&gt;Category:Bugweis&lt;/a&gt; &amp;lt;!-- Contents --&amp;gt; {| align=&amp;quot;right&amp;quot;  | __TOC__  |} &amp;#039;&amp;#039;&amp;#039;How to set up Roundcube (en)&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt; The best free webmail interface out...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;!-- Category section --&amp;gt;&lt;br /&gt;
[[Category:Bugweis]]&lt;br /&gt;
&amp;lt;!-- Contents --&amp;gt;&lt;br /&gt;
{| align=&amp;quot;right&amp;quot;&lt;br /&gt;
 | __TOC__&lt;br /&gt;
 |}&lt;br /&gt;
'''How to set up Roundcube (en)'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The best free webmail interface out there at the moment is RoundCube. Download the latest version from http://roundcube.net/download and extract the contents to the &amp;lt;code&amp;gt;/usr/share&amp;lt;/code&amp;gt; directory. Change owner and permissions using the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
chown -R root:www-data /usr/share/roundcube&lt;br /&gt;
find /usr/share/roundcube -type f -exec chmod 640 {} \;&lt;br /&gt;
find /usr/share/roundcube -type d -exec chmod 750 {} \;&lt;br /&gt;
chmod 770 /usr/share/roundcube/logs&lt;br /&gt;
chmod 770 /usr/share/roundcube/temp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also create a new directory called &amp;lt;code&amp;gt;roundcube&amp;lt;/code&amp;gt; under the &amp;lt;code&amp;gt;/var/log&amp;lt;/code&amp;gt; directory. It needs to be writable by Apache.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo mkdir /var/log/roundcube&lt;br /&gt;
sudo chown www-data:adm /var/log/roundcube&lt;br /&gt;
sudo chmod 750 /var/log/roundcube&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because we want the communication between user and server to be secure, we'll use a HTTPS virtual host. Let's start by preparing a self-signed SSL certificate.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /etc/ssl&lt;br /&gt;
openssl genrsa -des3 -rand /etc/hosts -out ./private/{hostname}.key 1024&lt;br /&gt;
chmod 600 ./private/{hostname}.key&lt;br /&gt;
openssl req -new -key ./private/{hostname}.key -out ./private/{hostname}.csr&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You'll be asked to provide details for the new certificate. These details will be available for anybody to view so be careful not to disclose any sensitive information. The Common Name should always be the exact host name of the webmail system (e.g. mail.moredigital.com). Leave the challenge password empty. Now we need to self-sign the certificate and strip the passphrase.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
openssl x509 -req -days 3650 -in ./private/{hostname}.csr -signkey ./private/{hostname}.key -out ./certs/{hostname}.crt&lt;br /&gt;
openssl rsa -in ./private/{hostname}.key -out ./private/{hostname}.key.unencrypted&lt;br /&gt;
mv -f ./private/{hostname}.key.unencrypted ./private/{hostname}.key&lt;br /&gt;
chmod 600 ./private/{hostname}.key&lt;br /&gt;
rm ./private/{hostname}.csr&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should be aware that web browsers won't treat these certificated as trusted and will display a warning. But that's not a big problem for us as our primary goal is to secure the connection and not to validate identity of the server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;VirtualHost 85.118.235.162:80&amp;gt;&lt;br /&gt;
	RewriteEngine On&lt;br /&gt;
	RewriteCond %{HTTPS} off&lt;br /&gt;
	RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;VirtualHost 85.118.235.162:443&amp;gt;&lt;br /&gt;
	ServerName mail.hostname.tld&lt;br /&gt;
	DocumentRoot /usr/share/roundcubemail-0.3.1&lt;br /&gt;
	ServerAdmin admin@hostname.tld&lt;br /&gt;
&lt;br /&gt;
	ErrorLog /var/log/roundcube/apache-error.log&lt;br /&gt;
	CustomLog /var/log/roundcube/apache-access.log combined&lt;br /&gt;
&lt;br /&gt;
	# SSL&lt;br /&gt;
	SSLEngine On&lt;br /&gt;
	SSLCertificateFile /etc/ssl/certs/{hostname}.crt&lt;br /&gt;
	SSLCertificateKeyFile /etc/ssl/private/{hostname}.key&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Roundcube comes with a user friendly installation interface. You can access it by pointing your browser to the /installer sub-path of your newly setup virtual host. Follow the instructions and after your configuration is ready and has been tested, tweak roundcube config file to force HTTPS protocol.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$rcmail_config['force_https'] = TRUE;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you should modify /usr/share/roundcube/config/main.inc.php:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$rcmail_config['default_host'] = 'tls://%n';&lt;br /&gt;
$rcmail_config['smtp_server'] = 'tls://%h';&lt;br /&gt;
$rcmail_config['mail_domain'] = '%d'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Add LDAP Address Book ==&lt;br /&gt;
&lt;br /&gt;
You must install php5-ldap:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
aptitude install php5-ldap&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must uncomment &amp;quot;ADDRESSBOOK SETTINGS&amp;quot; in /usr/share/roundcube/config/main.inc.php and modify it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$rcmail_config['address_book_type'] = 'ldap';&lt;br /&gt;
'name'			=&amp;gt; 'name',&lt;br /&gt;
'hosts'			=&amp;gt; array('Hostname'),&lt;br /&gt;
'port'			=&amp;gt; Port number,&lt;br /&gt;
'base_dn'		=&amp;gt; 'Base DN',&lt;br /&gt;
'bind_dn'		=&amp;gt; 'Bind DN',&lt;br /&gt;
'bind_pass'		=&amp;gt; 'password',&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done!&lt;/div&gt;</summary>
		<author><name>Garak</name></author>
	</entry>
</feed>