问题原文
原帖链接 · Misha Sunseev · CC BY-SA 3.0
mailq gives me this error:
F2E7B32820F3 3549 Wed Feb 17 12:15:50 "www-data@info"@hivemind.ru
(host mxs.mail.ru[94.100.180.150] said: 421 Problem resolving DNS for domain info"@hivemind.ru (Domain name is syntactically invalid) (in reply to MAIL FROM command))
I see this type of messages generated by the same software (old SMF forum), but i can't find exact piece. Search in internet gives me no results.
Forum software seems to generate message properly:
postcat -vq 0492D3282068
postcat: name_mask: all
postcat: inet_addr_local: configured 2 IPv4 addresses
postcat: inet_addr_local: configured 2 IPv6 addresses
*** ENVELOPE RECORDS maildrop/0492D3282068 ***
message_arrival_time: Sun Feb 21 15:01:55 2016
named_attribute: rewrite_context=local
sender_fullname: www-data
sender: www-data
*** MESSAGE CONTENTS maildrop/0492D3282068 ***
regular_text: To: [email omitted]
regular_text: Subject: =?UTF-8?B?0JTQvtCx0YDQviDQv9C+0LbQsNC70L7QstCw0YLRjCDQvdCwINGE0L7RgNGD0LwgUFNZVFJJQkU=?=
regular_text: X-PHP-Originating-Script: 0:Subs-Post.php
regular_text: From: "PSYTRIBE" <[email omitted]>
regular_text: Return-Path: [email omitted]
regular_text: Date: Sun, 21 Feb 2016 12:01:54 -0000
regular_text: X-Mailer: SMF
regular_text: Mime-Version: 1.0
regular_text: Content-Type: multipart/alternative; boundary="SMF-e8a857e57a7c03288f525582f6bdb280"
regular_text: Content-Transfer-Encoding: 7bit
How can i understand where i should look for mistake?
已采纳解答
原帖链接 · kasperd · CC BY-SA 3.0
Probably there are three different things going wrong in your setup. Here is my best guess as to what has happened.
- The server has never been configured with a FQDN and has only the name
info. - An email is generated by the user
www-data. - Since no other email address has been specified, it is automatically constructed by combining the username and host name.
- The constructed email address at this point is
www-data@info, which is incorrect (unless you control theinfoTLD and have configured an MX record directly on the TLD, which is not the case). - This email address is passed to another piece of software which will accept either a full email address or just a username.
- The email address is parsed to decide that it is only a username and not a full email address.
- The username is combined with the domain name, which is different from the hostname used by the previous software. Because
www-data@infois assumed to be the username and it contains a@character, it is quoted in accordance with relevant RFCs. This means the email address sent on the wire will look like<"www-data@info"@hivemind.ru>. This is syntactically valid, but probably not what you intended. - The next piece of software parsing this address is buggy and does not parse it according to RFC. It incorrectly believes the first
@separates the local-part from the domain even though the first@is within quotes.
The three things that went wrong here is that:
- At first the domain name
infowas used rather than the intended domain. - Later some software uses a heuristic to decide whether it has been given a full address or only a local-part, it reaches a different conclusion than was intended by the software that produced that input.
- A bug in a parser which doesn't understand quoted-string cause it to incorrectly reject the domain as being invalid.
RFC 2821 recommends against using addresses which require quoting. And your scenario shows why it is sound to recommend against such practice.
While the above definition for Local-part is relatively permissive, for maximum interoperability, a host that expects to receive mail SHOULD avoid defining mailboxes where the Local-part requires (or uses) the Quoted-string form or where the Local-part is case- sensitive.
You didn't actually intend to use quoting in the first place. It only happened due to some misconfigured software earlier in the process. You need to work your way backwards in the data flow to find where info was incorrectly used as domain name in the first place and correct that.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
