Ubuntu

無法接收帶有 Postfix/Dovecot 的電子郵件 telnet 返回 status0

  • November 25, 2020

我嘗試向我的地址發送電子郵件,但即使在日誌中也找不到任何記錄。我可以在伺服器上發送給自己就好了。當我嘗試遠端登錄到我的伺服器時,我得到以下答案

在此處輸入圖像描述

當我遠端登錄到埠 587 時,它按預期工作。

在我得到的日誌中

warning: unexpected end-of-input from smtp socket while reading input attribute name
smtp socket: wanted attribute: flags
warning: deliver_request_get: error receiving common attributes

這是我的 postconf -M

smtp       inet  n       -       n       -       -       smtp -v
submission inet  n       -       n       -       -       smtpd -v -o syslog_name=postfix/submission -o smtpd_tls_security_level=encrypt -o smtpd_tls_cert_file=/etc/let                                                  sencrypt/live/gamesleeve.io/fullchain.pem -o smtpd_sasl_auth_enable=yes -o smtpd_reject_unlisted_recipient=no -o smtpd_relay_restrictions=permit_sasl_authenticated,rej                                                  ect -o milter_macro_daemon_name=ORIGINATING
pickup     unix  n       -       y       60      1       pickup
cleanup    unix  n       -       y       -       0       cleanup
qmgr       unix  n       -       n       300     1       qmgr
tlsmgr     unix  -       -       y       1000?   1       tlsmgr
rewrite    unix  -       -       y       -       -       trivial-rewrite
bounce     unix  -       -       y       -       0       bounce
defer      unix  -       -       y       -       0       bounce
trace      unix  -       -       y       -       0       bounce
verify     unix  -       -       y       -       1       verify
flush      unix  n       -       y       1000?   0       flush
proxymap   unix  -       -       n       -       -       proxymap
proxywrite unix  -       -       n       -       1       proxymap
smtp       unix  -       -       y       -       -       smtp
relay      unix  -       -       y       -       -       smtp -o syslog_name=postfix/$service_name
showq      unix  n       -       y       -       -       showq
error      unix  -       -       y       -       -       error
retry      unix  -       -       y       -       -       error
discard    unix  -       -       y       -       -       discard
local      unix  -       n       n       -       -       local
virtual    unix  -       n       n       -       -       virtual
lmtp       unix  -       -       y       -       -       lmtp
anvil      unix  -       -       y       -       1       anvil
scache     unix  -       -       y       -       1       scache
maildrop   unix  -       n       n       -       -       pipe flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
uucp       unix  -       n       n       -       -       pipe flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
ifmail     unix  -       n       n       -       -       pipe flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp      unix  -       n       n       -       -       pipe flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
scalemail-backend unix - n       n       -       2       pipe flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
mailman    unix  -       n       n       -       -       pipe flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py ${nexthop} ${user}

這是 postconf -n

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
compatibility_level = 2
home_mailbox = Maildir/
inet_interfaces = all
inet_protocols = ipv4
mailbox_size_limit = 0
mydestination = $myhostname,gamesleeve, gamesleeve.io,eiric.com, localhost.members,localhost
mydomain = gamesleeve.io
myhostname = mail.gamesleeve.io
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = gamesleeve.io
readme_directory = no
recipient_delimiter = +
relayhost =
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl/sasl_passwd
smtp_sasl_security_options =
smtp_tls_cert_file = /etc/letsencrypt/live/gamesleeve.io/fullchain.pem
smtp_tls_key_file = /etc/letsencrypt/live/gamesleeve.io/privkey.pem
smtp_tls_security_level = may
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtp_use_tls = yes
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
smtpd_relay_restrictions = permit_mynetworks reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain =
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_tls_CAfile = /etc/letsencrypt/live/gamesleeve.io/chain.pem
smtpd_tls_cert_file = /etc/letsencrypt/live/gamesleeve.io/fullchain.pem
smtpd_tls_ciphers = high
smtpd_tls_key_file = /etc/letsencrypt/live/gamesleeve.io/privkey.pem
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_security_level = may
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
virtual_alias_domains = eiric.com
virtual_alias_maps = hash:/etc/postfix/virtual

我已經加倍檢查了 MX 記錄,它用 dig 指向 mail.gamesleeve.io

您沒有執行 smtp 伺服器 ( smtpd)。您可能在master.cf文件的第一個非註釋行中引入了錯字。

在你的情況下它看起來像什麼(只看以 smtp 開頭的行):

smtp       inet  n       -       n       -       -       smtp -v
smtp       unix  -       -       y       -       -       smtp

我的預設設置是 - 一個smtp守護程序應該作為 inet/smtp 服務啟動:

smtp       inet  n       -       y       -       -       smtpd
smtp       unix  -       -       y       -       -       smtp

我懷疑這是在您添加非預設-v標誌時發生​​的。您smtpd_banner表示您正在執行 Ubuntu,在那裡您應該找到一個模板/etc/postfix/master.cf.proto,您可以使用該模板將您編輯的設置與分銷商的預設設置進行比較。

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