0.Install:
a. sendmail-8.12.11-4.6 install (APT)
b. clamav-0.80-1.1.fc2.dag install (APT)
c. mailscanner-4.35.11-1 install (TAR/GZ)
d. squirrelmail-1.4.3a-1 install (APT)
e. cyrus-imapd-2.2.3-11 install (APT)
f. cyrus-sasl-2.1.18-2.2 install (APT)
0.1 檢查cyrus-imapd輔助套件,若有缺少可由APT安裝.
cyrus-imapd-2.2.3-11
cyrus-imapd-devel-2.2.3-11
cyrus-imapd-murder-2.2.3-11
cyrus-imapd-nntp-2.2.3-11
cyrus-imapd-utils-2.2.3-11
cyrus-sasl-2.1.18-2.2
cyrus-sasl-devel-2.1.18-2.2
cyrus-sasl-gssapi-2.1.18-2.2
cyrus-sasl-md5-2.1.18-2.2
cyrus-sasl-plain-2.1.18-2.2
perl-Cyrus-2.2.3-11
0.2 MailScanner解開後,執行install.pl 進行安裝
1.Config
1.1. /etc/MailScanner/MailScanner.conf
Virus Scanner = clamav <--- modify
1.2. /etc/freshclam.conf
comment the line "Example" <--- modify
1.3. /etc/mail/sendmail.mc 僅列出與 cyrus-imapd相關~
--------------------- for cyrus -------------------
include(`/usr/share/sendmail-cf/m4/cf.m4')dnl
include(`/usr/share/sendmail-cf/mailer/cyrus.m4')dnl <--- add-in
VERSIONID(`setup for Red Hat Linux')dnl
OSTYPE(`linux')dnl
define(`confLOCAL_MAILER', `cyrus')dnl <--- add-in
define(`confTRUSTED_USERS', `sendmail,cyrus')dnl <--- modify
最底下MAILER(cyrus)dnl <--- add-in
1.4. config squirrelmail
執行 /usr/share/squirrelmail/config/conf.pl
Main menu->2.Server Settings-> A. Update IMAP Settings
option 8. Server software : cyrus
option 9. Delimiter : .
Main menu->3.Folder Defaults:
option 1. Default Folder Prefix : none
記得 save data
1.5 service MailScanner start
1.6 service saslauthd start
1.7 service cyrus-imapd start
1.8 create INBOX for users
目前是用手動的方式幫每一個user建立INBOX,批次做法還沒研究~
# cyradm -user username localhost
>cm INBOX
>cm INBOX.Sent
>cm INBOX.Drafts
>cm INBOX.Trash
>quit
1.9 httpd
echo "Alias /webmail /usr/share/squirrelmail" > /etc/httpd/conf.d/squirrelmail.conf
1.a service httpd start
1.b
http://xxx.xxx.xxx.xxx/webmail/ login 進到 squirrelmail的主畫面,選folders 選項
Menu.Folders
Subscribe "Sent"
Subscribe "Drafts"
Subscribe "Trash"
Menu.Options -> Folder Preferences
Trash Folder: INBOX.Trash
Sent Folder: INBOX.Sent
Draft Folder: INBOX.Drafts
submit settings
refresh folder list
到此squirrelmail應該可以跑得起來了~
2. others
修改顯示日期參數
in /usr/share/squirrelmail/functions/date.php
新增一個function
function MyGetDateTimeString( $stamp ) {
if ($stamp == -1) {
return '';
}
if ( $hour_format == SMPREF_TIME_12HR ) {
$date_format = _("Y/m/d h:i a");
} else {
$date_format = _("Y/m/d H:i");
}
return( date_intl( $date_format, $stamp ) );
}
修改舊有function(此function被廣泛運用在日期時間顯示)
function getLongDateString( $stamp ) {
global $hour_format;
if ($stamp == -1) {
return '';
}
if ( $hour_format == SMPREF_TIME_12HR ) {
//$date_format = _("D, F j, Y g:i a");
$date_format = _("D,Y/m/d h:i a"); //DeanLu
} else {
//$date_format = _("D, F j, Y G:i");
$date_format = _("D,Y/m/d h:i"); //DeanLu
}
return( date_intl( $date_format, $stamp ) );
}
修改MailList的顯示使用自訂格式
in src/mailbox_display.php line 203
case 3: /* date */
+$date_string = (MyGetDateTimeString($msg['TIME_STAMP']) .' '); <--使用包含時間的顯示
-$date_string = ($msg['DATE_STRING'] .' '); <--使用日期
p.s.客戶端除了透過Web方式使用Mailbox外,也可用 thunderbird 走imap來存取mailbox, 用thunderbird時,特殊信匣(Drafts,Trash,Sent)可以正常運作,但使用中文信匣名好像會有問題.若使用outlook走imap,特殊信匣會變成一般信匣~這些問題小弟有空再研究看看~
參考資料:
http://phorum.study-area.org/viewtopic.php?t=23316