Extmail

Extmail

Extmail 是一個以perl語言編寫,面向大容量/ISP級套用,免費的高性能Webmail軟體,主要包括ExtMail、Extman兩個部分的程式套件。

基本介紹

  • 外文名:Extmail
  • 定義perl語言編寫
  • 面向:大容量/ISP級套用
  • 包括:免費的高性能Webmail軟體
簡介,安裝,製作_yum_倉庫,配置mta-postfix,配置courier-authlib,配置maildrop,配置webmail-extmail,配置管理後台-extman,配置cyrus-sasl,配置courier-imap,最後說明,

簡介

ExtMail套件用於提供從瀏覽器中登錄、使用郵件系統的Web操作界面,而Extman套件用於提供從瀏覽器中管理郵件系統的Web操作界面。它以GPL著作權釋出,設計初衷是希望設計一個適應當前高速發展的IT套用環境,滿足用戶多變的需求,能快速進行開發、改進和升級,適應能力強的webmail系統。
對於國內的電子郵件系統來說,無論是從系統功能、易用性還是中文化等方面,ExtMail 平台都是一個相當不錯的選擇。Extmail 套件可以提供給普通郵件用戶使用,而Extman套件可以提供給郵件系統的管理員使用。
Extmail還被設計成一個能夠替代目前國內外一些主流webmail軟體的系統,例如:SqWebMail,OpenWebmail及squirrel,Igenus等。
ExtMail Project 是一個活躍的開源郵件系統項目,目前由ExtMail 團隊維護。該項於2005年9月18日正式啟動,最初以WebMail軟體為主,至今已逐步形成了ExtMail軟體系列。整個項目的目標是開發出高效、 易用、富有生命力的郵件系統(方案),經過粗略的統計,截止2009年10月份,已有超過8000個伺服器在運行ExtMail軟體,其中有超過4000 個運行在網際網路上。
目前Extmail的主要特點集中如下:
支持Maildir,索引技術,速度超快 支持多國語言同屏顯示,真正國際郵 支持巨型信箱(超過1GB)海量檔案 支持無限尺寸附屬檔案,I/O能力強 模板化,多語言,修改非常容易.

安裝

製作_yum_倉庫

編譯CentOS-Base.repo檔案
vi /etc/yum.repos.d/CentOS-Base.repo
加入如下內容:
# EMOS-Base.repo
#
# Created by ExtMail Dev Team: http://www.extmail. org/
#
# $Id$
[EMOS-base]
name=EMOS-Base
baseurl=http://mirror. extmail. org/yum/emos/1.5/os/$basearch/
gpgcheck=0
priority=0
protect=0
[EMOS-update]
name=EMOS-Updates
baseurl=http://mirror.<cite class="highlight" highlight="true" style="background-image: none; background-position: initial initial; background-repeat: initial initial; ">extmail. org</cite>/yum/emos/1.5/updates/$basearch/
gpgcheck=0
priority=0
protect=0
保存後,然後嘗試執行一下yum list 等操作,看看是否已經成功;

配置mta-postfix

⒈安裝postfix
# yum -y install postfix
# yum remove sendmail
⒉配置postfix
# postconf -n > /etc/postfix/main2. cf
# mv /etc/postfix/main. cf /etc/postfix/main.&nbsp;cf. old
# mv /etc/postfix/main2.&nbsp;cf /etc/postfix/ main&nbsp;.&nbsp;cf
編輯main. cf:
# vi /etc/postfix/main.&nbsp;cf
增加如下內容:
# hostname
mynetworks = 127.0.0.1
myhostname = mail.centos. bz
mydestination = $mynetworks $myhostname
# banner
mail_name = Postfix - by <cite class="highlight" highlight="true">extmail.&nbsp;org</cite>
smtpd_banner = $myhostname ESMTP $mail_name
# response immediately
smtpd_error_sleep_time = 0s
# Message and return coolcode control
message_size_limit = 5242880
mailbox_size_limit = 5242880
show_user_unknown_table_name = no
# Queue lifetime control
bounce_queue_lifetime = 1d
maximal_queue_lifetime = 1d
註:myhostname改為自己的。
設定postfix開機自啟:
# chkconfig postfix on

配置courier-authlib

⒈安裝Courier-Authlib
安裝以下軟體包:
# yum -y install courier-authlib
# yum -y install courier-authlib-mysql
刪除並編輯/etc/authlib/authmysqlrc檔案:
# cat /dev/null >/etc/authlib/authmysqlrc
# vi /etc/authlib/authmysqlrc
增加如下內容:
MYSQL_SERVER localhost
MYSQL_USERNAME extmail
MYSQL_PASSWORD extmail
MYSQL_SOCKET /var/lib/mysql/mysql.sock
MYSQL_PORT 3306
MYSQL_OPT 0
MYSQL_DATABASE extmail
MYSQL_USER_TABLE mailbox
MYSQL_CRYPT_PWFIELD password
MYSQL_UID_FIELD uidnumber
MYSQL_GID_FIELD gidnumber
MYSQL_LOGIN_FIELD username
MYSQL_HOME_FIELD homedir
MYSQL_NAME_FIELD name
MYSQL_MAILDIR_FIELD maildir
MYSQL_QUOTA_FIELD quota
MYSQL_SELECT_CLAUSE SELECT username,password,"",uidnumber,gidnumber,\
CONCAT('/home/domains/',homedir),\
CONCAT('/home/domains/',maildir),\
quota,\
name \
FROM mailbox \
WHERE username = '$(local_part)@$(domain)'
修改authdaemonrc檔案
# vi /etc/authlib/authdaemonrc
修改如下內容:
authmodulelist="authmysql"
authmodulelistorig="authmysql"
或者使用如下命令直接修改:
sed -i 's/authmodulelist=.*/authmodulelist="authmysql"/g' /etc/authlib/authdaemonrc
sed -i 's/authmodulelistorig=.*/authmodulelistorig="authmysql"/g' /etc/authlib/authdaemonrc
⒉啟動courier-authlib:
# service courier-authlib start
修改authdaemon socket目錄許可權
# chmod 755 /var/spool/authdaemon/

配置maildrop

⒈安裝maildrop
# yum -y install maildrop
配置<cite class="highlight" highlight="true">master . cf</cite> 為了使Postfix支持Maildrop,必須修改/etc/postfix/master&nbsp;. &nbsp;cf檔案,注釋掉原來的maildrop的配置內容,並改為:
maildrop unix - n n - - pipe
flags=DRhu user=vuser argv=maildrop -w 90 -d ${user}@${nexthop} ${recipient} ${user} ${extension} {nexthop}
注意:flags前面有“兩個空格”
配置main. cf 由於maildrop不支持一次接收多個收件人,因此必須在main.&nbsp;cf里增加如下參數:
# vi /etc/postfix/main. cf
maildrop_destination_recipient_limit = 1
⒉測試maildrop對authlib支持
# maildrop -v
看是否出現以下內容:
maildrop 2.1.0 Copyright 1998-2005 Double Precision,Inc.
GDBM/DB extensions enabled.
Courier Authentication Library extension enabled.
Maildir quota extension enabled.
This program is distributed under the terms of the GNU General Public
License. See COPYING for additional information.

配置webmail-extmail

⒈安裝ExtMail
# yum -y install extsuite-webmail
⒉編輯<cite class="highlight" highlight="true" style="background-image: none; background-position: initial initial; background-repeat: initial initial; ">webmail . cf</cite>
# cd /var/www/extsuite/extmail
# cp webmail . cf.default <cite class="highlight" highlight="true" style="background-image: none; background-position: initial initial; background-repeat: initial initial; ">webmail . cf</cite>
# vi webmail&nbsp;
主要變動的內容見下:
SYS_MYSQL_USER = extmail
SYS_MYSQL_PASS = extmail
SYS_MYSQL_DB = extmail
更新cgi目錄許可權 由於SuEXEC的需要,必須將extmail的cgi目錄修改成vuser:vgroup許可權:
# chown -R vuser:vgroup /var/www/extsuite/extmail/cgi/

配置管理後台-extman

⒈yum安裝ExtMan
# yum -y install extsuite-webman
更新cgi目錄許可權 由於SuEXEC的需要,必須將extman的cgi目錄修改成vuser:vgroup許可權:
# chown -R vuser:vgroup /var/www/extsuite/extman/cgi/
連結基本庫到Extmail
# mkdir /tmp/extman
# chown -R vuser:vgroup /tmp/extman
注意事項:
由於RedHat發行版中包含了一個叫tmpwatch的工具,該工具會定期掃描/tmp/下的檔案,如果這些檔案很久都沒被使用,將被刪除,因此如果後台長期不使用,/tmp/extman目錄有可能被tmpwatch刪除,所以要么定期登入後台,要么修改 <cite class="highlight" highlight="true" style="background-image: none; background-position: initial initial; background-repeat: initial initial; ">webman</cite>;將臨時目錄修改到另一個地方。此處暫以/tmp/extman默認值為例。
⒉安裝mysql資料庫
# yum -y install mysql mysql-server
⒊資料庫初始化
啟動Mysql
# service mysqld start
# chkconfig mysqld on
導入mysql資料庫結構及初始化數據,root密碼默認為空
# mysql -u root -p < /var/www/extsuite/extman/docs/extmail.sql
# mysql -u root -p < /var/www/extsuite/extman/docs/init.sql
注意事項:
上述導入初始化SQL時,默認的uidnumber/gidnumber都是1000,這和vuser:vgroup 的uid/gid一致,是因為maildrop投遞時會從資料庫里取uidnumber/gidnumber,而在master&nbsp;.&nbsp;cf里已經定義好了投遞時的運行身份(vuser:vgroup),所以這兩個欄位的內容必須為1000,否則將出現投遞錯誤,例如報0×06等錯誤。
⒋設定虛擬域和虛擬用戶的配置檔案
# cd /var/www/extsuite/extman/docs
# cp mysql_virtual_alias_maps. cf /etc/postfix/
# cp mysql_virtual_domains_maps. cf /etc/postfix/
# cp mysql_virtual_mailbox_maps. cf /etc/postfix/
# cp mysql_virtual_sender_maps. cf /etc/postfix/
配置main.&nbsp;cf:
# vi /etc/postfix/main. cf
增加以下內容:
# extmail config here
virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps. cf
virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps. cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps. cf
virtual_transport = maildrop:
重啟postfix :
# service postfix restart
⒌測試authlib
# /usr/sbin/authtest -s login postmaster@<cite class="highlight" highlight="true">extmail. org</cite> extmail
結果如下:
Authentication succeeded.
Authenticated: postmaster@<cite class="highlight" highlight="true">extmail.&nbsp;org</cite> (uid 1000,gid 1000)
Home Directory: /home/domains/<cite class="highlight" highlight="true">extmail. org</cite>/postmaster
Maildir: /home/domains/<cite class="highlight" highlight="true">extmail.&nbsp;org</cite>/postmaster/Maildir/
Quota: 104857600S
Encrypted Password: $1$phz1mRrj$3ok6BjeaoJYWDBsEPZb5C0
Cleartext Password: extmail
Options: (none)
這樣表明ExtMan的正確安裝,資料庫也正確導入,courier-authlib能正確連線到mysql資料庫
最後訪問http://mail.centos. bz/extmail/,如無意外,將看到webmail的登入頁,不過此時還沒有加正式的用戶,所以不能登入,包括postmaster@<cite class="highlight" highlight="true">extmail. org</cite>;也不行。必須要登入到http://mail.centos. bz/extman/ 里增加一個新帳戶才能登入。
ExtMan的默認超級管理員帳戶:root@<cite class="highlight" highlight="true">extmail.&nbsp;org</cite>;,初始密碼:extmail*123*,登入成功後,建議將密碼修改,以確保全全。
⒍配置圖形化日誌
啟動mailgraph_ext
# /usr/local/mailgraph_ext/mailgraph-init start
啟動cmdserver(在後台顯示系統信息)
# /var/www/extsuite/extman/daemon/cmdserver --daemon
加入開機自啟動:
# echo "/usr/local/mailgraph_ext/mailgraph-init start" >> /etc/rc.d/rc.local
# echo "/var/www/extsuite/extman/daemon/cmdserver -v -d" >> /etc/rc.d/rc.local
使用方法:等待大約15分鐘左右,如果郵件系統有一定的流量,即可登入到extman里,點“圖形日誌”即可看到圖形化的日誌。具體每天,周,月,年的則點擊相應的圖片進入即可。

配置cyrus-sasl

⒈安裝cyrus-sasl
刪除系統的cyrus-sasl:
# rpm -e cyrus-sasl --nodeps
安裝新的支持authdaemon的軟體包
# yum -y install cyrus-sasl cyrus-sasl-plain
⒉配置main.&nbsp;cf檔案
PostfixSMTP認證需要透過Cyrus-SASL,連線到authdaemon獲取認證信息。
編輯main. cf
# vi /etc/postfix/main.&nbsp;cf
增加如下內容:
# smtpd related config
smtpd_recipient_restrictions =
permit_mynetworks,
permit_sasl_authenticated,
reject_non_fqdn_hostname,
reject_non_fqdn_sender,
reject_non_fqdn_recipient,
reject_unauth_destination,
reject_unauth_pipelining,
reject_invalid_hostname,
# SMTP sender login matching config
smtpd_sender_restrictions =
permit_mynetworks,
reject_sender_login_mismatch,
reject_authenticated_sender_login_mismatch,
reject_unauthenticated_sender_login_mismatch
smtpd_sender_login_maps =
mysql:/etc/postfix/mysql_virtual_sender_maps. cf,
mysql:/etc/postfix/mysql_virtual_alias_maps. cf
# SMTP AUTH config here
broken_sasl_auth_clients = yes
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_security_options = noanonymous
⒊編輯smtpd.conf檔案
# vi /usr/lib/sasl2/smtpd.conf
確保其內容為:
pwcheck_method: authdaemond
log_level: 3
mech_list: PLAIN LOGIN
authdaemond_path:/var/spool/authdaemon/socket
重新啟動postfix
# service postfix restart
⒋測試SMTP認證
通過以下命令獲得postmaster@<cite class="highlight" highlight="true">extmail. org</cite>;的用戶名及密碼的BASE64編碼:
# perl -e 'use MIME::Base64; print encoolcode_base64("postmaster\@<cite class="highlight" highlight="true">extmail.&nbsp;org</cite>")'
內容如下:
cG9zdG1hc3RlckBleHRtYWlsLm9yZw==
# perl -e 'use MIME::Base64; print encoolcode_base64("extmail")'
內容如下:
ZXh0bWFpbA==
然後本機測試:
# telnet localhost 25
其過程如下:
Trying 127.0.0.1
Connected to localhost.localdomain (127.0.0.1).
Escape character is ‘^]’.
220 mail.<cite class="highlight" highlight="true">extmail. org</cite> ESMTP Postfix – by <cite class="highlight" highlight="true">extmail.&nbsp;org</cite>
ehlo demo.domain.tld << 輸入內容
250-mail.<cite class="highlight" highlight="true">extmail. org</cite>
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-AUTH LOGIN PLAIN
250-AUTH=LOGIN PLAIN
250-ENHANCEDSTATUScoolcodeS
250-8BITMIME
250 DSN
auth login << 輸入內容
334 VXNlcm5hbWU6
cG9zdG1hc3RlckBleHRtYWlsLm9yZw== << 輸入內容
334 UGFzc3dvcmQ6
ZXh0bWFpbA== << 輸入內容
235 2.0.0 Authentication successful
quit << 輸入內容
221 2.0.0 Bye
最後出現235 Authentication Successful 表明認證成功了。

配置courier-imap

⒈安裝Courier-imap
默認的courier-authlib及courier-imap都會增加系統自啟動設定,因此下一次伺服器啟動將自動啟動相應的authlib及POP3服務
# yum -y install courier-imap
配置courier-imap
由於Courier-imap的IMAP目錄是按UTF-7編碼的,ExtMail目前還沒有正式支持IMAP目錄,因此需要禁止IMAP,只提供pop3服務。而就目前的使用情況來看,IMAP使用的非常少,絕大部分OutLook/Foxmail用戶都習慣使用POP3而非IMAP。
# vi /usr/lib/courier-imap/etc/imapd
修改內容如下:
IMAPDSTART=NO
# vi /usr/lib/courier-imap/etc/imapd-ssl
修改內容如下:
IMAPDSSLSTART=NO
然後重新啟動courier-imap:
# service courier-imap start
測試POP3 請按如下步驟輸入pop3命令測試其是否正常工作,注意藍色的信息是我們輸入到POP3伺服器的(請首先登錄extman自行建立test@<cite class="highlight" highlight="true">extmail.&nbsp;org</cite>;用戶,密碼:extmail)
# telnet localhost 110
其過程如下:
Trying 127.0.0.1
Connected to localhost.localdomain (127.0.0.1).
Escape character is ‘^]’.
+OK Hello there.
user test@<cite class="highlight" highlight="true">extmail. org</cite> << 輸入內容
+OK Password required.
pass extmail << 輸入內容
+OK logged in.
list << 輸入內容
+OK POP3 clients that break here,they violate STD53.
.
quit << 輸入內容
+OK Bye-bye.
Connection closed by foreign host.

最後說明

至此,ExtMail的安裝配置基本完成,如想配置內容,病毒過濾請到官方網站學習配置。登錄extmail系統後台後,請及時修改密碼或者用戶名。最後需要確認的是,是否已經設定好郵件域名的MX記錄或者A記錄,這樣才能正常收取郵件。

相關詞條

熱門詞條

聯絡我們