2010年11月17日 星期三

Postfix郵件伺服器

Postfix與Sendmail一樣都是Linux上很著名的電子郵件伺服器,但好設定很多
##安裝前記得將sendmail停用並設定開機不啟動



相關套件:
postfix.i386

相關目錄:
/etc/postfix
/etc/postfix/main.cf   //設定檔

設定:
# vim /etc/postfix/main.cf  //修改為
myhostname = a238.snpy.org
mydomain = a238.snpy.org
inet_interfaces = all       //傾聽所有,以下四個不能同時啟用
#inet_interfaces = $myhostname
#inet_interfaces = $myhostname, localhost
#inet_interfaces = localhost
mydestination = $myhostname, localhost.$mydomain, localhost
//如果同時管好幾個網域,ex:a238-a240.snpy.org
//加在mydestination以逗號分隔

#/etc/init.d/postfix restart    

Relay相關設定:
# vim /etc/postfix/main.cf
#mynetworks_style = class
#mynetworks_style = subnet
#mynetworks_style = host
//設定那些情況會Relay,預設為subnet
//subnet:表示以網卡的subnet為準
//class表示已ip class為準
//host表示為localhost

#mynetworks = 168.100.189.0/28, 127.0.0.0/8
#mynetworks = $config_directory/mynetworks
#mynetworks = hash:/etc/postfix/network_table
//設定後會忽略mynetworks_style...
//可以詳細規定接受relay範圍


測試:
# telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
220 a238.snpy.org ESMTP Postfix

# telnet 140.137.215.238 25
Trying 140.137.215.238...
Connected to 140.137.215.238 (140.137.215.238).
Escape character is '^]'.
220 a238.snpy.org ESMTP Postfix

再來可用web mail寄信給tom,再用mutt收信看看
或可以到/var/log/maillog檢查有沒收到外部信件

1 則留言:

  1. How To Make Money On Sports Betting
    Online sports titanium ring betting is available for a whole https://sol.edu.kg/ host of US and European sports betting markets. https://deccasino.com/review/merit-casino/ Some US งานออนไลน์ states, like Louisiana and 토토 사이트 New Jersey, allow

    回覆刪除