close
參考鳥哥的站來安裝,不過有一些小地方不一樣...
我想可能是版本的關係
系統為 RedHat 9
下載 postfix 原始碼版本
先檢查系統是否有安裝 pcre.h
[root]#locate pcre.h | grep include
/usr/include/pcre/pcre.h
如果沒有可以用 yum 來安裝
[root]#yum install pcre.h

編譯步驟:
[root]#make tidy #清除規則
[root]#make #編譯

原先的 sendmail 不用移除,做以下的處理即可。
[root]#mv /usr/sbin/sendmail /usr/sbin/sendmail.OFF
[root]#mv /usr/bin/newaliases /usr/bin/newaliases.OFF
[root]#mv /usr/bin/mailq /usr/bin/mailq.OFF
[root]#chmod 755 /usr/sbin/sendmail.OFF
> /usr/bin/newaliases.OFF /usr/bin/mailq.OFF

[root]#groupadd -r postdrop
[root]#useradd -r -s /bin/false postfix
[root]#echo 'postfix: root' >> /etc/aliases

[root]#make install #安裝
之後會問問題,直按 Enter 一直過去就可以了...
除了這個
readme_directory: [no] /etc/postfix/readme_files

設定 postfix :
/etc/postfix/main.cf
myhostname = vns1.tern.idv.tw
mydomain = tern.idv.tw
myorigin = $myhostname
mydestination = /etc/postfix/local-host-names
inet_interfaces = all
mynetworks = 192.168.1.0/24, 127.0.0.0/8, 192.168.1.100/32,
hash:/etc/postfix/access
relay_domains = tern.idv.tw

alias_maps = hash:/etc/postfix/aliases
alias_database = hash:/etc/postfix/aliases

************************************************************
[root]#postmap hash:/etc/postfix/access
[root]#postalias hash:/etc/postfix/aliases

檢查出一個問題(可能是我步驟上的錯誤):
[root]#/usr/sbin/postfix check
postsuper: fatal: scan_dir_push: open directory active: Permission denied
後來發現是 /var/spool/postfix 中的 active 目錄權限錯誤
改成 postfix:root 即可...

啟動 postfix:
[root]#/usr/sbin/postfix start
停止 postfix:
[root]#/usr/sbin/postfix stop
重新載入設定檔:
[root]#/usr/sbin/postfix reload

arrow
arrow
    全站熱搜

    tern 發表在 痞客邦 留言(0) 人氣()