postfix 的安裝

安裝它, 我們將使用 dnf . 但要做到這一點,必 須在系統上啟用 訂閱管理存儲庫 才能訪問我們將安裝的軟件源。

dnf install postfix

啟用和啟動 systemd 服務中心

netstat -lnpt | grep master   # 端口查看
firewall-cmd --permanent --zone=public --add-service=smtp
firewall-cmd --reload

systemctl enable --now postfix

postfix 相關設定  /etc/postfix/main.cf (主文件)

# 使用 postconf 命令来配置 送到 /etc/postfix/main.cf
postconf -e 'mydomain = dxQerp.com'
postconf -e 'myhostname = mail.dxQerp.com'
postconf -e 'myorigin = $mydomain'
postconf -e 'inet_interfaces = all'
postconf -e 'mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain'
postconf -e 'mynetworks = 192.168.17.0/24'
postconf -e 'home_mailbox = Maildir/'  # 设置邮箱路径

參數相同 ‘值’ 不同 依據 最後的 ‘值’ 為主 上表的設定意義是:區域網路內的 MUA 不需要認證也能夠進行 relay ,而非區網內的其他來源才需要進行 SMTP 認證之意

postfix reload  #  重新讀入設定檔,也就是 /etc/postfix/main.cf
postfix check  #  檢查 postfix 相關的檔案、權限等是否正確!
postfix start  # 開始 postfix 的執行 !
postfix stop   # 關閉 postfix !
postfix flush  # 強制將目前正在郵件佇列的郵件寄出!
postconf -d -df # 默認參數設置而不是實際設置
postconf -n -nf # 僅顯式名稱=值 的配置參數,指定 -nf 為人類折疊長線可讀性(Postfix 2.9 及更高版本)。
postconf -a    # 檢查 Postfix 是否支持 Dovecot SASL (SASL support in the SMTP server)
postconf -A    # 查詢 SASL support in the SMTP+LMTP client

測試 telnet localhost smtp


安裝 Dovecot

dnf install dovecot

systemctl start  dovecot
systemctl restart dovecot
systemctl enable dovecot
firewall-cmd --permanent --zone=public --add-service=pop3
firewall-cmd --permanent --zone=public --add-service=imap
netstat -anpt | grep dovecot
netstat -lntp | grep dovecot
firewall-cmd --reload 

Dovecot 相關設定

/etc/dovecot/conf.d/10-auth.conf
disable_plaintext_auth = no # 使用明文驗證 
/etc/dovecot/conf.d/10-ssl.conf
ssl=no            # 不要求 SSL

THE END

個人頭像照片

By 伍芳左

MIS, ERP Pro... RHCE Member (7.2)

發表迴響