在FreeBSD5.1简单安装Postfix+Qpopper+Openwebmail


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里加上或更改以下几行:

mydomain = gogogo.org //你的主机域名
myhostname = gogogo.gogogo.com //你的主机名称
myorigin = mail.gogogo.org //把外寄的邮件名改为aaa@mail.gogogo.org
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
如以下的设定
1.2.3.4 OK // 主机的ip gogogo.gogogo.org 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 gogogo.gogogo.org
MAIL FROM: kinux@gogogo.gogogo.org
250 Ok
RCPT TO:kinuxventure@sinaman.com
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
安装完後要设定 /etc/inetd.conf
找出一行 :
#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 %26amp;
或者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 '^]'.
+OK Qpopper (version 4.0.5) at gogogo.gogogo.org starting. 84405.1060849605@gogogo.gogogo.org
QUIT
+OK Pop server at gogogo.gogogo.org signing off.
Connection closed by foreign host.
1. 安装OpenWebMail
#cd /usr/ports/mail/openwebmail
#mak install
全部完成!!!

http://localhost/cgi-bin/openwebma.../openwebmail.pl
收信啰!!! ^_^!!

参考: Book: Absolute BSD - The Ultimate Guide to FreeBSD Chapter 14

本文作者:
« 
» 
快速导航

Copyright © 2016 phpStudy | 豫ICP备2021030365号-3