Indy 9
|
TMXRecord = class(TResultRecord)
Mail Exchange resoure records are used to determine the host serfver that can accept mail for the specified domain name. Mail Exchange resoure records also contain information about preference values which rank the hosts according to an order specified by the administrators for the domain.
A Mail Exchange resource record uses the same DNS packet layout as other TResultRecord-based responses, but extends the use of RData to include the following definition and format:
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | PREFERENCE | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | | . . . EXCHANGE . . . | | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
Using a DNS query that includes Mail Exchange resource record type may result in additional TARecord resource records being processed for the ExchangeServer specified. The use of Mail Exchange resource records is explained in detail in RFC 974.
TMXRecord extends TResultRecord to implement the specifics of accessing RData values as properties, including ExchangeServer and Preference. TMXRecord also overrides the Parse method to read the values in RData into their property counterparts.
property ExchangeServer: string;
Use Preference to determine the priority given to a particular ExchangeServer.
property Preference: word;
Use ExchangeServer to determine the host name tha can act as a mail exchange for the domain.
procedure Assign(Source: TPersistent); override;
constructor Create(Collection: TCollection); override;
procedure Parse(CompleteMessage: String; APos: Integer); override;
CompleteMessage is the contents of the resource record. Since the DNS message can contain compressed data, the whole message is needed for parsing and pointer location.
APos is the position in the resource record where RData values for this record type are located in the DNS Answer.
Parse calls the inherited Parse method, and retrieves the DNS labels and values for the Preference and ExchangeServer properties.