close
RoundCube :

RoundCube會透過IMAP和SMTP通訊協定,收發郵件伺服器的信件,

然後藉資料庫把信件保存,及方便使用者進行搜尋,並透過Linux上的網頁伺服器生成頁面,

使用者便可以透過瀏覽器管理信件。RoundCube以PHP寫成的開源工具,

安裝前需要預先安裝Apache或Lighttpd網頁伺服器、資料庫支援MySQL、PostgreSQL或SQLite。

除若干基本設定必須透過命令進行外,大部分後期設定都可透過瀏覽器進行。

畫面方面融入了AJAX元素,使用時與使用一般Webmail無異。外觀可以作一定程度的客製化,

而且支援多國語言。

以下關於RoundCube介紹摘自Linux Pilot

http://www.linuxpilot.com/software/kiji/201103090101roundcube

實驗環境/動機

看到Linux Pilot 文章介紹,於是找個時間實現一下,目前進度已Ok,整理截圖完成後再分享

[環境設計]

CentOS 5.5(dns): 192.168.0.166
CentOS 5.5(amber):192.168.0.167 ,安裝以下套件

Postfix:  postfix-2.3.3-2:   郵件Domain: lohas.com

MailScanner: MailScanner-4.83.4-1.tgz            #截至本日官方最新  
Spamassassin: spamassassin-3.2.5
CLamv: clamav-0.97.tar.gz                                  #截至本日官方最新 
Apache & PHP: httpd-2.2.3-43   & php-5.3.6-1
MySQL: mysql-5.5.10-1

濾信外掛: Postfix內 啟用DNSBL & Postgrey  黑名單&灰名單,
                  並增加dcc,pyzor,razor 3rd Party 濾信名單

下圖為RoundCube 登入界面, 果真比OPENWEBMAIL 美觀許多(支援繁體中文)
   
 下圖為登入roundcube後操作界面(真的很水)..讀者從下圖得知,KEYNES先前測試ClamAV

  攔截到病毒夾檔OK(若評斷為病毒信 Header 標示{Virus?}字樣)
 
(A) Postfix 架構簡易說明Review

     由於前幾篇已介紹過Postfix+MailScanner+Spamassassin 組態,這部份不再多說明

     僅以截圖Check ,相關組態設定帶過(若有Forget部份請往前翻本人寫過相關文章)

      vi  /etc/postfix/main.cf    #DNSBL(黑名單)與Postgrey相關配置

      
補充說明: 若安裝Postfix 安裝後發現未安裝postgrey 套件,您可以下載安裝rpmforge(repo)

      Then

      shell> yum -y install postgrey                
      shell> /etc/init.d/postgrey start
      shell> chkconfig postgrey on              #即可完成postgrey 套件安裝,與開機啟動
      shell> service MailScanner restart    #以MailScanner喚起Postfix Restart

   
    
 vi /etc/MailScanner/MailScanner.conf   #修改MailScanner 使用ClamAV掃毒

     請預將 Incoming Queue Dir & Outgoing Queue Dir 路徑設OK,

     將 Virus Scanning = yes     &  Virus Scanner = clamav   設置如左

    #(ClamAV安裝步驟不再贅述)
   
     vi /etc/MailScanner/spam.assassin.prefs.conf   #編輯spamassassin相關組態

     請預先完成spamassassin安裝: yum -y install spamassassin 

     spam.assassin.prefs.conf   內有許多spamassassin 需設定(參考前幾篇寫的)

    下圖僅顯示濾信外掛部份組態啟用(dcc,razor,pyzor) ,請您預先安裝好相關套件

     再修改如下配置即可!
   
     [測試ClamAV 掃毒運作]: 

     本人於上篇曾使用Postfix+MailScanner+Antvirus(小紅傘)進行掃毒搭配運行OK
  
     將此次主角換成ClamAV,  並使用amber@lohas.com  使用者寄病毒信給bebe@lohas.com 

     測試ClamAV 整合MailScanner 是否攔截病毒成功?

    下圖為 amber@lohas.com  撰寫一封病毒信給  bebe@loahs.com
  
     PS:>  使用Office Outlook 2010 撰寫郵件
   
     接者我們利用bebe@lohas.com 登入DeramMail V4 進行收信
 
    從下圖我們可以發現,我們收到MailScanner發送警告信(帶毒附檔已被隔離'相關訊息)

    #ClamAV運行正常#

  At Sat Mar 26 12:34:17 2011 the virus scanner said:
  ClamAV: eicar.com contains Eicar-Test-Signature 
  MailScanner: Executable DOS/Windows programs are dangerous in email (eicar.com)
  Note to Help Desk: Look on the yoursite (amber.lohas.com) MailScanner   
  in /var/spool/MailScanner/quarantine/20110326 (message E83AE168486.A64B2).
  
(B) RoundCube 安裝        #INSTALL檔案內有詳細配置敘述

 
安裝相關套件

shell> yum -y install php php-mysql php-pecl-Fileinfo php-mcrypt php-xml php-gd php-mbstring 

 修改php.ini 參數

   vi   /etc/php.ini
 
  file_uploads = On

 session.auto_start = 0

 開始安裝RoundCube: 本例使用 roundcubemail-0.5.1.tar.gz  #截至目前最新

shell>  tar zxvf  roundcubemail-0.5.1.tar.gz

shell>
 
 move roundcubemail-0.5.1  /var/www/html/roundcube #移到wwwroot

shell> cd /var/www/html/roundcube

shell>   chown -R apache.apache logs temp           #更改此二目錄擁有者與群組

shell> chmod 0700  logs temp                                 #更改權限

替Roundcube 建立 RoundCube DB 與授權存取使用者建立

shell> mysql -u root -pxxxxx

mysql> create database roundcue;     #建立名為roundcue 資料庫(可自取)

mysql> grant all on roundcue.*  to roundcube@localhost identified by 'xxxxxx';
  
                                                             #建立一個名為roundcube 授權使用者
mysql> flush privileges;

mysql>  quit;

再者我們將Roundcube  資料庫腳本匯入roundcue 資料庫

shell> mysql -u root -pxxx  roundcue <  mysql.initial.sql

登入mysql 查看已建立的table

shell> mysql -u roundcube -pxxx 

shell> use roundcue;

shell> show  tables from roundcue;     #匯入動作已OK

 
配置Roundcube 組態檔案:  db.inc.php (資料庫連線組態檔) & main.inc.php (主程式組態檔)

shell> cd  /var/www/html/roundcube/config

config> cp  db.inc.php.dist db.inc.php 

config> cp  main.inc.php.dist main.inc.php

vi  db.inc.php      #修改資料庫連線組態修改如下

說明: 'mysql://roundcue(資料庫帳戶):xxxxd(資料庫密碼)@localhost/roundcube(資料庫名稱)';

$rcmail_config['db_dsnw'] = 'mysql://roundcue:xxxxd@localhost/roundcube';

 
vi main.inc.php  #修改RoundCube主程式組態檔修改如下

$rcmail_config['default_host'] = '192.168.0.167';         #郵件伺服器的位置或DNS名稱
$rcmail_config['mail_domain'] = 'lohas.com';              #網域名稱
$rcmail_config['smtp_server'] = '192.168.0.167';        #郵件伺服器的位置或DNS名稱
$rcmail_config['auto_create_user'] = true;                   # 自動 create user
$rcmail_config['create_default_folders'] = TRUE;      # 建立預設資料夾
$rcmail_config['language'] = ' zh_TW ';                        # 預設語系
$rcmail_config['timezone'] = '8';                                    # 時區台灣是8
$rcmail_config['default_charset'] = 'UTF-8';               # 預設編碼

開啟Browser 輸入http://amber.lohas.com/roundcube  進入網頁安裝畫面

由於RoundCube相關組態我們皆由上幾步配置完成,我們在此僅需Check相關套件

是否皆已安裝即可   # 若下圖出 NOT OK 字樣 請修正它後,關閉跳出Browser即可
 

以上操作步驟Check OK後我們需將installer 資料夾刪除,才可正式使用RoundCube webmail

shell>rm -rf  /var/www/html/roundcube/installer

現在我們可以利用 http://amber.lohas.com/roundcube  試者登入webmail 

   
安裝poppassd plugin 使用戶端可透過Roundcube 修改信箱登入密碼

RoundCue 與Open Webmail 一樣具有供使用者修改信箱密碼功能,但RoundCue 需另外安裝外掛

" Poppassd'

[下載 poppassd 並進行安裝]

shell>  wget http://rpm.razorsedge.org/centos-5/RE/razorsedge-release-4-1.el5.re.noarch.rpm 

            
#下載安裝Razorsedge(Repo),具poppassd 套件

shell> rpm -ivh  razorsedge-release-4-1.el5.re.noarch.rpm  #安裝razor_repo

shell> yum -y install poppassd      #Ver. poppassd-1.8.5-3  

[ 修改poppassd ]  使其Enable,預設未啟動 

vi /etc/xinetd.d/poppassd   #修改為 "disable = no"  即可

 
[ 修改密碼驗證方式}
 
 vi /etc/pam.d/poppassd     #修改參照如下,預設最低不得小於6位密碼

auth      required    pam_unix.so
account   required    pam_unix.so
password  requisite   pam_cracklib.so
password  sufficient  pam_unix.so md5 shadow

*修改完成請重新啟動xinetd:  service xinted restart* 生效上述設定 
 
[文字模式測試Poppassd 成功變更密碼]: 以修改bebe 信箱密碼為例

shell> telnet localhost 106
shell> user bebe
shell> pass  請輸入bebe現有的密碼
shell> newpass  請輸入bebe變更新密碼  #下圖說明密碼已成功CHANGED
 
[接者我們將修改RoundCube 支援 poppassd plugin 組態]

shell> cd /var/www/html/roundcube/plugins/password/

shell > cp config.inc.php.dist to config.inc.php #將範例檔複製為config.inc.php

shell >    vi  config.inc.php   #修改以下參數

$rcmail_config['password_driver'] = 'poppassd';   #原為sql,需修正為poppassd

shell >    vi  /var/www/html/roundcube/config/main.inc.php  #修改以下參數

 $rcmail_config['plugins'] = array('password');  

 shell> servuce httpd restart


[RoundCube]:  登入web_mail : 我們將介紹Web Mail 操作環境

http://amber.lohas.com/roundcube   #以本實驗為例

下圖為登入後首頁界面!! 整個很美觀
 
   修改信箱密碼: 我們點選右上方
個人設定/修改密碼  ,修改完成請點[儲存]

    由於前幾步已配置poppassd成功.我們現在已可以修改現有使用信箱密碼! 
   
     [通訊錄功能展示]: 下圖中建立一位聯絡人: 何偉嘉 Jo 
    
     [簽名檔客製化設計]  個人設定/身份資訊

    
     [撰寫寫新郵件]

     我們在此以amber@lohas.com 測試寄信給 bebe@lohas.com

     郵件內容支援: 讀取回條索取,傳送狀態通知,優先順序

     下圖中,我們新增一附檔物件
一角.jpg    [ 傳送 ]

  
    最後我們切換使用者amber@lohas.com 登入RoundCube , 查看收信

    下圖中我們成功收到bebe送出郵件, 下圖中除了可以看到'班目一角'本尊照片外

     也可以查得MailScanner 戳記


    
LAB 參考資料:

RoundCube 官方文件 and

http://spen.blog.ithome.com.tw/post/1581/64398

http://blog.ntut.idv.tw/2010/03/los-centos-install-roundcube-ajax.html
   
  
arrow
arrow
    全站熱搜

    終極.凱因斯 發表在 痞客邦 留言(0) 人氣()