N
nickycheng
Unregistered / Unconfirmed
GUEST, unregistred user!
在下面这篇文章中
用Delphi编写邮件特快专递程序
http://www.china-pub.com/computers/emook/wzq/056/info.htm
和 Indy的Demo:SMTPRelay中都有一个问题
DNS检索出来的收信服务器结果都有很多个域名。比如查xxx@hotmail.com的收信服务器,就会出来mx1.hotmail.com,ns1.hotmail.com,ns2.hotmail.com.....等等。结果发信的时候就会频繁报错,因为很多域名都是不接收邮件的。也就是说其中好像只有一个服务器是真正正确的。
如foxmail的邮件特快专递好像就能直接解析出正确的哪一个。
这到底是怎么实现的呢??
请各位研究研究啊。我看那个倒霉rfc文档好几天了,都没找到点有用的东西
==========================
我找到一些资料:
域名解析结果样例
Answer List
Resource name is : sina.com
Type is : MX Class is : IN
MX Priority : 10 MX Server : mailcn.sina.com
Resource name is : sina.com
Type is : MX Class is : IN
MX Priority : 15 MX Server : mail.sina.com.cn
Authority List
Resource name is : sina.com
Type is : NS Class is : IN
Domain name is : resolver.sina.com
Resource name is : sina.com
Type is : NS Class is : IN
Domain name is : ns2.sina.com
Additional Response List
Resource name is : mailcn.sina.com
Type is : A Class is : IN
IP Address is : 202.106.184.233
Resource name is : mail.sina.com.cn
Type is : A Class is : IN
IP Address is : 202.106.187.150
Resource name is : resolver.sina.com
Type is : A Class is : IN
IP Address is : 206.204.114.135
Resource name is : ns2.sina.com
Type is : A Class is : IN
IP Address is : 209.133.24.135
===================================
Network Working Group P. Mockapetris
Request for Comments: 1035 ISI
November 1987
Obsoletes: RFCs 882, 883, 973
DOMAIN NAMES - IMPLEMENTATION AND SPECIFICATION
4. MESSAGES
4.1. Format
All communications inside of the domain protocol are carried in a single
format called a message. The top level format of message is divided
into 5 sections (some of which are empty in certain cases) shown below:
+---------------------+
| Header |
+---------------------+
| Question | the question for the name server
+---------------------+
| Answer | RRs answering the question
+---------------------+
| Authority | RRs pointing toward an authority
+---------------------+
| Additional | RRs holding additional information
+---------------------+
The header section is always present. The header includes fields that
specify which of the remaining sections are present, and also specify
whether the message is a query or a response, a standard query or some
other opcode, etc.
The names of the sections after the header are derived from their use in
standard queries. The question section contains fields that describe a
question to a name server. These fields are a query type (QTYPE), a
query class (QCLASS), and a query domain name (QNAME). The last three
sections have the same format: a possibly empty list of concatenated
resource records (RRs). The answer section contains RRs that answer the
question; the authority section contains RRs that point toward an
authoritative name server; the additional records section contains RRs
which relate to the query, but are not strictly answers for the
question.
我想可以接收邮件的服务器就是分类在Answer中的。但是我不知道怎样用Indy或是DNSQuary查询出对应的服务器地址。
朋友们帮帮忙啦
用Delphi编写邮件特快专递程序
http://www.china-pub.com/computers/emook/wzq/056/info.htm
和 Indy的Demo:SMTPRelay中都有一个问题
DNS检索出来的收信服务器结果都有很多个域名。比如查xxx@hotmail.com的收信服务器,就会出来mx1.hotmail.com,ns1.hotmail.com,ns2.hotmail.com.....等等。结果发信的时候就会频繁报错,因为很多域名都是不接收邮件的。也就是说其中好像只有一个服务器是真正正确的。
如foxmail的邮件特快专递好像就能直接解析出正确的哪一个。
这到底是怎么实现的呢??
请各位研究研究啊。我看那个倒霉rfc文档好几天了,都没找到点有用的东西
==========================
我找到一些资料:
域名解析结果样例
Answer List
Resource name is : sina.com
Type is : MX Class is : IN
MX Priority : 10 MX Server : mailcn.sina.com
Resource name is : sina.com
Type is : MX Class is : IN
MX Priority : 15 MX Server : mail.sina.com.cn
Authority List
Resource name is : sina.com
Type is : NS Class is : IN
Domain name is : resolver.sina.com
Resource name is : sina.com
Type is : NS Class is : IN
Domain name is : ns2.sina.com
Additional Response List
Resource name is : mailcn.sina.com
Type is : A Class is : IN
IP Address is : 202.106.184.233
Resource name is : mail.sina.com.cn
Type is : A Class is : IN
IP Address is : 202.106.187.150
Resource name is : resolver.sina.com
Type is : A Class is : IN
IP Address is : 206.204.114.135
Resource name is : ns2.sina.com
Type is : A Class is : IN
IP Address is : 209.133.24.135
===================================
Network Working Group P. Mockapetris
Request for Comments: 1035 ISI
November 1987
Obsoletes: RFCs 882, 883, 973
DOMAIN NAMES - IMPLEMENTATION AND SPECIFICATION
4. MESSAGES
4.1. Format
All communications inside of the domain protocol are carried in a single
format called a message. The top level format of message is divided
into 5 sections (some of which are empty in certain cases) shown below:
+---------------------+
| Header |
+---------------------+
| Question | the question for the name server
+---------------------+
| Answer | RRs answering the question
+---------------------+
| Authority | RRs pointing toward an authority
+---------------------+
| Additional | RRs holding additional information
+---------------------+
The header section is always present. The header includes fields that
specify which of the remaining sections are present, and also specify
whether the message is a query or a response, a standard query or some
other opcode, etc.
The names of the sections after the header are derived from their use in
standard queries. The question section contains fields that describe a
question to a name server. These fields are a query type (QTYPE), a
query class (QCLASS), and a query domain name (QNAME). The last three
sections have the same format: a possibly empty list of concatenated
resource records (RRs). The answer section contains RRs that answer the
question; the authority section contains RRs that point toward an
authoritative name server; the additional records section contains RRs
which relate to the query, but are not strictly answers for the
question.
我想可以接收邮件的服务器就是分类在Answer中的。但是我不知道怎样用Indy或是DNSQuary查询出对应的服务器地址。
朋友们帮帮忙啦