安装Webmail客户端Roundcube
为什么要安装Roundcube主要有两方面原因:第一,代收Riseup邮件,因某些原因Riseup需要代理访问,同理也可添加其它邮箱账户如Gmail;第二,自Roundcube1.4发布以后,系统所带的新主题“Elastic”非常惊艳,autistici邮箱也已经切换为“Elastic”。
系统环境
- VPS:Amazon Lightsail
- 操作系统:Ubuntu 18.04
- 服务器:Apache 2.4.29
- PHP版本:7.2.24
- 数据库:Mysql Ver 14.14 Distrib 5.7.29
软件下载
-
下载Roundcube
登陆https://roundcube.net/download/,下载Roundcube1.4.3 Complete版本。也可以直接在服务器运行
wget -c https://github.com/roundcube/roundcubemail/releases/download/1.4.3/roundcubemail-1.4.3-complete.tar.gz -
解压Roundcube压缩文件
tar xvf roundcubemail-1.4.3-complete.tar.gz -
将文件夹移动到
/var/www/sudo mv roundcubemail-1.4.3 /var/www/roundcube -
改Roundcube文件夹拥有者为
www-datasudo chown -R www-data: roundcube/
Apache设置
-
DNS设置
添加“A”记录,将“mail”主机记录对应到VPS ip地址,仅供参考。
-
进入Apache存放网站配置文件的文件夹
cd /etc/apache2/sites-available/ -
创建config文件
sudo cp 000-default.conf mail.conf -
编辑配置文件
sudo nano mail.conf以httpsmail为例:
ServerAdmin me@httpsmail.com ServerName mail.httpsmail.com DocumentRoot /var/www/roundcube
-
启用配置文件
sudo a2ensite mail.conf -
重启服务器
sudo systemctl restart apache2.service或
重载服务器
sudo systemctl reload apache2.service
安装PHP及扩展
-
安装PHP
sudo apt install php-fpm -
PHP扩展,可参考官方wiki: https://github.com/roundcube/roundcubemail/wiki/Install-Requirements。在后期安装Roundcube时也会有提示,缺哪个就安哪个即可。
- PHP version 5.4.1 or greater with
- PCRE (Perl-Compatible Regular Expressions)
- DOM
- JSON
- XML
- Mbstring
- OpenSSL
- Session support
- Socket support
- PHP Data Objects (PDO) with driver for either MySQL, PostgreSQL, SQL Server or SQLite
- Iconv (optional)
- FileInfo (optional)
- Zip (optional)
- Pspell (optional)
- PEAR packages distributed with Roundcube or external:
- Mail_Mime 1.10.0 or newer
- Net_SMTP 1.7.1 or newer
- Net_Socket 1.2.1 or newer
- Net_IDNA2 0.1.1 or newer
- Auth_SASL 1.1.0 or newer
- Net_Sieve 1.4.0 or newer (for managesieve plugin)
- Crypt_GPG 1.6.1 or newer (for enigma plugin)
- Net_LDAP2 2.2.0 or newer (for LDAP address books)
- kolab/Net_LDAP3 1.0.6 or newer (for LDAP address books)
- PHP version 5.4.1 or greater with
-
重启PHP
sudo systemctl restart php7.2-fpm.service
Mysql数据创建
-
安装PHP数据库扩展
sudo apt install php-mysql -
数据库安装
sudo mysql_secure_installation -
登陆数据库
sudo mysql -u root -p -
创建Database
CREATE DATABASE roundcubemail; -
创建用户、密码及权限
GRANT ALL PRIVILEGES ON roundcubemail.* TO roundcube@localhost IDENTIFIED BY '密码'; -
刷新
FLUSH PRIVILEGES;
安装、配置Roundcube
-
访问“Mail域名/installer”,如http://mail.httpsmail.com/installer,按步骤一步一步安装、配置即可。
-
STEP 1
主要检测运行环境、相关软件、扩展和设置是否正确。“Checking available databases”一栏“MySQL: OK”即可,其它数据库显示“NOT AVAILABLE”不影响安装使用。除此之外,必须确保所有项目状态为OK。
时区设置
sudo nano /etc/php/7.2/apache2/php.ini将
date.timezone改为date.timezone = Asia/Shanghai。 -
STEP 2
- General configuration:按实际情况填写,也可以默认
- Logging & Debugging:同上
- Database setup:数据库按上文Mysql数据创建第5步创建的信息填写,如果没自己更改的话,只填密码即可,其它的默认。
- IMAP Settings:以Riseup为例
- default_host:ssl://mail.riseup.net
- default_port:993
- username_domain:riseup.net(添加域名后,登陆就不需要输入邮箱后缀了)
- 其它:默认
- SMTP Settings:以Riseup为例
- smtp_server:ssl://mail.riseup.net
- smtp_port:465
- 其它:可默认
- Display settings & user prefs:可默认
- Plugins:Roundcube插件,按需添加。”enigma“插件是用于邮件PGP加密解密的。
-
STEP 3 测试
确保所有项目状态为”OK“,若”Check DB config“处”DB Schema: NOT OK“,点击下面的
Initialize database按钮初始化数据库即可。
登陆邮箱
访问邮箱地址,输入用户名和密码就可以使用了。

邮箱界面
