Chinaunix首页 | 论坛 | 博客
  • 博客访问: 253560
  • 博文数量: 72
  • 博客积分: 1410
  • 博客等级: 上尉
  • 技术积分: 541
  • 用 户 组: 普通用户
  • 注册时间: 2009-03-13 09:42
文章分类
文章存档

2015年(2)

2012年(1)

2011年(1)

2010年(3)

2009年(65)

我的朋友

分类:

2010-01-08 10:21:18

本文档参考自http://www.iredmail.org/wiki/index.php?title=IRedMail-doc-MySQL-0.2-Roundcubemail-0.1.1&variant=zh-cn
目录
1 Roundcubemail 简介
2 安装、配置 Roundcube
3 补丁
3.1 修改密码、设置转发
3.2 自动回复
4 Trouble Shooting
5 Resource Links
Roundcubemail 简介
RoundCube Web Mail是一个基于浏览器,支持多国语言的IMAP客户端,操作界面看起像一个桌面应用程序。它提供一个e-mail客户端应该具备的所有功能包括MIME支持,地址薄,文件夹操作,信息搜索和拼写检查。RoundCube Webmail采用PHP+Ajax开发并且需要MySQL数据库来存储数据。用户界面采用XHTML+CSS2设计.
安装、配置 Roundcube
从 Roundcubemail 的官方主页下载最新版本:
    注:刚把0.2的配置出来,就发现这两天刚出了0.2.1版。不过方法都一样的。
     http://roundcube.net/downloads
下载后解压缩并设置正确的权限: Shell 命令:
# tar zxvf roundcubemail-0.2.tar.gz
# mv  roundcubemail-0.2 /var/www/html/roundcubemail
# chown -R root:root /var/www/html/roundcubemail/
# chown -R www-data:www-data /var/www/html/roundcubemail/{temp,logs}
# chmod 777 /var/www/html/roundcubemail/{temp,logs}
# chmod 0000 /var/www/html/roundcubemail-0.1/{CHANGELOG,INSTALL,LICENSE,README,UPGRADING,installer}
###  0000让其没有任何权限,可以不设置
导入 Roundcubemail 的数据库: Shell 命令:
# mysql -uroot -p
# 创建数据库:roundcubemail
mysql> CREATE DATABASE roundcubemail DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
# 将数据库的权限给 MySQL 的本地用户:roundcube。请将这里的 'your_passwd' 改为你需要的密码。
mysql> GRANT ALL PRIVILEGES ON roundcubemail.* TO roundcube@localhost IDENTIFIED BY 'your_passwd';
# 导入数据库表
mysql> use roundcubemail;
mysql> source /var/www/html/roundcubemail/SQL/mysql.initial.sql
mysql> flush privileges;
为 Roundcubemail 设置数据库信息: Shell 命令:
# cd /var/www/html/roundcubemail/config/
# cp db.inc.php.dist db.inc.php
# cp main.inc.php.dist main.inc.php

在这里将db.inc.php文件里的db_dsnw的值设置为: 文件: /var/www/html/roundcubemail/config/db.inc.php
$rcmail_config['db_dsnw'] = 'mysql://roundcube:your_passwd@localhost/roundcubemail';
 
配置 main.inc.php: 文件: /var/www/html/roundcubemail-0.1/config/main.inc.php
# 默认的 IMAP 服务器
$rcmail_config['default_host'] = '127.0.0.1';
# 默认的 SMTP 服务器
$rcmail_config['smtp_server'] = '127.0.0.1';
$rcmail_config['smtp_user'] = '%u';
$rcmail_config['smtp_pass'] = '%p';
# 自动创建目录
$rcmail_config['create_default_folders'] = TRUE;
# 默认的域名
# 用户在登录的时候只需要输入 'username' 即可,Roundcubemail 会自动为它加上
# 'username_domain' 里指定的域名,所以用户名就变成:。
#$rcmail_config['username_domain'] = 'example.org';
# 默认显示的界面语言。可选用的值可以去该目录下找,目录名就是可选的值:
# /var/www/roundcube-0.1/program/localization/
$rcmail_config['locale_string'] = 'zh_CN';
# 设置默认的时区。东八区
$rcmail_config['timezone'] = 8;
# 是否拼写检查
$rcmail_config['enable_spellcheck'] = FALSE;
为 Roundcubemail 设置 Apache 目录别名。新建文件:/etc/apache2/sites-available/roundcubemail,内容为: 文件: /etc/apache2/sites-available/roundcubemail
NameVirtualHost *:80

ServerName mail.example.org
DocumentRoot /var/www/roundcubemail
Options Indexes FollowSymLinks
DirectoryIndex index.php
    Shell 命令:
# ln -sv /etc/apache2/sites-available/roundcubemail /etc/apache2/sites-enabled/100-roundcubemail
# apache2ctl restart

这样就可以通过以下地址来访问 Roundcube 了(任选其一即可):


 
补丁
注:此补丁均为0.1.1版的 ,0.2版的需下载patch后进行修改。
修改密码、设置转发
由于 Roundcubemail-0.1.1 里没有提供让用户自行修改密码和设置邮件转发的功能,所以这里打一个补丁用于提供这两个功能。
注:在此特别感谢 Jungle gmail 帮忙制作了这个补丁。
下载补丁(注:该补丁只在 Roundcubemail-0.1.1 stable 版本上测试通过,其它版本没有经过测试): Shell 命令:
# cd /tmp/
# wget -c http://rhms.googlecode.com/svn/trunk/rhms/patches/roundcubemail/roundcubemail-0.1.1_chpwd_forward.patch
# wget -c http://rhms.googlecode.com/svn/trunk/rhms/patches/roundcubemail/roundcubemail-0.1.1_chpwd_forward_skins.patch
进入指定目录并打补丁(打补丁前一定要注意所在的目录): Shell 命令:
# cd /var/www/roundcubemail-0.1.1/
# patch -p0 < /tmp/roundcubemail-0.1.1_chpwd_forward.patch
# cd /var/www/roundcubemail-0.1.1/skins/default/
# patch -p0 < /tmp/roundcubemail-0.1.1_chpwd_forward_skins.patch

由于 roundcubemail 使用的是数据库 'roundcubemail',用户是 'roundcube@localhost',所以这里需要让 'roundcube@localhost' 能够修改 vmail.mailbox 这个表。设置数据库权限: Shell 命令:
# mysql -uroot -p
mysql> GRANT UPDATE,SELECT ON vmail.mailbox TO roundcube@localhost;
mysql> GRANT INSERT,UPDATE,SELECT ON vmail.alias TO roundcube@localhost;
mysql> FLUSH PRIVILEGES;
mysql> quit
 
这样就可以在登录 Roundcubemail 后,通过访问“系统设定”里的“密码”和“邮件转发”标签修改密码和设置转发了。
自动回复
创建目录并设置正确的权限: Shell 命令:
# mkdir /var/www/sieve/
# chown www-data:vmail /var/www/sieve/
# chmod 0770 /var/www/sieve/
# 创建链接:
# cd /var/www/roundcubemail-0.1.1/
# ln -s ../sieve/ sieve
打补丁: Shell 命令:
# cd /var/www/roundcubemail-0.1.1/
# patch -p0 < /tmp/roundcubemail-0.1.1_vacation.patch
# cd /var/www/roundcubemail-0.1.1/skins/default/
# patch -p0 < /tmp/roundcubemail-0.1.1_vacation_skin_default.patch
# 如果有 default-labels 这个主题,也可以直接打补丁:
# cd /var/www/roundcubemail-0.1.1/skins/default-labels/
# patch -p0 < /tmp/roundcubemail-0.1.1_vacation_skin_default.patch
登录 Roundcubemail,在“系统设定”里可以看到“自动回复”的标签。输入一些内容试试吧。
Trouble Shooting
Roundcubemail 的调试日志文件是:/var/www/roundcubemail-0.1.1/logs/error
如果无法登录 Roundcubemail,请留意这里的错误信息。如果这里的信息不 足以分析出问题,请结合 Dovecot 的 debug 信息来判断。
Resource Links
Roundcubemail
Roundcubemail Forum 
 
 
http://blog.chinaunix.net/u2/73230/showart_1859967.html
Roundcube webmail需求
The basic requirements are:
PHP Version 5.2.0 or greater including
PCRE (perl compatible regular expression)
Session support
Libiconv (recommended)
OpenSSL (recommended)
FileInfo (optional)
Multibyte/mbstring (optional)
Mcrypt (optional)
php.ini options:
error_reporting E_ALL & ~E_NOTICE (or lower)
file_uploads on (for attachment upload features)
session.auto_start needs to be off
A MySQL or PostgreSQL database engine or the SQLite extension for PHP
An SMTP server (recommended) or PHP configured for mail delivery
 
浏览器安装界面
浏览器中打开或 进行配置安装。
 第一步,是基本环境检测,只要不出现“NOT OK"就说明你的系统满足要求。
第二步,Creat config,图形界面配置程序,配置完后把db.inc.php和main.inc.php文件保存到服务器上。当然,也可以直接在/var/www/roundcubemail/config/下的db.inc.php和main.inc.php中修改,感觉这样更快些。
 
第三步,运行 的Testconfig.
到此,基本就安装完成了,在此页面中可以测试下SMTP和IMAP是否正常。在邮件系统数据库中,添加用户和,并在页面中输入,进行测试。测试成功后会返回OK.
 
如果没有报错,那安装成功。
删除installer文件,并访问就可看到Roundcuber的登录界面了。然后输入创建好的用户t1,域名可省略不写。

 
阅读(4414) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~