這篇文章主要介紹Linux中如何安裝postfix,文中介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們一定要看完!
網(wǎng)站建設(shè)哪家好,找創(chuàng)新互聯(lián)建站!專注于網(wǎng)頁設(shè)計、網(wǎng)站建設(shè)、微信開發(fā)、小程序開發(fā)、集團企業(yè)網(wǎng)站建設(shè)等服務(wù)項目。為回饋新老客戶創(chuàng)新互聯(lián)還提供了義縣免費建站歡迎大家使用!
安裝postfix
postfix是一個快速、易于管理、安全性高的郵件發(fā)送服務(wù),可以配合dovecot實現(xiàn)一個完美的郵箱服務(wù)器。
1、安裝postfix
[root@localhost ~]# rpm -qa | grep postfix
[root@localhost ]# yum install -y postfix
Loaded plugins: fastestmirror, refresh-packagekit, security
Complete!
[root@localhost]#
|
2、配置postfix,編輯配置文件“/etc/postfix/main.cf”
[root@localhost ~]# gedit /etc/postfix/main.cf
mydomain = david.cn //DNS 中的域名
myhostname = mailsrv.david.cn //dns 中的域名
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
inet_interfaces = all // 允許處理所有網(wǎng)路信息
inet_protocols = all // 允許 ipv4 和 ipv6
mynetworks = 192.168.0.0/24, 127.0.0.0/8 // 允許接入的 ip 段
|
3、設(shè)置防火墻,postfix使用25端口
[root@localhost ~]# gedit /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 25 -j ACCEPT
[root@localhost ~]# service iptables restart
iptables :將鏈設(shè)置為政策 ACCEPT : filter nat [ 確定 ]
iptables :清除防火墻規(guī)則: [ 確定 ]
iptables :正在卸載模塊: [ 確定 ]
iptables :應(yīng)用防火墻規(guī)則: [ 確定 ]
iptables :載入額外模塊: nf_conntrack_ftp [ 確定 ]
|
4、啟動服務(wù)
[root@localhost ~]# service postfix start
啟動 postfix : [ 確定 ]
[root@localhost ~]#
|
5、連接測試
[root@localhost ~]# telnet 192.168.0.113 25 //ip 是本機地址, 25 是端口號
Trying 192.168.0.113...
Connected to 192.168.0.113.
Escape character is '^]'.
220 mailsrv.david.cn ESMTP Postfix
|
6、發(fā)信
[root@localhost ~]# mail david // 給 david 發(fā)信,確保此用戶存在 Linux 系統(tǒng)中。發(fā)信人是當前登錄的用戶 root
Subject: test04 // 標題
hello david // 內(nèi)容
. // 結(jié)束
EOT
[root@localhost ~]# mail -u david // 查看用戶 david 的信件
Heirloom Mail version 12.4 7/29/08. Type ? for help.
"/var/mail/david": 5 messages 1 new
1 root Thu Aug 16 17:07 21/692 "test"
2 root Thu Aug 16 17:08 20/631 "test"
3 root Thu Aug 16 17:10 20/602 "test"
4 root Fri Aug 17 08:15 20/570 "test3"
>N 5 root Fri Aug 17 09:46 18/539 "test04" // 此信件是剛才收到的,由 root 用戶發(fā)出
&
|
以上是“Linux中如何安裝postfix”這篇文章的所有內(nèi)容,感謝各位的閱讀!希望分享的內(nèi)容對大家有幫助,更多相關(guān)知識,歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道!
網(wǎng)站名稱:Linux中如何安裝postfix
轉(zhuǎn)載來源:http://aaarwkj.com/article8/ihhiip.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供ChatGPT、電子商務(wù)、品牌網(wǎng)站建設(shè)、域名注冊、手機網(wǎng)站建設(shè)、品牌網(wǎng)站制作
廣告
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源:
創(chuàng)新互聯(lián)