Postfix

Postfix、dovecot、squirrelmail 伺服器能夠發送但不能接收電子郵件

  • November 14, 2017

我已經使用本指南設置了一個郵件伺服器:https ://www.ostechnix.com/setup-mail-server-using-postfixdovecotsquirrelmail-in-centosrhelscientific-linux-6-3-step-by-step/

網路郵件允許在自己的使用者之間發送電子郵件,即在本地機器和其他伺服器,如 gmail。但它無法接收來自外界的電子郵件。這是我在 /etc/postfix/main.cf 中的內容:

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
compatibility_level = 2
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5
home_mailbox = Maildir/
html_directory = no
inet_interfaces = localhost
inet_protocols = all
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
meta_directory = /etc/postfix
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mydomain = domain.com
myhostname = mail.domain.com
mynetworks = 192.168.0.0/24, 127.0.0.0/8, [::1]/128
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix/README_FILES
sample_directory = /usr/share/doc/postfix/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
shlib_directory = /usr/lib64/postfix
unknown_local_recipient_reject_code = 550

Mydomain 和 myhostname 是假的。此外,我們的 ISP 不應阻止埠 25 上的任何入站 SMTP 連接,但同時我們必須仔細檢查。請指教!

2017 年 14 月 11 日更新:再次啟用 firewalld 服務並打開上述埠。現在嘗試在 squirrelmail 上發送電子郵件時出現此錯誤: Connection refused 111 Can't open SMTP stream. 請幫助

指令:

inet_interfaces = localhost

限制 Postfix 在 localhost 上接收郵件。嘗試將其設置為

inet_interfaces = all

實際上也接受來自網際網路的傳入連接。

(與其完全禁用該配方中的防火牆,不如在防火牆中打開 TCP 埠 25(SMTP)、143(IMAP)和 80/443(HTTP/HTTPS)並保持啟用。)

引用自:https://serverfault.com/questions/883181