MX Class
Properties Methods Events Configuration Settings Errors
The MX class enables querying of mail exchange (MX) records from a Domain Name Server (DNS). That is, it will find out the name(s) of the mail server(s) accepting email for a given email address or domain.
Syntax
class ipworks.MX
Remarks
The class will attempt to automatically determine the name of a DNS server from the system settings or from the value of the dns_server property.
The class operates in synchronous or asynchronous mode, depending on the value of the timeout property. Calling the resolve method makes the class query the dns_server. The on_response event is fired for each server that handles mail for the email address. The class will fill out the mail_server property with the most preferred mail server and the status property to "Ok" or an error message.
The request_id property may be used to identify requests and is used in the on_response event. The user may set its value before sending out requests, and then match the responses to the request using the RequestId parameter in the on_response event.
Property List
The following is the full list of the properties of the class with short descriptions. Click on the links for further details.
dns_port | The port where the DNS server is listening. |
dns_server | The address of the DNS server. |
idle | The current status of the class. |
local_host | The name of the local host or user-assigned IP interface through which connections are initiated or accepted. |
mail_server | Mail server with lowest precedence value (lowest cost to reach). |
request_id | Identifies each request. |
status | Status of the request is empty while in progress, 'OK' or error message upon completion. |
timeout | A timeout for the class. |
Method List
The following is the full list of the methods of the class with short descriptions. Click on the links for further details.
config | Sets or retrieves a configuration setting. |
do_events | Processes events from the internal message queue. |
interrupt | Interrupt the current method. |
reset | Reset the class. |
resolve | Resolves an email address. |
Event List
The following is the full list of the events fired by the class with short descriptions. Click on the links for further details.
on_error | Information about errors during data delivery. |
on_response | Fired for each MailServer accepting email for the domain. |
Configuration Settings
The following is a list of configuration settings for the class with short descriptions. Click on the links for further details.
CaptureIPPacketInfo | Used to capture the packet information. |
DestinationAddress | Used to get the destination address from the packet information. |
DontFragment | Used to set the Don't Fragment flag of outgoing packets. |
LocalHost | The name of the local host through which connections are initiated or accepted. |
LocalPort | The port in the local host where the class binds. |
MaxPacketSize | The maximum length of the packets that can be received. |
QOSDSCPValue | Used to specify an arbitrary QOS/DSCP setting (optional). |
QOSTrafficType | Used to specify QOS/DSCP settings (optional). |
ShareLocalPort | If set to True, allows more than one instance of the class to be active on the same local port. |
SourceIPAddress | Used to set the source IP address used when sending a packet. |
SourceMacAddress | Used to set the source MAC address used when sending a packet. |
UseConnection | Determines whether to use a connected socket. |
UseIPv6 | Whether or not to use IPv6. |
AbsoluteTimeout | Determines whether timeouts are inactivity timeouts or absolute timeouts. |
FirewallData | Used to send extra data to the firewall. |
InBufferSize | The size in bytes of the incoming queue of the socket. |
OutBufferSize | The size in bytes of the outgoing queue of the socket. |
BuildInfo | Information about the product's build. |
CodePage | The system code page used for Unicode to Multibyte translations. |
LicenseInfo | Information about the current license. |
ProcessIdleEvents | Whether the class uses its internal event loop to process events when the main thread is idle. |
SelectWaitMillis | The length of time in milliseconds the class will wait when DoEvents is called if there are no events to process. |
UseInternalSecurityAPI | Tells the class whether or not to use the system security libraries or an internal implementation. |