我在灌postfix時遇到一個問題!有誰知道!



贊助商連結


頁 : [1] 2

bigmichael
2003-03-14, 07:04 PM
我是linux redhat 7.2
我是灌這估版本 postfix-1.1.10
我是照下列的文章做的:

更換 sendmail, wu-ftpd, openssh 為 Postfix, ProFTPD, ssh
作者:OLS3 ([email protected])
台南縣教育網路中心

Revision History
Revision 0.1 24 Mar 2002 Revised by: OLS3
初版


--------------------------------------------------------------------------------

Table of Contents
換掉 sendmail,安裝 Postfix / Qpopper
換掉 wu-ftpd,安裝 Proftpd
安裝 ssh
知識共享

這篇講義原是台南縣教網中心的內部文件,它是四月份時,我對中心內部人員所做的一個簡報的內容,現在我把它擺在線上,以供各校網管人員參考。

本篇講義,主要是把換掉 sendmail、wu-ftpd、openssh 的過程,做個簡單的整理。

本文主要環境是 RedHat 7.x

Copyright 2002 OLS3, 本講義僅供教育人員參考, 任何引用, 請先取得作者的同意.

(以上聲明主要是防止商人拿本文沽取利益,除此請自行取用,勿受限制或對此感到有任何的不愉快。)


換掉 sendmail,安裝 Postfix / Qpopper
所需套件:postfix-1.10.tar.gz

截至目前 05/24/2002 為止,若有更新版本,請安裝最新版,可由ftp.tnc.edu.tw/Sysop/MAIL/postfix/official/ 下載。

移除 sendmail
若您的主機中有安裝 sendmail 的 rpm 檔,才需要移除。若您是安裝 sendmail 的原始 tar 檔,也請將 sendmail 這支執行檔移去或備份(通常在 /usr/sbin/sendmail),以免將來影響 Postfix 的運作。

步驟如下:


rpm -e mutt

rpm -e fetchmail

rpm -e sendmail


安裝 Postfix
Postfix 近來的更新動作十分快速,請隨時留意新版本的發行。

安裝 Postfix 的步驟如下:


新增一位使用者叫 postfix : adduser postfix

請把 /etc/passwd 中 postfix 帳號的 shell 部份改成 /bin/nologin

新增一個群組叫 postdrop : groupadd postdrop

tar xvzf postfix*.gz

cd postfix*

make

make install (注意: 在它問您 setgid 時,要回答 postdrop)

cp /etc/postfix/aliases /etc/aliases

newaliases

編輯 /etc/postfix/main.cf,設定如 範本 所示

chmod 1777 /var/spool/mail

讓 Postfix run 起來:postfix start

設定一開機就執行 Postfix:

編輯 /etc/rc.d/rc.local

加入 /usr/sbin/postfix start

telnet localhost 25 應該可以出現類似以下正常畫面

220 dns.xxxx.tnc.edu.tw ESMTP Postfix



按 ctrl ] 之後,鍵入 quit 便可離開。


安裝 Qpopper (POP3 Server)
目前(05/24/2002)最新版是:4.0.4。可至 ftp.tnc.edu.tw/Sysop/MAIL/qpopper/ 下載 qpopper4.0.4.tar.gz

注意:Qpopper 4.0.3 及 4.0.4 的 -u 選項(user-option),已被發現有 buffer overflow 的現象,請勿使用該選項功能(預設是沒有打開)。

其它選項(如 -Rs),則是安全的。

這裡有 Qpopper 的說明文件(PDF檔)

安裝步驟如下:


tar xvzf qpopper*.gz

cd qpopper*

./configure --enable-specialauth

make

make install

把以下設定,存成 pop3 檔,放在 /etc/xinetd.d 中

或至 ftp.tnc.edu.tw/Sysop/config_files 中下載 pop3,放入 /etc/xinetd.d 中

該檔的內容如下:

service pop3
{
disable = no
socket_type = stream
protocal = tcp
wait = no
user = root
server = /usr/local/sbin/popper
server_args = -Rs
}




重新啟動 xinetd,請執行:/etc/rc.d/init.d/xinetd restart 或 執行:service xinetd restart

telnet localhost 110 應該可以出現類似以下正常畫面

+OK Qpopper (version 4.0.4) at dns.xxxx.tnc.edu.tw starting.



按 ctrl ] 之後,鍵入 quit 便可離開。



(補充說明:
RedHat Linux 自 7.x 之後,改用 xinetd,
之前的舊版本則是使用 inetd,因此,您應該去編輯 /etc/inetd.conf,加上:

pop3 stream tcp nowait root /usr/sbin/tcpd /usr/local/sbin/popper -Rs

然後重新啟動 inetd:
/etc/rc.d/init.d/inet restart

即可.)



--------------------------------------------------------------------------------


在做到make install時,發現我的install是大寫也,於是得到如下的結果

[root@linux a]# cd postfix-1.1.10
[root@linux postfix-1.1.10]# ls
0README COPYRIGHT INSTALL Makefile PORTING src
auxiliary examples lib Makefile.in postfix-install
bin HISTORY libexec Makefile.init proto
COMPATIBILITY html LICENSE man README_FILES
conf include makedefs mantools RELEASE_NOTES
[root@linux postfix-1.1.10]# make INSTALL
make: *** Warning: File `INSTALL' has modification time in the future (2002-02-05 04:21:10 > 2001-01-02 00:55:42)
make: Nothing to be done for `INSTALL'.
make: warning: Clock skew detected. Your build may be incomplete.
[root@linux postfix-1.1.10]#


是哪裡出問題呢?

贊助商連結


repsol
2003-03-15, 05:40 PM
那個大寫的 INSTALL 是 postfix 的安裝說明檔
INSTALL 那個 file 是用來看的

bigmichael
2003-03-15, 05:43 PM
最初由 repsol 發表
那個大寫的 INSTALL 是 postfix 的安裝說明檔
INSTALL 那個 file 是用來看的

謝謝高手的回答,可以了。
但是現在有一問題,我的postfix可以寄,但是不能收!
不知道為什摸也?

repsol
2003-03-15, 06:42 PM
不能收信的原因也可很多種
您這麼問..我也很難知道為什麼


看設定
http://www.postfix.org/motivation.html
看FAQ
http://www.postfix.org/faq.html

JoyDai
2003-03-16, 11:00 AM
最初由 bigmichael 發表
謝謝高手的回答,可以了。
但是現在有一問題,我的postfix可以寄,但是不能收!
不知道為什摸也?

postfix 內定只收本機的信,所以請你將 /etc/postfix/ 下的
main.cf 中大約第 97 行的 inet_interfaces = localhost Mark 掉,改將下一行的 inet_interfaces = all 前的 # 取消即可收信了。

PS:
myhostname
mydomain
mydestination
mynetworks
這幾個設定確定是否正確?

bigmichael
2003-03-16, 08:11 PM
還是不能收信也。以下是我的設定

[root@linux root]# postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
debug_peer_level = 2
inet_interfaces = all
mail_owner = postfix
mailbox_command = /some/where/procmail
mailq_path = /usr/bin/mailq
manpage_directory = /usr/local/man
mydestination = $myhostname, mail.$mydomain, $mydomain
mydomain = ucomexam.com.tw
myhostname = linux.ucomexam.com.tw
mynetworks = 61.73.192.39/24, 127.0.0.0/8
newaliases_path = /usr/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = no
sample_directory = /etc/postfix
sendmail_path = /usr/sbin/sendmail
setgid_group = postdrop



我測試我的postfix如下

[root@linux root]# telnet localhost 25
Trying 127.0.0.1...
Connected to linux (127.0.0.1).
Escape character is '^]'.
220 linux.ucomexam.com.tw ESMTP Postfix
ehlo localhost
250-linux.ucomexam.com.tw
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-XVERP
250 8BITMIME


然後我check我的postfix也沒錯誤也如下


[root@linux root]# postfix check
[root@linux root]#


不知道哪設錯了?

JoyDai
2003-03-16, 09:08 PM
[QUOTE]最初由 bigmichael 發表
[B]還是不能收信也。以下是我的設定
[color=#ff0000]

看要不要將你的 main.cf post 上來,大家幫你看看那出問題了!

alec5106
2003-03-16, 10:31 PM
另外在dns上的正反解設定也要檢查一下

bigmichael
2003-03-17, 10:08 PM
[root@linux root]# postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
debug_peer_level = 2
inet_interfaces = all
mail_owner = postfix
mailbox_command = /some/where/procmail
mailq_path = /usr/bin/mailq
manpage_directory = /usr/local/man
mydestination = $myhostname, mail.$mydomain, $mydomain
mydomain = ucomexam.com.tw
myhostname = linux.ucomexam.com.tw
mynetworks = 61.73.192.39/24, 127.0.0.0/8
newaliases_path = /usr/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = no
sample_directory = /etc/postfix
sendmail_path = /usr/sbin/sendmail
setgid_group = postdrop


這就是我有做設定的,其它的前面都有加#

alec5106
2003-03-17, 10:27 PM
另外所謂不能收?
是指在linux主機上就不能收嗎?

還是在其他電腦上用outlook之類的收信軟體不能收?
如果是後者,多半是pop3程式的問題,和postfix無關.你要檢查Qpopper (POP3 Server)

我先前安裝Qpopper (POP3 Server)也是出問題,後來不得己改用imap