安裝 Mail Server 程序
- 目前我已經改用 iRedMail 來當郵件主機
<style box float-left> 相關頁面:
</quote>
- 先設定 hosts
vi /etc/hosts
: 127.0.0.1 e-plast-mail mail.e-plast.com.tw localhost :
- 安裝基本郵件系統元件
CentOS 內之預設版本:
sendmail-8.13.1-3.2.el4 dovecot-0.99.11-8.EL4 cyrus-sasl-2.1.19-14 cyrus-sasl-devel-2.1.19-14 cyrus-sasl-plain-2.1.19-14 cyrus-sasl-md5-2.1.19-14 perl-5.8.5-36.RHEL4 spamassassin-3.1.9-1.el4
- cyrus-sasl
- sendmail
- 與 sendmail 相關設定全部定義好後重新啟動 sendmail
service sendmail restart
dovecot 設定程序
- CentOS 5
- vi /etc/dovecot.conf
: protocols = imap pop3 :
chkconfig dovecot on service dovecot restart
- CentOS 6
- vi /etc/dovecot/dovecot.conf
: protocols = imap pop3 : !include_try /etc/dovecot/local.conf
- vi /etc/dovecot/local.conf
mail_privileged_group = mail
- vi /etc/dovecot/conf.d/10-auth.conf
: disable_plaintext_auth = no :
- vi /etc/dovecot/conf.d/10-mail.conf
: mail_location = mbox:~/mail:INBOX=/var/mail/%u :
- 設定 imaps/pop3s
- 建立 SSL 加密所需要憑證
- 安裝防毒過濾系統 clamav
yum install clamav clamd service clamd start chkconfig clamd on
- 安裝 MailScanner
- 設定 MailScanner 定義檔
- 設定 sendmail 與 MailScanner 啟動方式
- 設定 sendmail + MailScanner 啟動方式
service sendmail stop chkconfig sendmail off chkconfig MailScanner on service MailScanner start
- 當出現 MailScanner: No programs allowed (msg-xxxxx-xxx.txt) 的誤判病毒問題, 可以直接改 /etc/MailScanner/filetype.rules.conf 內容後, 重新啟動 MailScanner 解決
vi /etc/MailScanner/filetype.rules.conf
: deny self-extract No self-extracting archives No self-extracting archives allowed #deny executable No executables No programs allowed #EXAMPLE: deny - x-dosexec No DOS executables No DOS programs allowed #deny ELF No executables No programs allowed deny Registry No Windows Registry entries No Windows Registry files allowed #deny MPEG No MPEG movies No MPEG movies allowed :
service MailScanner restart