Indy 9
TMXRecord
Hierarchy, Properties, Methods, Unit: IdDNSResolver
Represents a resource record returned from a DNS query that includes Mail Exchange resource record types.
TMXRecord = class(TResultRecord)
Unit
IdDNSResolver
Description
TMXRecord is a TResultRecord descendant that represents a resource record returned in the results for a DNS query. TMXRecord is a collection item created to represent a resource resource returned when TIDNSResolver.QueryRecords includes the value qtMX for Mail Exchange resource records.

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                    .
  .                                               .
  |                                               |
  +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

  • PREFERENCE - 16-bit integer which specifies the preference given to this resource record among others at the same owner. Lower values indicate a higher preference.

  • EXCHANGE - Variable length Domain name which specifies a host willing to act as a mail exchange for the owner.

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.


TMXRecord.ExchangeServer
TMXRecord
Indicates the host that can act as a mail exchange for a domain.
property ExchangeServer: string;
Description
ExchangeServer is a read-only String property that indicates the host name for a server that can act as a mail exchange for the owner of the resource record.

Use Preference to determine the priority given to a particular ExchangeServer.


TMXRecord.Preference
TMXRecord
Indicates the priority given to the mail exchange server.
property Preference: word;
Description
Preference is a read-only Word property that indicates the priority given to a particular ExchangeServer. A lower value in Preference indicates a higher priority.

Use ExchangeServer to determine the host name tha can act as a mail exchange for the domain.


TMXRecord.Assign
TMXRecord
Copies property values into the current object instance.
procedure Assign(Source: TPersistent); override;
Parameters
Source: TPersistent
Collection item contain value to be copied.
Description
Assign is a procedure that copies the property values from a collection item specified in ASource to the current object instance. If ASource has the same class type as the current object instance, the required properties are copied. Otherwise the inherited Assign method is called using ASource as an argument.

TMXRecord.Create
TMXRecord
Constructor for the object instance.
constructor Create(Collection: TCollection); override;
Parameters
Collection: TCollection
Owner of the collection item.
Description
Create is the constructor for the object instance. Create calls the inherited Create method using Collection as the owner of the collection item.

TMXRecord.Parse
TMXRecord
Parses RData values into properties.
procedure Parse(CompleteMessage: String; APos: Integer); override;
Parameters
CompleteMessage: String
Contents of the resource record.
APos: Integer
Position where RData values begin in the answer.
Description
Parse is an overridden procedure that implements a routine to parse resource record values in the DNS response into their property-based counterparts.

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.


Created with Doc-O-Matic 2 donated to Project JEDI. Commercial license available from the Doc-O-Matic site.