postfix+dovecot+squirrelmail的郵件系統
ubuntu 11.10之後,似乎已經無法安裝openwebmail(事實上此套件好像沒再更新了),所以改採用squirrelmail作為webmail使用,筆者發現其實他相當輕巧快速,更有許多安全性的外掛工具,而且持續不斷的更新,是相當可靠好用的webamail,由於需要imap支援,所以選擇安裝dovecot,因此,當安裝好了後,也可以使用thunderbird之類的mail client透過pop3或pop3s來下載信件,可位一舉數得
設定postfix
sudo apt-get install postfix
sudo dpkg-reconfigure postfix
sudo apt-get install squirrelmail squirrelmail-lockout squirrelmail-secure-login squirrelmail-spam-buttons squirrelmail-logger
squirrelmail-lockout的設定檔位置
/var/lib/squirrelmail/data/lockout_plugin_login_failure_information.pref
執行squirrelmail的設定:
sudo squirrelmail-configure1 -> 7(修改連結位址) ->R(回主選單)
2 -> 1(修改Domain)
2 -> A -> 4 -> (7)(使用TLS) -> S(儲存) -> R
若有設定使用TLS的imaps(993 port),才須開啟以下的設定
若有啟動imaps(993),則可以設定TLS為true
2 -> A -> 5 (993) -> S -> R
4 -> 11(Allow server-side sorting -> true) -> S -> R
10 -> 1(zh_TW) -> 2(UTF-8)
修改語言介面與編碼,把en_US改成zh_TW,iso-8859-1改成UTF-8
回到主選單,儲存設定後離開
S -> Q
加入squireelmail的apache2設定檔
sudo cp /etc/squirrelmail/apache.conf /etc/apache2/conf.d/squirrelmail.confcd /etc/apache2/conf.d
sudo vi squirrelmail.conf
----------------------------------------------------------------------------------
Alias /squirrelmail /usr/share/squirrelmail
php_flag register_globals off
order deny,allow
deny from all
# 可連線區
allow from 127.0.0.1 ::1 192.168.1.0/24 kawsing.tn.edu.tw
Options Indexes FollowSymLinks MultiViews
DirectoryIndex index.php
order deny,allow
allow from 127.0.0.1
------------------------------------------------------------------------------------------------
sudo apt-get install dovecot-imapd dovecot-pop3d
設定imap與pop3
cd /etc/dovecot
sudo vi dovecot.conf
------------------------------------------------------------------------------------
listen = *, ::
------------------------------------------------------------------------------------
cd /etc/dovecot/conf.d
sudo vi 10-mail.conf
-------------------------------------------------------------------------------------
mail_location = mbox:~/mail:INBOX=/var/mail/%u
-------------------------------------------------------------------------------------
sudo vi 10-master.conf
-------------------------------------------------------------------------------------
service imap-login {
inet_listener imap {
port = 143
}
inet_listener imaps {
port = 993
ssl = yes
}
service pop3-login {
inet_listener pop3 {
port = 110
}
inet_listener pop3s {
port = 995
ssl = yes
}
}
----------------------------------------------------------------------------------------------
sudo /etc/init.d/apache2 restart
sudo /etc/init.d/postfix restart
sudo /etc/init.d/dovecot restart
測試squirrelmail
第一次登入會出現錯誤,因為尚未建立mbox
點選INBOX_Drafts,選擇編寫郵件,然後寄一封信給自己
再點選收件夾,就可以看到信了
安全防護:
sudo apt-get install squirrelmail-secure-login squirrelmail-lockout squirrelmail-loggercd /etc/squirrelmail/
sudo vi secure-login-config.php
sudo vi lockout-config.php
----------------------------------------------------------------------------------------
$use_lockout_rules = 1;
$max_login_attempts = '3:5:10';(五分鐘內錯誤達三次,鎖住10分鐘)
$max_login_attempts_per_IP = '3:5:600';(五分鐘內錯誤達三次,鎖住該IP 600分鐘)
----------------------------------------------------------------------------------------
錯誤達三次,該 IP 會被禁止登入
解鎖:
$use_lockout_rules = 0;或
清除/var/lib/squirrelmail/data/lockout_plugin_login_failure_information.pref
環境設定:
INBOX.Sent,INBOX.Trash,INBOX.Drafts等名稱是英文,可以自訂中文資料夾名稱,然後去取代
沒有留言:
張貼留言