Postfix

可以發送,但不能接收電子郵件

  • November 7, 2014

我可以在我的伺服器上發送但不能接收電子郵件 - 這與我之前遇到的問題類似,但我已經走得更遠了,我的電子郵件發送沒有問題。

我相信電子郵件接收問題是基於我的 MX 記錄。

我的後綴 main.cf 文件如下所示:

readme_directory = no

# TLS parameters
smtpd_tls_cert_file = /etc/ssl/certs/iRedMail_CA.pem
smtpd_tls_key_file = /etc/ssl/private/iRedMail.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

myhostname = domainname.com
alias_maps = hash:/etc/postfix/aliases
alias_database = hash:/etc/postfix/aliases
myorigin = domainname.com
mydestination = $myhostname, localhost, localhost.localdomain, localhost.$myhost
name
relayhost =
mynetworks = 127.0.0.0/8
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
#inet_protocols = ipv4
#virtual_alias_domains =
allow_percent_hack = no
swap_bangpath = no
mydomain = domainname.com
mynetworks_style = host

domainname.com 不是我的真實域名,而是一個假的替身。

我有一個直接指向 domainname.com 的 MX 記錄集。

我看到很多帶有郵件子域的範例 - 這是一個要求嗎?如,我是否應該將 mail.domainname.com 作為我的 mx 記錄,並以某種方式設置子域?或者我目前的設置可以正常工作嗎?

我剛在一兩個小時前創建了 MX 記錄 - 傳播需要多長時間?

還有其他原因我可以發送電子郵件但收不到嗎?我檢查了我的郵件日誌,這些是唯一的消息:

Nov  7 18:09:09 domainname postfix/pipe[29051]: 5D2CC120220: to=<myname@domainname.com>, relay=dovecot, delay=2117, delays=2116/0.04/0/0.08, dsn=4.3.0, status=deferred (temporary failure)
Nov  7 18:09:09 domainname postfix/pipe[29052]: 6C0F1123722: to=<myname@foodfitnow.com>, relay=dovecot, delay=477, delays=476/0.02/0/0.08, dsn=4.3.0, status=deferred (temporary failure)
Nov  7 18:09:09 domainname postfix/pipe[29054]: 976501207F0: to=<myname@domainname.com>, relay=dovecot, delay=990, delays=990/0.03/0/0.06, dsn=4.3.0, status=deferred (temporary failure)
Nov  7 18:10:57 domainname postfix/sendmail[29084]: fatal: myname@gmail.com(33): No recipient addresses found in message header
Nov  7 18:14:09 domainname postfix/qmgr[28334]: B9C071238A6: from=<myname@gmail.com>, size=2448, nrcpt=1 (queue active)
Nov  7 18:14:09 domainname postfix/trivial-rewrite[29100]: warning: do not list domain domainname.com in BOTH mydestination and virtual_mailbox_domains
Nov  7 18:14:09 domainname postfix/qmgr[28334]: A2D8112388A: from=<myname@domainname.com>, size=583, nrcpt=2 (queue active)
Nov  7 18:14:09 domainname postfix/trivial-rewrite[29100]: warning: do not list domain domainname.com in BOTH mydestination and virtual_mailbox_domains
Nov  7 18:14:09 domainname postfix/pipe[29104]: A2D8112388A: to=<myname@domainname.com>, relay=dovecot, delay=2387, delays=2387/0.01/0/0.03, dsn=4.3.0, status=deferred (temporary failure)
Nov  7 18:14:09 domainname postfix/pipe[29103]: B9C071238A6: to=<myname@domainname.com>, relay=dovecot, delay=2370, delays=2370/0.02/0/0.05, dsn=4.3.0, status=deferred (temporary failure)

我很確定我幾乎得到了這個 - 我只需要弄清楚為什麼我的郵件伺服器無法接收郵件。

這是dovecot日誌…似乎是權限問題?

Nov 06 05:36:59 imap(andy@domainname.com): Error: user andy@domainname.com: Initialization failed: Namespace '': stat(//var/vmail/vmail1/domainname.com/a/n/d/andy-2014.11.06.01.31.59//Maildir) failed: Permission denied (euid=2000(<unknown>) egid=2000(<unknown>) missing +x perm: //var/vmail, dir owned by 5000:5000 mode=0700)
Nov 06 05:36:59 imap(andy@domainname.com): Error: Invalid user settings. Refer to server log for more information.
Nov 06 05:37:52 auth-worker: Warning: Killed with signal 15 (by pid=1 uid=0 code=kill)
Nov 06 05:37:52 auth: Warning: Killed with signal 15 (by pid=1 uid=0 code=kill)
Nov 06 05:37:52 anvil: Warning: Killed with signal 15 (by pid=1 uid=0 code=kill)
Nov 06 05:37:52 log: Warning: Killed with signal 15 (by pid=1 uid=0 code=kill)
Nov 06 05:37:52 config: Warning: Killed with signal 15 (by pid=1 uid=0 code=kill)
Nov 06 05:37:52 master: Warning: Killed with signal 15 (by pid=1 uid=0 code=kill)
Nov 06 05:37:52 lmtp(671): Warning: Killed with signal 15 (by pid=1 uid=0 code=kill)
Nov 06 05:37:52 lmtp(672): Warning: Killed with signal 15 (by pid=1 uid=0 code=kill)
Nov 06 05:37:52 lmtp(669): Warning: Killed with signal 15 (by pid=1 uid=0 code=kill)
Nov 06 05:37:52 lmtp(670): Warning: Killed with signal 15 (by pid=1 uid=0 code=kill)
Nov 06 05:37:52 lmtp(673): Warning: Killed with signal 15 (by pid=1 uid=0 code=kill)
Nov 06 05:38:16 master: Info: Dovecot v2.0.19 starting up (core dumps disabled)
Nov 06 05:38:48 auth-worker: Info: mysql(127.0.0.1): Connected to database vmail
Nov 06 05:38:48 imap-login: Info: Login: user=<andy@domainname.com>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=3768, secured
Nov 06 05:38:48 imap(andy@domainname.com): Error: chdir(/var/vmail/vmail1/domainname.com/a/n/d/andy-2014.11.06.01.31.59//) failed: Permission denied (euid=2000(<unknown>) egid=2000(<unknown>) missing +x perm: /var/vmail, dir owned by 5000:5000 mode=0700)

檢查 Dovecot 配置文件中mail_uid 和的值。 它們應該設置為系統使用者mail_gid``/etc/dovecot/dovecot.conf
uid/gid``vmail

例如。

$ id vmail
uid=nnn(vmail) gid=nnn(vmail) groups=nnn(vmail)

此外,該目錄/var/vmail應歸使用者/組所有:vmail:vmail.

$ ls -dl /var/vmail

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