Dovecot

為什麼我的鴿舍收不到別人發來的郵件?

  • October 30, 2017

我的 vps–centos7 上安裝了 postfix 和 dovecot。

我可以給別人發郵件,為什麼收不到別人發的郵件?

埠沒問題。

netstat -an
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 0.0.0.0:110             0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:143             0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN  

遠端登錄我的vps。

telnet xxxxxxx  110
Trying xxxxxxxx...
Connected to xxxxxx
Escape character is '^]'.
Connection closed by foreign host.

用 .關閉防火牆是沒有用的 systemctl stop firewalld

如何檢查我的鴿舍的錯誤?

1.鴿子會議-n

# 2.2.10: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.32-042stab123.3 x86_64 CentOS Linux release 7.2.1511 (Core)  
disable_plaintext_auth = no
first_valid_uid = 1000
listen = *
log_path = /var/log/dovecot.log
mail_location = mbox:~/mail:INBOX=/var/mail/%u
mbox_write_locks = fcntl
namespace inbox {
 inbox = yes
 location = 
 mailbox Drafts {
   special_use = \Drafts
 }
 mailbox Junk {
   special_use = \Junk
 }
 mailbox Sent {
   special_use = \Sent
 }
 mailbox "Sent Messages" {
   special_use = \Sent
 }
 mailbox Trash {
   special_use = \Trash
 }
 prefix = 
}
passdb {
 driver = pam
}
service auth {
 unix_listener /var/spool/postfix/private/auth {
   group = postfix
   mode = 0660
   user = postfix
 }
 unix_listener auth-userdb {
   mode = 0600
   user = vmail
 }
}
ssl = required
userdb {
 driver = passwd
}
  1. postconf -n

alias_database = hash:/etc/aliases

alias_maps = hash:/etc/aliases

broken_sasl_auth_clients = yes

command_directory = /usr/sbin config_directory =

/etc/postfix

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_id & sleep 5 home_mailbox = Maildir/ html_directory = no inet_interfaces = all inet_protocols = all local_recipient_maps = mail_owner = postfix mailq_path = /usr/bin/mailq.postfix manpage_directory = /usr/share/man mydestination = $ 我的主機名,本地主機。 $ mydomain, localhost, $ 我的域名,郵件。 $ mydomain, www. $ 我的域名,ftp。 $ mydomain mydomain = xxxx myhostname = xxxx mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 myorigin = $ mydomain

newaliases_path = /usr/bin/newaliases.postfix

queue_directory = /var/spool/postfix

readme_directory = /usr/share/doc/postfix-2.10.1/README_FILES

relay_domains = $mydestination

sample_directory = /usr/share/doc/postfix- 2.10.1/samples

sendmail_path = /usr/sbin/sendmail.postfix

setgid_group = postdrop

smtpd_client_restrictions = permit_sasl_authenticated

smtpd_recipient_restrictions = permit_sasl_authenticated,reject_unauth_destination,permit_mynetworks smtpd_sasl_auth_enable = yes

smtpd_sasl_security_options = noanonymous

unknown_local_recipient_reject_code = 550 3. 遠端登錄 xxxx 25

Trying xxxx

Connected to xxxxxx

Escape character is ‘^]’。

220 xxxxxx ESMTP 後綴

dig domain.tld in MX

給你一個回复,顯示如下:

domain.tld.  86400 IN MX 10 mail.domain.tld.

如果沒有,您需要在 DNS 中添加一條 MX 記錄,如下所示:

owner-name           ttl  class   rr  pref name
example.com.         3w   IN      MX  10   mail.example.com.

這是一個體面的解釋和上述範例的來源:

zytrax.com 上的郵件交換記錄 (MX)

dig  mydomain.com in MX

;; AUTHORITY SECTION:
mydomain.com        285 IN  SOA 


dig  mail.mydomain.com  in MX

;; ANSWER SECTION:
mail.mydomain.com.  300 IN  MX  10 mydomain.com

mydomain.com 沒有添加 MX 記錄,mail.mydomain.com 添加了 MX 記錄。

在我的域名伺服器中為 mydomain.com 而不是 mail.mydomain.com 在 DNS 中添加 MX 記錄。

owner-name           ttl  class   rr  pref name
mydomain.com         3w   IN      MX  10   mydomain.com

引用自:https://unix.stackexchange.com/questions/401228