歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Unix知識 >> 關於Unix >> FreeBSD下安裝Postfix+Openwebmail

FreeBSD下安裝Postfix+Openwebmail

日期:2017/2/28 11:17:57   编辑:關於Unix


1.安裝之前
找一下有沒有sendmail的進程.
#ps -aux | grep sendmail
#killall sendmail
sendmail_enable="YES"
sendmail_flags="-bd"
sendmail_outbound_enable="NO"
sendmail_submit_enable="NO"
sendmail_msp_queue_enable="NO"
這裡假設你己安裝了apache.
2.安裝Postfix
#cd /usr/ports/mail/postfix #make install clean
在安裝時會要求要不要安裝一些附加的東西, 全部不要, 直接按ok 就可以了.
在安裝過程中,會問你是否安裝帳號,請按 yes 確定.
3. 設置Postfix
1) 設置main.cf
#cd /usr/local/etc/postfix
#cp main.cf main.cf.orig
#vi main.cf
首先查一下mail_owner是不是屬postfix擁有.(預設是postfix)
mail_owner = postfix
在main.cf裡加上或更改以下幾行:
alias_maps = hash:/usr/local/etc/postfix/aliases //設定 aliases 的目錄
mynetworks_style = host //只相信自己一台主機
mydestination = $myhostname, localhost.$mydomain, freefall.$mydomain mail3.$mydomain //收信主機的名
relaydomain = $mydestination //允許relay的主機
mailbox_size_limit = 102400000 //設定郵箱大小 100M
disable_vrfy_command = yes // 將vrfy 功能關掉
smtpd_recipient_limit = 100 // 限定每一封信可寄給幾個人,如本例為 100
2) 設定 aliases 的目錄將 aliases 檔轉換為 aliases.db
# cd /usr/local/etc/postfix # /usr/local/sbin/postalias hash:aliases 或者是 #newaliases
3) 設定 access 檔利用 access 檔來做存取限制
在 access 中的設定格式如下:
設定對象 <設定方式>
其中設定對象可用主機名稱、主機 ip、網域、或郵件地址..
<設定方式> 主要有 REJECT、OK
如以下的設定
用 postmap 將 access 轉換成 access.db
# cd /usr/local/etc/postfix
# /usr/local/sbin/postmap hash:access 或者是 #/usr/local/sbin/postmap /usr/local/etc/postfix/access
3. 執行程式
#/usr/local/sbin/postfix start // 啟動 postfix
#/usr/local/sbin/postfix stop // 停止postfix
#/usr/local/sbin/postfix reload //重新啟動 postfix
4. 測試Postfix
#telnet localhost 25
HELO localhost
250 Ok
250 Ok
DATA
354 End data with .
This is a short test of the SMTP email system.
.
250 Ok: queued as F341A379
QUIT
221 Bye
Connection closed by foreign host.
搞定Postfix!!
1. 安裝設定Qpopper
#cd /usr/ports/mail/qpopper
#make install clean
找出一行 :
#pop3 stream tcp nowait root /usr/local/libexec/popper popper
更改成
pop3 stream tcp nowait root /usr/local/libexec/qpopper qpopper -s
如inetd未運行
#/usr/sbin/inetd &
或者inetd己經是在運行
#kill –HUP (inetd 的pid)
測試Qpopper
#telnet localhost 110
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
QUIT
Connection closed by foreign host.
1. 安裝OpenWebMail
#cd /usr/ports/mail/openwebmail
#make install
全部完成!
Copyright © Linux教程網 All Rights Reserved